2020-04-27 22:40:36 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "uwp")
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
2020-05-12 11:12:34 +08:00
|
|
|
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()
|
|
|
|
|
2020-04-27 22:40:36 +08:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
2020-05-12 11:12:34 +08:00
|
|
|
set(_static_runtime ON)
|
2020-04-27 22:40:36 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
deprfun deprecated-functions
|
|
|
|
examples build_examples
|
|
|
|
python python-bindings
|
|
|
|
test build_tests
|
|
|
|
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*")
|
2020-05-12 11:12:34 +08:00
|
|
|
string(REGEX REPLACE ".*(python)([0-9])([0-9]+).*" "\\1\\2\\3" _boost-python-module-name "${BOOST_PYTHON_LIB}")
|
2020-04-27 22:40:36 +08:00
|
|
|
endif()
|
2017-07-07 22:32:34 +08:00
|
|
|
|
2017-12-06 05:01:50 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO arvidn/libtorrent
|
2020-09-04 22:10:43 +08:00
|
|
|
REF libtorrent-1.2.10
|
|
|
|
SHA512 e6de939fb6527783695e0b6623ddbe27f85842a36c0899b93ea0284cb3c6f3d14b8c39e29316adb3bf9acac7804f38385cc06854a32df28e7f4f6839af9f382d
|
2020-05-14 01:26:05 +08:00
|
|
|
HEAD_REF RC_1_2
|
2019-05-17 09:33:32 +08:00
|
|
|
PATCHES
|
|
|
|
add-datetime-to-boost-libs.patch
|
2020-04-27 22:40:36 +08:00
|
|
|
fix_python_cmake.patch
|
2020-05-12 11:12:34 +08:00
|
|
|
${ICONV_PATCH}
|
2017-07-07 22:32:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
|
|
|
OPTIONS
|
2020-04-27 22:40:36 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2020-05-12 11:12:34 +08:00
|
|
|
-Dboost-python-module-name=${_boost-python-module-name}
|
|
|
|
-Dstatic_runtime=${_static_runtime}
|
2020-04-27 22:40:36 +08:00
|
|
|
-DPython3_USE_STATIC_LIBS=ON
|
2017-07-07 22:32:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2020-05-12 11:12:34 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/LibtorrentRasterbar)
|
2019-01-31 08:04:17 +08:00
|
|
|
|
2017-07-07 22:32:34 +08:00
|
|
|
# Handle copyright
|
2020-04-27 22:40:36 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2017-07-07 22:32:34 +08:00
|
|
|
|
|
|
|
# Do not duplicate include files
|
2019-01-31 08:04:17 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/cmake)
|