diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index 47ef4184589ba2..aa854fc1ca9e79 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,9 +1,8 @@ Source: libtorrent -Version: 1.2.10 -Port-Version: 1 +Version: 2.0.0 Homepage: https://github.com/arvidn/libtorrent Description: An efficient feature complete C++ BitTorrent implementation -Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision, boost-pool, boost-variant +Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision, boost-logic, boost-multi-index, boost-pool, boost-variant Supports: !uwp&!(windows&arm) Feature: deprfun diff --git a/ports/libtorrent/add-datetime-to-boost-libs.patch b/ports/libtorrent/add-datetime-to-boost-libs.patch deleted file mode 100644 index e9eeae91921ae1..00000000000000 --- a/ports/libtorrent/add-datetime-to-boost-libs.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9efd451fb..7ff587631 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -719,9 +719,9 @@ else() - endif() - - # Boost --find_public_dependency(Boost REQUIRED COMPONENTS system) -+find_public_dependency(Boost REQUIRED COMPONENTS system date_time) - target_include_directories(torrent-rasterbar PUBLIC ${Boost_INCLUDE_DIRS}) --target_link_libraries(torrent-rasterbar PUBLIC ${Boost_SYSTEM_LIBRARY}) -+target_link_libraries(torrent-rasterbar PUBLIC ${Boost_LIBRARIES}) - - if (exceptions) - if (MSVC) diff --git a/ports/libtorrent/fix_find_iconv.patch b/ports/libtorrent/fix_find_iconv.patch deleted file mode 100644 index 2c22c15e0a26f7..00000000000000 --- a/ports/libtorrent/fix_find_iconv.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9efd451fb..d85b31fd4 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -643,24 +643,19 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl - target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME streaming DEFAULT ON - DESCRIPTION "Enables support for piece deadline" DISABLED TORRENT_DISABLE_STREAMING) - --find_public_dependency(Iconv) --if(MSVC) -- set(iconv_package_type OPTIONAL) --else() -- set(iconv_package_type RECOMMENDED) --endif() -+find_public_dependency(unofficial-iconv REQUIRED) - --set_package_properties(Iconv -+set_package_properties(unofficial-iconv - PROPERTIES - URL "https://www.gnu.org/software/libiconv/" -- DESCRIPTION "GNU encoding conversion library" -- TYPE ${iconv_package_type} -+ DESCRIPTION "GNU encoding conversion library (unofficial vcpkg CMake port)" -+ TYPE REQUIRED - PURPOSE "Convert strings between various encodings" - ) - --if(Iconv_FOUND) -+if(unofficial-iconv_FOUND) - target_compile_definitions(torrent-rasterbar PUBLIC TORRENT_USE_ICONV) -- target_link_libraries(torrent-rasterbar PRIVATE Iconv::Iconv) -+ target_link_libraries(torrent-rasterbar PRIVATE unofficial::iconv::libiconv unofficial::iconv::libcharset) - endif() - - find_public_dependency(OpenSSL) diff --git a/ports/libtorrent/fix_python_cmake.patch b/ports/libtorrent/fix_python_cmake.patch deleted file mode 100644 index f114b8621a351e..00000000000000 --- a/ports/libtorrent/fix_python_cmake.patch +++ /dev/null @@ -1,130 +0,0 @@ -diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt -index 53e09439f..de027f965 100644 ---- a/bindings/python/CMakeLists.txt -+++ b/bindings/python/CMakeLists.txt -@@ -1,7 +1,6 @@ - # To build python bindings we need a python executable and boost python module. Unfortunately, - # their names might not be interlinked and we can not implement a general solution. --# The code below assumes default boost installation, when the module for python 2 is named --# 'python' and the module for python 3 is named 'python3'. -+# The code below assumes default boost installation, when the module for python 3 is named 'python3'. - # To customize that one can provide a name for the Boost::python module via - # 'boost-python-module-name' variable when invoking cmake. - # E.g. on Gentoo with python 3.6 and Boost::python library name 'libboost_python-3.6.so' -@@ -15,12 +14,9 @@ - # Sets _ret to a list of python versions (major.minor) that use the same MSVC runtime as this build does - # assumes MSVC was detected already - # See https://en.wikipedia.org/wiki/Microsoft_Visual_C++#Internal_version_numbering -+# See https://devguide.python.org/#status-of-python-branches for supported python versions - function(_get_compatible_python_versions _ret) -- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) -- list(APPEND _tmp 2.6 2.7 3.0 3.1 3.2) -- elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17) -- list(APPEND _tmp 3.3 3.4) -- elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20) -+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20) - list(APPEND _tmp 3.5 3.6 3.7 3.8) - endif() - set(${_ret} ${_tmp} PARENT_SCOPE) -@@ -31,23 +27,22 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT skip-python-runtime-test) - _get_compatible_python_versions(Python_ADDITIONAL_VERSIONS) - endif() - --find_package(PythonInterp REQUIRED) -+find_package(Python3 COMPONENTS Interpreter Development REQUIRED) - if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND NOT skip-python-runtime-test) -- message(STATUS "Testing found python version. Requested: ${Python_ADDITIONAL_VERSIONS}, found: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") -- if (NOT "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" IN_LIST Python_ADDITIONAL_VERSIONS) -- message(FATAL_ERROR "Incompatible Python and C runtime: MSVC ${CMAKE_CXX_COMPILER_VERSION} and Python ${PYTHON_VERSION_STRING}") -+ message(STATUS "Testing found python version. Requested: ${Python_ADDITIONAL_VERSIONS}, found: ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") -+ if (NOT "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" IN_LIST Python_ADDITIONAL_VERSIONS) -+ message(FATAL_ERROR "Incompatible Python and C runtime: MSVC ${CMAKE_CXX_COMPILER_VERSION} and Python ${Python3_VERSION}") - endif() - endif() - --set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") --find_package(PythonLibs REQUIRED) -+set(Python_ADDITIONAL_VERSIONS "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") - - if (NOT boost-python-module-name) - # use active python - # if (PYTHON_VERSION_STRING VERSION_GREATER_EQUAL "3") - # set(_boost-python-module-name "python${PYTHON_VERSION_MAJOR}") - # else() -- set(_boost-python-module-name "python") # to overwrite possible value from a previous run -+ set(_boost-python-module-name "python${Python3_VERSION_MAJOR}") # to overwrite possible value from a previous run - # endif() - endif() - -@@ -55,7 +50,7 @@ set(boost-python-module-name ${_boost-python-module-name} CACHE STRING "Boost:py - - find_package(Boost REQUIRED COMPONENTS ${boost-python-module-name}) - --python_add_module(python-libtorrent -+Python3_add_library(python-libtorrent STATIC - src/module.cpp - src/sha1_hash.cpp - src/converters.cpp -@@ -80,12 +75,12 @@ python_add_module(python-libtorrent - - set_target_properties(python-libtorrent - PROPERTIES -- OUTPUT_NAME libtorrent -+ OUTPUT_NAME torrent - ) - - target_include_directories(python-libtorrent - PRIVATE -- ${PYTHON_INCLUDE_DIRS} -+ ${Python3_INCLUDE_DIRS} - ) - - string(TOUPPER "${boost-python-module-name}" boost_python_module_name_uppercase) -@@ -96,7 +91,7 @@ target_link_libraries(python-libtorrent - # Boost::python adds that but without a path to the library. Therefore we have to either - # provide the path (but, unfortunately, FindPythonLibs.cmake does not return the library dir), - # or give the full file name here (this FindPythonLibs.cmake provides to us). -- ${PYTHON_LIBRARIES} -+ ${Python3_LIBRARIES} - ) - - # Bindings module uses deprecated libtorrent features, thus we disable these warnings -@@ -108,7 +103,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - endif() - - execute_process(COMMAND -- ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; -+ ${Python3_EXECUTABLE} -c "import distutils.sysconfig; - print(';'.join(map(str, [ - distutils.sysconfig.get_python_lib(plat_specific=True, prefix=''), - distutils.sysconfig.get_config_var('EXT_SUFFIX') -@@ -119,13 +114,11 @@ list(GET _python_sysconfig_vars 0 PYTHON_SITE_PACKAGES) - list(GET _python_sysconfig_vars 1 PYTHON_EXT_SUFFIX) - - message(STATUS "Python site packages: ${PYTHON_SITE_PACKAGES}") --# python 2 does not provide the 'EXT_SUFFIX' sysconfig variable, so we use cmake default then --if (NOT "${PYTHON_EXT_SUFFIX}" STREQUAL "None") -- message(STATUS "Python extension suffix: ${PYTHON_EXT_SUFFIX}") -- # we mimic the name, created by setuptools -- # example: libtorrent.cpython-36m-x86_64-linux-gnu.so -- set_target_properties(python-libtorrent PROPERTIES SUFFIX ${PYTHON_EXT_SUFFIX}) --endif() -+ -+message(STATUS "Python extension suffix: ${PYTHON_EXT_SUFFIX}") -+# we mimic the name, created by setuptools -+# example: libtorrent.cpython-36m-x86_64-linux-gnu.so -+set_target_properties(python-libtorrent PROPERTIES SUFFIX ${PYTHON_EXT_SUFFIX}) - - set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.cmake.in") - set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") -@@ -135,8 +128,8 @@ set(DEPS python-libtorrent "${SETUP_PY}") - configure_file(${SETUP_PY_IN} ${SETUP_PY} @ONLY) - - add_custom_command(OUTPUT ${OUTPUT} -- COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} build -b "${CMAKE_CURRENT_SOURCE_DIR}" -- COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} egg_info -b "${CMAKE_CURRENT_SOURCE_DIR}" -+ COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b "${CMAKE_CURRENT_SOURCE_DIR}" -+ COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} egg_info -b "${CMAKE_CURRENT_SOURCE_DIR}" - COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} - DEPENDS ${DEPS}) - diff --git a/ports/libtorrent/no_use_iconv.patch b/ports/libtorrent/no_use_iconv.patch deleted file mode 100644 index 3f275299a6743a..00000000000000 --- a/ports/libtorrent/no_use_iconv.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9efd451fb..05066be82 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -643,26 +643,6 @@ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutabl - target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME streaming DEFAULT ON - DESCRIPTION "Enables support for piece deadline" DISABLED TORRENT_DISABLE_STREAMING) - --find_public_dependency(Iconv) --if(MSVC) -- set(iconv_package_type OPTIONAL) --else() -- set(iconv_package_type RECOMMENDED) --endif() -- --set_package_properties(Iconv -- PROPERTIES -- URL "https://www.gnu.org/software/libiconv/" -- DESCRIPTION "GNU encoding conversion library" -- TYPE ${iconv_package_type} -- PURPOSE "Convert strings between various encodings" --) -- --if(Iconv_FOUND) -- target_compile_definitions(torrent-rasterbar PUBLIC TORRENT_USE_ICONV) -- target_link_libraries(torrent-rasterbar PRIVATE Iconv::Iconv) --endif() -- - find_public_dependency(OpenSSL) - set_package_properties(OpenSSL - PROPERTIES diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index 54d40d63dece28..03490a55a19e9d 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -6,13 +6,6 @@ if(VCPKG_TARGET_IS_WINDOWS) message(FATAL_ERROR "The python feature is currently broken on Windows") endif() - if("iconv" IN_LIST FEATURES) - set(ICONV_PATCH "fix_find_iconv.patch") - else() - # prevent picking up libiconv if it happens to already be installed - set(ICONV_PATCH "no_use_iconv.patch") - endif() - if(VCPKG_CRT_LINKAGE STREQUAL "static") set(_static_runtime ON) endif() @@ -39,15 +32,30 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO arvidn/libtorrent - REF libtorrent-1.2.10 - SHA512 e6de939fb6527783695e0b6623ddbe27f85842a36c0899b93ea0284cb3c6f3d14b8c39e29316adb3bf9acac7804f38385cc06854a32df28e7f4f6839af9f382d + REF 0f0afec8c8025cb55dfd2f36612d4bf61a29ff8a #v 2.0.0 + SHA512 251ee5a2c555103a127b8b08995914639a2b9d448a87708edb08a2a11444ef999cd8a3abcf223acfc66ca6371f0e1b076589343ade73974aa87f50814431a875 HEAD_REF RC_1_2 - PATCHES - add-datetime-to-boost-libs.patch - fix_python_cmake.patch - ${ICONV_PATCH} ) +set(COMMIT_HASH 2a99893f92b29a5948569cba1e16fd259dbc2016) + +# Get try_signal for libtorrent +vcpkg_from_github( + OUT_SOURCE_PATH TRY_SIGNAL_SOURCE_PATH + REPO arvidn/try_signal + REF 2a99893f92b29a5948569cba1e16fd259dbc2016 + SHA512 b62b3176980c31c9faa0c5cdd14832e9864a6d86af02ae6d5ef510fade2daf649819bc928c12037fa0ef551813745b347d4927cb4b67b34beb822a707c03d870 +) + +# Copy try_signal sources +foreach(SOURCE_FILE ${SOURCE_PATH}) + file(COPY ${TRY_SIGNAL_SOURCE_PATH} DESTINATION "${SOURCE_PATH}/deps") +endforeach() + +file(REMOVE_RECURSE ${SOURCE_PATH}/deps/try_signal) +file(RENAME ${SOURCE_PATH}/deps/259dbc2016-bb7f150248.clean ${SOURCE_PATH}/deps/try_signal) +file(REMOVE_RECURSE ${TRY_SIGNAL_SOURCE_PATH}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake deleted file mode 100644 index cc3c074654dad3..00000000000000 --- a/ports/lua/portfile.cmake +++ /dev/null @@ -1,59 +0,0 @@ -vcpkg_download_distfile(ARCHIVE - URLS "https://www.lua.org/ftp/lua-5.3.5.tar.gz" - FILENAME "lua-5.3.5.tar.gz" - SHA512 4f9516acc4659dfd0a9e911bfa00c0788f0ad9348e5724fe8fb17aac59e9c0060a64378f82be86f8534e49c6c013e7488ad17321bafcc787831d3d67406bd0f4 -) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES vs2015-impl-c99.patch -) - -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DCOMPILE_AS_CPP=OFF - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON - -DSKIP_INSTALL_TOOLS=ON -) - -vcpkg_install_cmake() - -set(ENABLE_LUA_CPP 0) -if("cpp" IN_LIST FEATURES) - set(ENABLE_LUA_CPP 1) - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DCOMPILE_AS_CPP=ON - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON - -DSKIP_INSTALL_TOOLS=ON - ) - - vcpkg_install_cmake() -endif() - -vcpkg_copy_pdbs() - -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lua) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - if(VCPKG_TARGET_IS_WINDOWS) - file(READ ${CURRENT_PACKAGES_DIR}/include/luaconf.h LUA_CONF_H) - string(REPLACE "defined(LUA_BUILD_AS_DLL)" "1" LUA_CONF_H "${LUA_CONF_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/luaconf.h "${LUA_CONF_H}") - endif() -endif() - -# Handle post-build CMake instructions -configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - -# Handle copyright -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)