From c6ea5d087a3abdfddc146d142c979922a909d3a1 Mon Sep 17 00:00:00 2001 From: Michael Heyman Date: Thu, 7 Sep 2023 03:04:52 -0400 Subject: [PATCH] [flux] new port (#33407) Co-authored-by: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com> --- ports/flux/portfile.cmake | 25 +++++++++++++++++++++++++ ports/flux/targets-fixup.patch | 33 +++++++++++++++++++++++++++++++++ ports/flux/vcpkg.json | 16 ++++++++++++++++ versions/baseline.json | 4 ++++ versions/f-/flux.json | 9 +++++++++ 5 files changed, 87 insertions(+) create mode 100644 ports/flux/portfile.cmake create mode 100644 ports/flux/targets-fixup.patch create mode 100644 ports/flux/vcpkg.json create mode 100644 versions/f-/flux.json diff --git a/ports/flux/portfile.cmake b/ports/flux/portfile.cmake new file mode 100644 index 0000000000..4b5d6c1176 --- /dev/null +++ b/ports/flux/portfile.cmake @@ -0,0 +1,25 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO tcbrindle/flux + REF 1c128b50af95fc39b6683d437f9210239e219836 + SHA512 c07d3053227d6a62f5a7b0aba8535c0ed42195249d131a77989b3ee79a697f8d540b68639dcd9e89b5cdd76ee5d7f07db9b3be23bc325761c85af625f507e393 + HEAD_REF master + PATCHES + targets-fixup.patch +) + +set(VCPKG_BUILD_TYPE release) # header-only port + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DFLUX_BUILD_EXAMPLES=OFF + -DFLUX_BUILD_TESTS=OFF +) + + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/flux) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE_1_0.txt") diff --git a/ports/flux/targets-fixup.patch b/ports/flux/targets-fixup.patch new file mode 100644 index 0000000000..3eba08b8c2 --- /dev/null +++ b/ports/flux/targets-fixup.patch @@ -0,0 +1,33 @@ +diff --git i/CMakeLists.txt w/CMakeLists.txt +index e87b3c7..c6239f0 100644 +--- i/CMakeLists.txt ++++ w/CMakeLists.txt +@@ -118,4 +118,27 @@ install( + DIRECTORY "${PROJECT_SOURCE_DIR}/include" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/.." + PATTERN "build2file" EXCLUDE +-) ++) ++ ++# ++# Removes the INTERFACE_SOURCES flux::flux property in the flux-targets.cmake ++# file that is there only because of the poor interaction of the ++# $ with the install(TARGETS...) command. The generator ++# creates an empty string instead of no string and the install(TARGETS...) ++# takes that empty string as a indication that the code should put the source ++# path in as a source file list (why?). ++# ++# The code here gets inserted into near the end of the cmake_install.cmake ++# file. It reads the flux-targets.cmake file into memory, clears the file, ++# then recreates the file skipping the line that contains the malformed ++# INTERFACE_SOURCES property value. ++# ++set(FLUX_TARGETS_FILE "${CMAKE_INSTALL_PREFIX}/lib/cmake/flux/flux-targets.cmake") ++install(CODE ++ "file (STRINGS \"${FLUX_TARGETS_FILE}\" FLUX_TARGETS_FILE_LINES) ++ file(WRITE \"${FLUX_TARGETS_FILE}\" \"\") ++ foreach(FLUX_TARGETS_FILE_LINE IN LISTS FLUX_TARGETS_FILE_LINES) ++ if (NOT FLUX_TARGETS_FILE_LINE MATCHES \"^[ \t]*INTERFACE_SOURCES[ \t].*$\") ++ file(APPEND \"${FLUX_TARGETS_FILE}\" \"\${FLUX_TARGETS_FILE_LINE}\\n\") ++ endif() ++ endforeach()") diff --git a/ports/flux/vcpkg.json b/ports/flux/vcpkg.json new file mode 100644 index 0000000000..33f736af16 --- /dev/null +++ b/ports/flux/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "flux", + "version-date": "2023-08-25", + "description": "Experimental C++20 library that provides a broadly equivalent feature set to C++20 Ranges, but uses a slightly different model based around cursors rather than iterators. Safer, easier, more efficient, compatible.", + "homepage": "https://github.com/tcbrindle/flux", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 216ccfe979..18a874a743 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2608,6 +2608,10 @@ "baseline": "2.3.3", "port-version": 0 }, + "flux": { + "baseline": "2023-08-25", + "port-version": 0 + }, "fmem": { "baseline": "c-libs-2ccee3d2fb", "port-version": 3 diff --git a/versions/f-/flux.json b/versions/f-/flux.json new file mode 100644 index 0000000000..1241c2902e --- /dev/null +++ b/versions/f-/flux.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "3be6cb846e140bc6b745f684bbd4141cae6c4dbd", + "version-date": "2023-08-25", + "port-version": 0 + } + ] +}