From ff9b47f7c77a9a49a99c013a8895e60fca360467 Mon Sep 17 00:00:00 2001 From: Jia Yue Hua <3423893+jiayuehua@users.noreply.github.com> Date: Sat, 28 Oct 2023 11:03:22 +0800 Subject: [PATCH] [rivers] add new port (#34701) * [rivers] add new port * versions * [rivers] add new port * [rivers] add new port * [rivers] add new port * [rivers] add new port * [rivers] add new port * [rivers] add new port * [rivers] delete default-features --- ports/rivers/add-install-configuration.patch | 76 ++++++++++++++++++++ ports/rivers/portfile.cmake | 28 ++++++++ ports/rivers/vcpkg.json | 25 +++++++ versions/baseline.json | 4 ++ versions/r-/rivers.json | 9 +++ 5 files changed, 142 insertions(+) create mode 100644 ports/rivers/add-install-configuration.patch create mode 100644 ports/rivers/portfile.cmake create mode 100644 ports/rivers/vcpkg.json create mode 100644 versions/r-/rivers.json diff --git a/ports/rivers/add-install-configuration.patch b/ports/rivers/add-install-configuration.patch new file mode 100644 index 00000000000000..aafe48824cfdf9 --- /dev/null +++ b/ports/rivers/add-install-configuration.patch @@ -0,0 +1,76 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 981ef20..89c5a6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,20 +9,45 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + add_library(rivers INTERFACE) + add_library(rivers::rivers ALIAS rivers) +-target_include_directories(rivers INTERFACE include) ++target_include_directories(rivers ++ INTERFACE ++ $ ++ $ ++ ) + + option(RVR_IMPORT_FMT Off) + if(RVR_IMPORT_FMT) +- include(FetchContent) +- FetchContent_Declare( +- fmt +- GIT_REPOSITORY https://github.com/fmtlib/fmt.git +- GIT_TAG 713c7c7c62044329d26c19323ffa0e64d69d2d64 +- ) +- FetchContent_MakeAvailable(fmt) +- ++ find_package(fmt CONFIG REQUIRED) + target_link_libraries(rivers INTERFACE fmt::fmt) + endif() + +-add_subdirectory(bench) +-add_subdirectory(test) ++include(CMakePackageConfigHelpers) ++ ++configure_package_config_file( ++ cmake/unofficial-rivers-config.cmake.in ++ "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-rivers-config.cmake" ++ INSTALL_DESTINATION lib/cmake/unofficial-rivers/ ++ NO_CHECK_REQUIRED_COMPONENTS_MACRO) ++ ++ ++# Export. ++export( ++ TARGETS rivers ++ FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-rivers-targets.cmake") ++ ++# Install. ++install(TARGETS rivers EXPORT unofficial-rivers) ++ ++install( ++ EXPORT unofficial-rivers ++ NAMESPACE unofficial-rivers:: ++ FILE unofficial-rivers-targets.cmake ++ DESTINATION lib/cmake/unofficial-rivers) ++ ++install(DIRECTORY include/rivers DESTINATION include) ++ ++install( ++ FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-rivers-config.cmake" ++ DESTINATION lib/cmake/unofficial-rivers) ++ +diff --git a/cmake/unofficial-rivers-config.cmake.in b/cmake/unofficial-rivers-config.cmake.in +new file mode 100644 +index 0000000..a347972 +--- /dev/null ++++ b/cmake/unofficial-rivers-config.cmake.in +@@ -0,0 +1,9 @@ ++ ++@PACKAGE_INIT@ ++include(CMakeFindDependencyMacro) ++ ++include("${CMAKE_CURRENT_LIST_DIR}/unofficial-rivers-targets.cmake") ++if(@RVR_IMPORT_FMT@) ++ find_dependency(fmt CONFIG) ++endif() ++ diff --git a/ports/rivers/portfile.cmake b/ports/rivers/portfile.cmake new file mode 100644 index 00000000000000..c19b8243334c07 --- /dev/null +++ b/ports/rivers/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO brevzin/rivers + REF cfbd4c3e0ca9fcde03075327d6dd628e57589342 + SHA512 4dfa4a1e657c6a12446abe6d7c54d5bc3d47d82e8639eb91f98c7120b3ca79a6cfa761a357dc2285027823177ee76be346adddc7861f0f213cd0bc7cde041ab8 + HEAD_REF main + PATCHES add-install-configuration.patch +) + +set(VCPKG_BUILD_TYPE release) # header-only + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + fmt RVR_IMPORT_FMT +) +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH "lib/cmake/unofficial-rivers") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/rivers/vcpkg.json b/ports/rivers/vcpkg.json new file mode 100644 index 00000000000000..78c88812b1229a --- /dev/null +++ b/ports/rivers/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "rivers", + "version-date": "2022-05-16", + "description": "A C++ internal iteration library based loosely on Java Streams", + "homepage": "https://github.com/brevzin/rivers/", + "license": "BSL-1.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "fmt": { + "description": "Use fmt as rivers fommatter", + "dependencies": [ + "fmt" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 49424bcc63ce23..f7e35427b16807 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7400,6 +7400,10 @@ "baseline": "0.2.1", "port-version": 0 }, + "rivers": { + "baseline": "2022-05-16", + "port-version": 0 + }, "rkcommon": { "baseline": "1.10.0", "port-version": 0 diff --git a/versions/r-/rivers.json b/versions/r-/rivers.json new file mode 100644 index 00000000000000..aa284ec96bfbac --- /dev/null +++ b/versions/r-/rivers.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "9a0a33765347e8652eecf77097b57cfdbc7e4184", + "version-date": "2022-05-16", + "port-version": 0 + } + ] +}