|
| 1 | +vcpkg_from_github( |
| 2 | + OUT_SOURCE_PATH SOURCE_PATH |
| 3 | + REPO librats/librats |
| 4 | + REF "${VERSION}" |
| 5 | + SHA512 560371320e8c6aa94bfd6c5c0ff257d7beafac5ab2f88d20546b4221c59acf489eed9e000b4cdef475659cac7bccff135615e501ae34162fd3ea28bda25c2db1 |
| 6 | + HEAD_REF master |
| 7 | +) |
| 8 | + |
| 9 | +vcpkg_check_features( |
| 10 | + OUT_FEATURE_OPTIONS FEATURE_OPTIONS |
| 11 | + FEATURES |
| 12 | + bindings RATS_BINDINGS |
| 13 | + search-features RATS_SEARCH_FEATURES |
| 14 | + storage RATS_STORAGE |
| 15 | +) |
| 16 | + |
| 17 | +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" RATS_SHARED) |
| 18 | +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" RATS_STATIC) |
| 19 | + |
| 20 | +vcpkg_cmake_configure( |
| 21 | + SOURCE_PATH "${SOURCE_PATH}" |
| 22 | + OPTIONS |
| 23 | + ${FEATURE_OPTIONS} |
| 24 | + -DRATS_SHARED_LIBRARY=${RATS_SHARED} |
| 25 | + -DRATS_STATIC_LIBRARY=${RATS_STATIC} |
| 26 | + -DRATS_BUILD_TESTS=OFF |
| 27 | + -DRATS_BUILD_CLIENT=OFF |
| 28 | + -DRATS_BUILD_EXAMPLES=OFF |
| 29 | + -DRATS_INSTALL=ON |
| 30 | + -DRATS_VERSION_OVERRIDE=${VERSION} |
| 31 | +) |
| 32 | + |
| 33 | +vcpkg_cmake_install() |
| 34 | + |
| 35 | +vcpkg_cmake_config_fixup(PACKAGE_NAME rats CONFIG_PATH lib/cmake/rats) |
| 36 | + |
| 37 | +# Headers only — drop debug copy and any binaries that landed under share/. |
| 38 | +file(REMOVE_RECURSE |
| 39 | + "${CURRENT_PACKAGES_DIR}/debug/include" |
| 40 | + "${CURRENT_PACKAGES_DIR}/debug/share" |
| 41 | +) |
| 42 | + |
| 43 | +# librats is MIT, but it embeds adapted single-primitive crypto sources and, for |
| 44 | +# Android API < 24, a getifaddrs() shim. Each keeps its own notice; see |
| 45 | +# THIRD_PARTY_NOTICES.md upstream for provenance and the list of modifications. |
| 46 | +vcpkg_install_copyright( |
| 47 | + COMMENT [[ |
| 48 | +librats is licensed under the MIT license. It additionally embeds adapted |
| 49 | +third-party sources that carry their own notices, reproduced below: |
| 50 | +
|
| 51 | + * src/crypto/curve25519.* curve25519-donna BSD-3-Clause |
| 52 | + * src/crypto/poly1305.* poly1305-donna MIT |
| 53 | + * src/crypto/{chacha,sha256,sha512,blake2*}.* |
| 54 | + noise-c MIT |
| 55 | + * 3rdparty/android/ifaddrs-* ifaddrs-android BSD-2-Clause AND |
| 56 | + (Android API < 24) BSD-1-Clause |
| 57 | +]] |
| 58 | + FILE_LIST |
| 59 | + "${SOURCE_PATH}/LICENSE" |
| 60 | + "${SOURCE_PATH}/licenses/curve25519-donna.LICENSE" |
| 61 | + "${SOURCE_PATH}/licenses/poly1305-donna.LICENSE" |
| 62 | + "${SOURCE_PATH}/licenses/noise-c.LICENSE" |
| 63 | + "${SOURCE_PATH}/licenses/ifaddrs-android.LICENSE" |
| 64 | +) |
0 commit comments