Skip to content

Commit

Permalink
[libtorrent] Update port to 2.0.5 (#22697)
Browse files Browse the repository at this point in the history
* adding libtorrent2

* using vcpkg-cmake and vcpkg-cmake-config

* added empty line to trigger pipeline

* added license info

* format vcpkg.json

* update version

* updating libtorrent

* vcpkg formatting fix

* vcpkg json formatting fix

* libtorrent2-> libtorrent

Co-authored-by: Jonliu1993 <13720414433@163.com>
  • Loading branch information
pythagoras9 and JonLiu1993 committed Jan 31, 2022
1 parent a4e5c7b commit 5f9c75f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 24 deletions.
68 changes: 49 additions & 19 deletions ports/libtorrent/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,72 @@ vcpkg_check_features(
tools build_tools
)

# Note: the python feature currently requires `python3-dev` and `python3-setuptools` installed on the system
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 33a10d5a723a6c27d9baee7d9bf2028eb81c88ed # v1.2.14
SHA512 7be169625c9ab1319047aa025abb36579cf6c749faeee7788b5c0ca24ca32d0a4bfd898415159b9133302da4d26230edcb5585c12137edcab8f5b3548c67a268
HEAD_REF RC_1_2
OUT_SOURCE_PATH SOURCE_PATH
REPO arvidn/libtorrent
REF 44e285c30f06772e48f515580f961998e1037b7e # v2.0.5
SHA512 c7ce747930ab8c1852d0efdc6268d9faa39643abd6b6560b4b5e0b06a12ab207ec61ac301a0bcc7622521a8ae490cc02cbe0b6e43208bc216c08bf472b40cb85
HEAD_REF RC_2_0
)

vcpkg_from_github(
OUT_SOURCE_PATH TRYSIGNAL_SOURCE_PATH
REPO arvidn/try_signal
REF 334fd139e2bb387017b42d36753a03935e3bca75
SHA512 a25d439b2d979e975f9dd125a34072f70bfc7a08fab950e3829130742c05c584ae88d9f58fc0f1b4fa0b51df2c0e32c5b24c5828d53b121b4bc183a4c68d6a5a
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_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_from_github(
OUT_SOURCE_PATH LIB_SIMULATOR_SOURCE_PATH
REPO arvidn/libsimulator
REF 64fb5b4fde1879abc09c018604d57e485a12e999
SHA512 20b57eb436127028339528f34a9db7e7149d2c5d86149114444205370482d3f5284e76493f2fbc1c6904175e6482671bfcaeb98d0bee7d399e546abef02f32f3
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
${FEATURE_OPTIONS}
-Dboost-python-module-name=${_boost-python-module-name}
-Dstatic_runtime=${_static_runtime}
-DPython3_USE_STATIC_LIBS=ON
)

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/LibtorrentRasterbar)
vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME LibtorrentRasterbar CONFIG_PATH lib/cmake/LibtorrentRasterbar)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

# Do not duplicate include files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/cmake)
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()
vcpkg_fixup_pkgconfig()
16 changes: 13 additions & 3 deletions ports/libtorrent/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "libtorrent",
"version": "1.2.14",
"port-version": 2,
"version": "2.0.5",
"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 & !(windows & arm)",
"dependencies": [
"boost-asio",
Expand All @@ -14,13 +14,23 @@
"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"
"openssl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"iconv"
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4005,8 +4005,8 @@
"port-version": 2
},
"libtorrent": {
"baseline": "1.2.14",
"port-version": 2
"baseline": "2.0.5",
"port-version": 0
},
"libu2f-server": {
"baseline": "1.1.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libtorrent.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e27617cd7ff2be85ee0c2d4a60be16cee95f1302",
"version": "2.0.5",
"port-version": 0
},
{
"git-tree": "eec22cb36f26cc1cd10714a8bdd974b451ba9832",
"version": "1.2.14",
Expand Down

0 comments on commit 5f9c75f

Please sign in to comment.