diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/rivers | |
Diffstat (limited to 'vcpkg/ports/rivers')
| -rw-r--r-- | vcpkg/ports/rivers/add-install-configuration.patch | 76 | ||||
| -rw-r--r-- | vcpkg/ports/rivers/portfile.cmake | 28 | ||||
| -rw-r--r-- | vcpkg/ports/rivers/vcpkg.json | 25 |
3 files changed, 129 insertions, 0 deletions
diff --git a/vcpkg/ports/rivers/add-install-configuration.patch b/vcpkg/ports/rivers/add-install-configuration.patch new file mode 100644 index 0000000..aafe488 --- /dev/null +++ b/vcpkg/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 ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ++ $<INSTALL_INTERFACE:include> ++ ) + + 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/vcpkg/ports/rivers/portfile.cmake b/vcpkg/ports/rivers/portfile.cmake new file mode 100644 index 0000000..c19b824 --- /dev/null +++ b/vcpkg/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/vcpkg/ports/rivers/vcpkg.json b/vcpkg/ports/rivers/vcpkg.json new file mode 100644 index 0000000..78c8881 --- /dev/null +++ b/vcpkg/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" + ] + } + } +} |