Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions ports/librats/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO librats/librats
REF "${VERSION}"
SHA512 560371320e8c6aa94bfd6c5c0ff257d7beafac5ab2f88d20546b4221c59acf489eed9e000b4cdef475659cac7bccff135615e501ae34162fd3ea28bda25c2db1
HEAD_REF master
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
bindings RATS_BINDINGS
search-features RATS_SEARCH_FEATURES
storage RATS_STORAGE
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" RATS_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" RATS_STATIC)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DRATS_SHARED_LIBRARY=${RATS_SHARED}
-DRATS_STATIC_LIBRARY=${RATS_STATIC}
-DRATS_BUILD_TESTS=OFF
-DRATS_BUILD_CLIENT=OFF
-DRATS_BUILD_EXAMPLES=OFF
-DRATS_INSTALL=ON
-DRATS_VERSION_OVERRIDE=${VERSION}
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME rats CONFIG_PATH lib/cmake/rats)

# Headers only — drop debug copy and any binaries that landed under share/.
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

# librats is MIT, but it embeds adapted single-primitive crypto sources and, for
# Android API < 24, a getifaddrs() shim. Each keeps its own notice; see
# THIRD_PARTY_NOTICES.md upstream for provenance and the list of modifications.
vcpkg_install_copyright(
COMMENT [[
librats is licensed under the MIT license. It additionally embeds adapted
third-party sources that carry their own notices, reproduced below:

* src/crypto/curve25519.* curve25519-donna BSD-3-Clause
* src/crypto/poly1305.* poly1305-donna MIT
* src/crypto/{chacha,sha256,sha512,blake2*}.*
noise-c MIT
* 3rdparty/android/ifaddrs-* ifaddrs-android BSD-2-Clause AND
(Android API < 24) BSD-1-Clause
]]
FILE_LIST
"${SOURCE_PATH}/LICENSE"
"${SOURCE_PATH}/licenses/curve25519-donna.LICENSE"
"${SOURCE_PATH}/licenses/poly1305-donna.LICENSE"
"${SOURCE_PATH}/licenses/noise-c.LICENSE"
"${SOURCE_PATH}/licenses/ifaddrs-android.LICENSE"
)
29 changes: 29 additions & 0 deletions ports/librats/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "librats",
"version": "2.0.9",
"description": "C++17 peer-to-peer networking library: encrypted P2P (Noise XX), DHT/mDNS discovery, NAT traversal (STUN/UPnP/NAT-PMP), GossipSub pub/sub, file transfer, optional BitTorrent.",
"homepage": "https://github.com/librats/librats",
"license": "MIT AND BSD-3-Clause AND BSD-2-Clause AND BSD-1-Clause",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"bindings": {
"description": "Build the C API used by Node.js / Python / Java bindings"
},
"search-features": {
"description": "Enable BitTorrent client (bt_*, tracker, disk_io, info_hash spider)"
},
"storage": {
"description": "Enable distributed key-value storage module"
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5592,6 +5592,10 @@
"baseline": "0.11.0",
"port-version": 0
},
"librats": {
"baseline": "2.0.9",
"port-version": 0
},
"libraw": {
"baseline": "0.22.1",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/librats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "ece0b56bd5d3a192920acbebbc21c144bae4af5f",
"version": "2.0.9",
"port-version": 0
}
]
}
Loading