2018-07-31 00:02:37 -07:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO randombit/botan
|
2022-11-18 08:22:14 +01:00
|
|
|
REF "${VERSION}"
|
2024-11-14 18:10:13 +08:00
|
|
|
SHA512 dcd9ac8e748422d55854c38e565704e4a239418b6855836bdea85bd4dc3ab45e218d320471b98b6a451fc63d8518895f3813a50c94dee90227c09d12d96ca1dc
|
2018-07-31 00:02:37 -07:00
|
|
|
HEAD_REF master
|
2019-12-21 03:57:17 +08:00
|
|
|
PATCHES
|
2022-02-04 10:16:11 +01:00
|
|
|
embed-debug-info.patch
|
2022-11-18 08:22:14 +01:00
|
|
|
pkgconfig.patch
|
|
|
|
verbose-install.patch
|
|
|
|
configure-zlib.patch
|
2024-01-20 03:58:51 +08:00
|
|
|
fix_android.patch
|
2024-03-12 03:36:30 +00:00
|
|
|
libcxx-winpthread-fixes.patch
|
2024-03-23 09:01:09 +08:00
|
|
|
fix-cmake-usage.patch
|
2024-11-14 18:10:13 +08:00
|
|
|
0009-fix-regression-f2bf049-85491b3.patch # extract from PR 4255
|
2018-07-10 03:35:30 -07:00
|
|
|
)
|
2022-11-18 08:22:14 +01:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}")
|
2018-07-10 03:35:30 -07:00
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
2019-04-24 20:21:58 +02:00
|
|
|
endif()
|
|
|
|
|
2017-03-12 05:12:36 +03:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_cmake_get_vars(cmake_vars_file)
|
|
|
|
include("${cmake_vars_file}")
|
|
|
|
|
|
|
|
set(pkgconfig_syntax "")
|
|
|
|
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
|
|
set(pkgconfig_syntax "--msvc-syntax")
|
2018-06-29 21:41:08 -07:00
|
|
|
endif()
|
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(SET configure_arguments
|
|
|
|
"--distribution-info=vcpkg ${TARGET_TRIPLET}"
|
2023-05-16 18:43:55 +02:00
|
|
|
--disable-cc-tests
|
2022-11-18 08:22:14 +01:00
|
|
|
--with-pkg-config
|
|
|
|
--link-method=copy
|
|
|
|
--with-debug-info
|
|
|
|
--includedir=include
|
|
|
|
--bindir=bin
|
|
|
|
--libdir=lib
|
|
|
|
--without-documentation
|
|
|
|
"--with-external-includedir=${CURRENT_INSTALLED_DIR}/include"
|
|
|
|
)
|
|
|
|
vcpkg_list(SET pkgconfig_requires)
|
|
|
|
|
|
|
|
if("amalgamation" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND configure_arguments --amalgamation)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(ZLIB_LIBS_RELEASE "")
|
|
|
|
set(ZLIB_LIBS_DEBUG "")
|
|
|
|
if("zlib" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND configure_arguments --with-zlib)
|
|
|
|
vcpkg_list(APPEND pkgconfig_requires zlib)
|
|
|
|
x_vcpkg_pkgconfig_get_modules(LIBS PREFIX "ZLIB" MODULES "zlib" ${pkgconfig_syntax})
|
2017-03-12 05:12:36 +03:00
|
|
|
endif()
|
|
|
|
|
2023-11-29 09:38:04 +01:00
|
|
|
if(VCPKG_TARGET_IS_EMSCRIPTEN)
|
|
|
|
vcpkg_list(APPEND configure_arguments --cpu=wasm)
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --cpu=x86)
|
2017-03-12 05:12:36 +03:00
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --cpu=x86_64)
|
2021-04-28 22:51:03 +02:00
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --cpu=arm32)
|
2021-04-28 22:51:03 +02:00
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --cpu=arm64)
|
2017-03-12 05:12:36 +03:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unsupported architecture")
|
|
|
|
endif()
|
|
|
|
|
2024-03-12 03:36:30 +00:00
|
|
|
# Allow disabling use of WinSock2 by setting BOTAN_USE_WINSOCK2=OFF in triplet
|
|
|
|
# for targeting older Windows versions with missing APIs.
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND DEFINED BOTAN_USE_WINSOCK2 AND NOT BOTAN_USE_WINSOCK2)
|
|
|
|
vcpkg_list(APPEND configure_arguments --without-os-features=winsock2)
|
|
|
|
endif()
|
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
vcpkg_list(APPEND configure_arguments --os=windows)
|
2020-10-13 00:20:01 +02:00
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
|
|
vcpkg_list(APPEND configure_arguments --cc=msvc)
|
|
|
|
endif()
|
2017-03-12 05:12:36 +03:00
|
|
|
|
2024-03-12 03:36:30 +00:00
|
|
|
# When compiling with Clang, -mrdrand is required to enable the RDRAND intrinsics. Botan will
|
|
|
|
# check for RDRAND at runtime before trying to use it, so we should be safe to specify this
|
|
|
|
# without triggering illegal instruction faults on older CPUs.
|
|
|
|
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER MATCHES "clang-cl(\.exe)?$")
|
|
|
|
vcpkg_list(APPEND configure_arguments "--extra-cxxflags=${VCPKG_DETECTED_CMAKE_CXX_FLAGS} -mrdrnd")
|
|
|
|
else()
|
|
|
|
# ...otherwise just forward the detected CXXFLAGS.
|
|
|
|
vcpkg_list(APPEND configure_arguments "--extra-cxxflags=${VCPKG_DETECTED_CMAKE_CXX_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_list(APPEND configure_arguments --enable-shared-library --disable-static-library)
|
2017-03-12 05:12:36 +03:00
|
|
|
else()
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --disable-shared-library --enable-static-library)
|
2017-03-12 05:12:36 +03:00
|
|
|
endif()
|
2018-06-29 21:41:08 -07:00
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(BOTAN_MSVC_RUNTIME MD)
|
|
|
|
else()
|
|
|
|
set(BOTAN_MSVC_RUNTIME MT)
|
[many ports] improvements for linux/wsl (#6730)
* [many ports] improve compatibility with WSL and mixed case filesystems
* [treehopper] express dependency on libusb, which was not working on non-win32 platforms and is still broken there
* [libharu] add compatibility with non-win32 platforms
* [geogram] fix openblas on linux
[clapack] better integration with linux environment
[visit-struct] put cmake config file in the expected folder
[geogram] remove trailing underscore to enable compatibility with OpenBLAS
* [openblas] playing with underscore, without success
* [openblas/lapack] fix library integration
* [clapack] improve target handling in cmake module
* [openblas] promote self-generated config to default cmake module, otherwise internal ones thinks wrongly that openblas can also solve lapack libs
* [clapack,openblas] improve libraries integration
* [many ports] fix cmake unnecessary target paths, wrong config paths, empty default dependencies, unnecessary [core] tags
* [suitesparse] improve integration with new lapack/openblas mechanism
* [suitesparse] add no underscore postfix also for linux
* [ceres] fix integration with newer openblas/lapack configs
* [aws-c-event-stream] fix regression
* [systemc] fix regression
* [libwebp,geogram] trigger rebuild
* [libwebp,pthread4w] fix regressions
* [glbinding] fix cmake module installation
* [globjects] disentangle unnecessary dependency from qt5
* [jasper] remove broken and unnecessary patches
* [libwebp] fix regression
* [many ports] avoid using BUILD_SHARED_LIBS which is uninitialized in port files
* [clapack] correctly find dlls
* [clapack] use a generic blas as dependency
* [fizz,g2o] restore expected version
* fix mistake
* [many ports] remove WIN32, APPLE and UNIX (again, they keep creeping in) from ports since they are broken and usually break non-win32 ports
* [libressl,openssl] do not try to build one if the other is already installed
* [itk] update ref and patch to avoid regression
* [libressl,openssl] implement full strategy to fix CI
* [libwebp] disable components that are broken on macOS
* [ogre] enable macOS build
* [freeimage,jxrlib,ogre,openexr,protobuf] port patches from #5169
* [ogre] add missing install command
* [ffmpeg] enable wrapper for cmake module
* [ffmpeg] add avresample module finder
* [ffmpeg] improve module detection and exported symbols
* [ffmpeg] add variables to cache
* [thrift] remove unnecessary build option
* [allegro5] fix shared/static inversion
* [protobuf] cleanup
* [libressl] cleanup
* [moos-core] cleanup
* commented features must not be separated from other features, otherwise vcpkg complains
* [itk] fix regression
* [shogun,itk] fix regressions
* [ogre] fix regression
* [opusfile] add compatibility with non-win32
* [itk] fix regression
* [sndfile,libsndfile] remove duplicate, redirect sndfile to libsndfile
* add missing dependencies
* [ismrmrd] fix regression
* [ffmpeg] trigger rebuild
* [clapack,openblas,libogg] fix regressions on macOS
* [libtins] fix regression
* force rebuild windows regressions, unable to reproduce locally
* [mosquitto] enable non-win32 builds
* [json-dto] force rebuild, unable to reproduce regression locally
* [many ports] uniform naming and path length requests
* fix regression
* fix regression
* [ffmpeg] fixes for downstream projects
* clean up - thanks to reviewers
* trigger rebuild of regressions on macOS
* trigger rebuild of regressions on macOS - part2
* Add core back
* Use VCPKG_CONCURRENCY
* Add core back to suitesparse
* Add core back to curl
* Add core back to magnum
* Add core back to magnum
* Add core back to magnum
* Add core back to cgal
2019-06-21 04:11:54 +02:00
|
|
|
endif()
|
2019-04-24 20:21:58 +02:00
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_install_nmake(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
PROJECT_NAME "Makefile"
|
|
|
|
PREFER_JOM
|
|
|
|
PRERUN_SHELL_RELEASE
|
|
|
|
"${PYTHON3}" "${SOURCE_PATH}/configure.py"
|
|
|
|
${configure_arguments}
|
|
|
|
"--prefix=${CURRENT_PACKAGES_DIR}"
|
|
|
|
"--msvc-runtime=${BOTAN_MSVC_RUNTIME}"
|
|
|
|
"--with-external-libdir=${CURRENT_INSTALLED_DIR}/lib"
|
|
|
|
PRERUN_SHELL_DEBUG
|
|
|
|
"${PYTHON3}" "${SOURCE_PATH}/configure.py"
|
|
|
|
${configure_arguments}
|
|
|
|
"--prefix=${CURRENT_PACKAGES_DIR}/debug"
|
|
|
|
"--msvc-runtime=${BOTAN_MSVC_RUNTIME}d"
|
|
|
|
"--with-external-libdir=${CURRENT_INSTALLED_DIR}/debug/lib"
|
|
|
|
--debug-mode
|
2024-03-12 03:36:30 +00:00
|
|
|
OPTIONS
|
|
|
|
"CXX=\"${VCPKG_DETECTED_CMAKE_CXX_COMPILER}\""
|
|
|
|
"LINKER=\"${VCPKG_DETECTED_CMAKE_LINKER}\""
|
|
|
|
"AR=\"${VCPKG_DETECTED_CMAKE_AR}\""
|
|
|
|
"EXE_LINK_CMD=\"${VCPKG_DETECTED_CMAKE_LINKER}\" ${VCPKG_LINKER_FLAGS}"
|
2022-11-18 08:22:14 +01:00
|
|
|
OPTIONS_RELEASE
|
|
|
|
"ZLIB_LIBS=${ZLIB_LIBS_RELEASE}"
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
"ZLIB_LIBS=${ZLIB_LIBS_DEBUG}"
|
|
|
|
)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES botan-cli AUTO_CLEAN)
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
else()
|
2023-11-29 09:38:04 +01:00
|
|
|
if(VCPKG_TARGET_IS_ANDROID)
|
|
|
|
vcpkg_list(APPEND configure_arguments --os=android)
|
|
|
|
elseif(VCPKG_TARGET_IS_EMSCRIPTEN)
|
|
|
|
vcpkg_list(APPEND configure_arguments --os=emscripten)
|
|
|
|
elseif(VCPKG_TARGET_IS_MINGW)
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --os=mingw)
|
2022-02-04 10:16:11 +01:00
|
|
|
endif()
|
|
|
|
|
2023-11-29 09:38:04 +01:00
|
|
|
if(VCPKG_TARGET_IS_EMSCRIPTEN)
|
|
|
|
vcpkg_list(APPEND configure_arguments --cc=emcc)
|
|
|
|
elseif(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
2022-11-18 08:22:14 +01:00
|
|
|
vcpkg_list(APPEND configure_arguments --cc=gcc)
|
|
|
|
elseif(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
vcpkg_list(APPEND configure_arguments --cc=clang)
|
2020-10-13 00:20:01 +02:00
|
|
|
endif()
|
2022-11-18 08:22:14 +01:00
|
|
|
# botan's install.py doesn't handle DESTDIR on windows host,
|
|
|
|
# so we must avoid the standard '--prefix' and 'DESTDIR' install.
|
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
DISABLE_VERBOSE_FLAGS
|
|
|
|
NO_ADDITIONAL_PATHS
|
|
|
|
OPTIONS
|
|
|
|
"${PYTHON3}" "${SOURCE_PATH}/configure.py"
|
|
|
|
${configure_arguments}
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
"--prefix=${CURRENT_PACKAGES_DIR}"
|
|
|
|
"--with-external-libdir=${CURRENT_INSTALLED_DIR}/lib"
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
--debug-mode
|
|
|
|
"--prefix=${CURRENT_PACKAGES_DIR}/debug"
|
|
|
|
"--with-external-libdir=${CURRENT_INSTALLED_DIR}/debug/lib"
|
|
|
|
)
|
|
|
|
vcpkg_build_make(
|
|
|
|
BUILD_TARGET install
|
|
|
|
OPTIONS
|
|
|
|
"ZLIB_LIBS_RELEASE=${ZLIB_LIBS_RELEASE}"
|
|
|
|
"ZLIB_LIBS_DEBUG=${ZLIB_LIBS_DEBUG}"
|
|
|
|
)
|
2023-11-29 09:38:04 +01:00
|
|
|
if(NOT VCPKG_TARGET_IS_EMSCRIPTEN)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES botan AUTO_CLEAN)
|
|
|
|
endif()
|
2021-11-04 05:46:49 +01:00
|
|
|
endif()
|
2017-03-12 05:12:36 +03:00
|
|
|
|
2024-07-25 20:15:37 +00:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/Botan-${VERSION}")
|
2024-03-23 09:01:09 +08:00
|
|
|
|
2023-10-09 15:05:22 -07:00
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-3/botan" "${CURRENT_PACKAGES_DIR}/include/botan")
|
2021-11-09 04:26:22 +08:00
|
|
|
|
2022-11-18 08:22:14 +01:00
|
|
|
if(pkgconfig_requires)
|
|
|
|
list(JOIN pkgconfig_requires ", " pkgconfig_requires)
|
2023-10-09 15:05:22 -07:00
|
|
|
file(APPEND "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/botan-3.pc" "Requires.private: ${pkgconfig_requires}")
|
2022-11-18 08:22:14 +01:00
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
2023-10-09 15:05:22 -07:00
|
|
|
file(APPEND "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/botan-3.pc" "Requires.private: ${pkgconfig_requires}")
|
2021-12-29 05:24:18 +08:00
|
|
|
endif()
|
2021-11-04 05:46:49 +01:00
|
|
|
endif()
|
2021-10-27 01:03:33 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2018-06-29 21:41:08 -07:00
|
|
|
file(REMOVE_RECURSE
|
2021-09-14 11:24:22 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
2023-10-09 15:05:22 -07:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/botan-3"
|
2022-11-18 08:22:14 +01:00
|
|
|
)
|
2017-03-12 05:12:36 +03:00
|
|
|
|
2021-11-11 22:37:13 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "#define BOTAN_INSTALL_PREFIX R\"(${CURRENT_PACKAGES_DIR})\"" "")
|
2024-06-20 07:07:05 +10:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "#define BOTAN_INSTALL_LIB_DIR R\"(${CURRENT_PACKAGES_DIR}\\lib)\"" "" IGNORE_UNCHANGED)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "#define BOTAN_INSTALL_LIB_DIR R\"(${CURRENT_PACKAGES_DIR}/lib)\"" "" IGNORE_UNCHANGED)
|
2021-11-11 22:37:13 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "--prefix=${CURRENT_PACKAGES_DIR}" "")
|
|
|
|
|
2023-10-09 15:05:22 -07:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt")
|