aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libtorrent
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libtorrent
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libtorrent')
-rw-r--r--vcpkg/ports/libtorrent/portfile.cmake90
-rw-r--r--vcpkg/ports/libtorrent/vcpkg.json64
2 files changed, 154 insertions, 0 deletions
diff --git a/vcpkg/ports/libtorrent/portfile.cmake b/vcpkg/ports/libtorrent/portfile.cmake
new file mode 100644
index 0000000..27c8272
--- /dev/null
+++ b/vcpkg/ports/libtorrent/portfile.cmake
@@ -0,0 +1,90 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ # Building python bindings is currently broken on Windows
+ if("python" IN_LIST FEATURES)
+ message(FATAL_ERROR "The python feature is currently broken on Windows")
+ endif()
+ if(VCPKG_CRT_LINKAGE STREQUAL "static")
+ set(_static_runtime ON)
+ endif()
+endif()
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ deprfun deprecated-functions
+ examples build_examples
+ iconv iconv
+ python python-bindings
+ test build_tests
+ tools build_tools
+)
+
+if("python" IN_LIST FEATURES)
+ vcpkg_find_acquire_program(PYTHON3)
+ get_filename_component(PYTHON3_PATH ${PYTHON3} DIRECTORY)
+ vcpkg_add_to_path(${PYTHON3_PATH})
+ file(GLOB BOOST_PYTHON_LIB "${CURRENT_INSTALLED_DIR}/lib/*boost_python*")
+ string(REGEX REPLACE ".*(python)([0-9])([0-9]+).*" "\\1\\2\\3" _boost-python-module-name "${BOOST_PYTHON_LIB}")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO arvidn/libtorrent
+ REF "v${VERSION}"
+ SHA512 375fb12754ce73b34b215c1ca077b0ec58a8c91f6a6e4a48e2ae55251be38f647405d135ebeae38f8b0dfb478bcea8d5f0d6509e97f1baddbc2cd2e788948f2a
+ HEAD_REF RC_2_0
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH TRYSIGNAL_SOURCE_PATH
+ REPO arvidn/try_signal
+ REF 105cce59972f925a33aa6b1c3109e4cd3caf583d #2022-10-27
+ SHA512 4a0090755831e0e4a1930817345fa5934144421d9a9d710fe8ed3712233fa2fa037fc0e0d4f88b7cc8fb1bc05fe2d55372af1ff47d6fbf5208e03f45f2a424e4
+ HEAD_REF master
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH ASIO_GNUTLS_SOURCE_PATH
+ REPO paullouisageneau/boost-asio-gnutls
+ REF a57d4d36923c5fafa9698e14be16b8bc2913700a
+ SHA512 1e093dd4e999cce9c6d74f1d4c2d20f73512258b83505c307c7d53b8c7ed15626a8e90c8e6a6280827aafa069bc233c0c6f4c9276f1c332e4b141c7c350c47c0
+ HEAD_REF master
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH LIB_SIMULATOR_SOURCE_PATH
+ REPO arvidn/libsimulator
+ REF 39144efe83fcd38778cf76fc609e3475694642ca #2022-10-27
+ SHA512 a021f769d52d127355ecaceaf912bf3e86aaa256d4768d270fbe6066793b6159eddecd0262f3f2158602f883d49b3aac39eb79be5399212cdd7711f921ffa15a
+ HEAD_REF master
+)
+
+file(COPY ${TRYSIGNAL_SOURCE_PATH}/ DESTINATION ${SOURCE_PATH}/deps/try_signal)
+file(COPY ${ASIO_GNUTLS_SOURCE_PATH}/ DESTINATION ${SOURCE_PATH}/deps/asio-gnutls)
+file(COPY ${LIB_SIMULATOR_SOURCE_PATH}/ DESTINATION ${SOURCE_PATH}/simulation/libsimulator)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -Dboost-python-module-name=${_boost-python-module-name}
+ -Dstatic_runtime=${_static_runtime}
+ -DPython3_USE_STATIC_LIBS=ON
+)
+
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME LibtorrentRasterbar CONFIG_PATH lib/cmake/LibtorrentRasterbar)
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+# Do not duplicate include files
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/share/cmake")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/libtorrent/vcpkg.json b/vcpkg/ports/libtorrent/vcpkg.json
new file mode 100644
index 0000000..002c689
--- /dev/null
+++ b/vcpkg/ports/libtorrent/vcpkg.json
@@ -0,0 +1,64 @@
+{
+ "name": "libtorrent",
+ "version": "2.0.11",
+ "maintainers": "Arvid Norberg <arvid.norberg@gmail.com>",
+ "description": "An efficient feature complete C++ BitTorrent implementation",
+ "homepage": "https://libtorrent.org",
+ "documentation": "https://libtorrent.org/reference.html",
+ "license": "BSD-2-Clause",
+ "supports": "!uwp",
+ "dependencies": [
+ "boost-asio",
+ "boost-chrono",
+ "boost-config",
+ "boost-crc",
+ "boost-date-time",
+ "boost-iterator",
+ "boost-logic",
+ "boost-multi-index",
+ "boost-multiprecision",
+ "boost-pool",
+ "boost-random",
+ "boost-scope-exit",
+ "boost-system",
+ "boost-variant",
+ "openssl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "iconv"
+ ],
+ "features": {
+ "deprfun": {
+ "description": "build with deprecated functions enabled"
+ },
+ "examples": {
+ "description": "build the examples in the examples directory"
+ },
+ "iconv": {
+ "description": "build with libiconv",
+ "dependencies": [
+ "libiconv"
+ ]
+ },
+ "python": {
+ "description": "build the python bindings in bindings/python directory",
+ "dependencies": [
+ "boost-python"
+ ]
+ },
+ "test": {
+ "description": "build the libtorrent tests"
+ },
+ "tools": {
+ "description": "build the tools in the tools directory"
+ }
+ }
+}