Skip to content

Commit bfb4c3e

Browse files
committed
[librats] Add new librats port
1 parent d92484e commit bfb4c3e

4 files changed

Lines changed: 106 additions & 0 deletions

File tree

ports/librats/portfile.cmake

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
)

ports/librats/vcpkg.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "librats",
3+
"version": "2.0.9",
4+
"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.",
5+
"homepage": "https://github.com/librats/librats",
6+
"license": "MIT AND BSD-3-Clause AND BSD-2-Clause AND BSD-1-Clause",
7+
"supports": "!uwp",
8+
"dependencies": [
9+
{
10+
"name": "vcpkg-cmake",
11+
"host": true
12+
},
13+
{
14+
"name": "vcpkg-cmake-config",
15+
"host": true
16+
}
17+
],
18+
"features": {
19+
"bindings": {
20+
"description": "Build the C API used by Node.js / Python / Java bindings"
21+
},
22+
"search-features": {
23+
"description": "Enable BitTorrent client (bt_*, tracker, disk_io, info_hash spider)"
24+
},
25+
"storage": {
26+
"description": "Enable distributed key-value storage module"
27+
}
28+
}
29+
}

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5592,6 +5592,10 @@
55925592
"baseline": "0.11.0",
55935593
"port-version": 0
55945594
},
5595+
"librats": {
5596+
"baseline": "2.0.9",
5597+
"port-version": 0
5598+
},
55955599
"libraw": {
55965600
"baseline": "0.22.1",
55975601
"port-version": 0

versions/l-/librats.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "ece0b56bd5d3a192920acbebbc21c144bae4af5f",
5+
"version": "2.0.9",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)