From a34c873a9717a888f58dc05268dea15592c2f0ff Mon Sep 17 00:00:00 2001 From: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Date: Sat, 23 Mar 2024 09:01:09 +0800 Subject: [PATCH] [botan] update to 3.3.0 (#37252) --- ports/botan/fix-cmake-usage.patch | 62 +++++++++++++++++++++++ ports/botan/libcxx-winpthread-fixes.patch | 2 +- ports/botan/portfile.cmake | 5 +- ports/botan/vcpkg.json | 7 ++- scripts/ci.baseline.txt | 4 ++ versions/b-/botan.json | 5 ++ versions/baseline.json | 4 +- 7 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 ports/botan/fix-cmake-usage.patch diff --git a/ports/botan/fix-cmake-usage.patch b/ports/botan/fix-cmake-usage.patch new file mode 100644 index 00000000000000..3c5f5b06960ab8 --- /dev/null +++ b/ports/botan/fix-cmake-usage.patch @@ -0,0 +1,62 @@ +diff --git a/src/build-data/botan-config.cmake.in b/src/build-data/botan-config.cmake.in +index 8d14c4e..46e2cbc 100644 +--- a/src/build-data/botan-config.cmake.in ++++ b/src/build-data/botan-config.cmake.in +@@ -65,21 +65,29 @@ if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_FOUND AND NOT ${${CMAKE_FIND_PACKAGE_NAME} + return() + endif() + +-# botan-config.cmake lives in "${_Botan_PREFIX}/lib/cmake/Botan-X": traverse up to $_Botan_PREFIX ++# botan-config.cmake lives in "${_Botan_PREFIX}/share/botan": traverse up to $_Botan_PREFIX + set(_Botan_PREFIX "${CMAKE_CURRENT_LIST_DIR}") + get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) + get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) +-get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY) + + %{if build_static_lib} + if(NOT TARGET Botan::Botan-static) + add_library(Botan::Botan-static STATIC IMPORTED) + set_target_properties(Botan::Botan-static + PROPERTIES +- IMPORTED_LOCATION "${_Botan_PREFIX}/lib/%{static_lib_name}" +- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}" ++ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include" + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}") ++ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{static_lib_name}") ++ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) ++ set_target_properties(Botan::Botan-static PROPERTIES ++ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/lib/%{static_lib_name}" ++ ) ++ endif() ++ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) ++ set_target_properties(Botan::Botan-static PROPERTIES ++ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/lib/%{static_lib_name}" ++ ) + endif() + %{endif} + +@@ -100,10 +108,20 @@ if(NOT TARGET Botan::Botan) + add_library(Botan::Botan SHARED IMPORTED) + set_target_properties(Botan::Botan + PROPERTIES +- IMPORTED_LOCATION "${_Botan_shared_lib}" +- IMPORTED_IMPLIB "${_Botan_implib}" +- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}" ++ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include" + INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}") ++ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{implib_name}") ++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) ++ set_target_properties(Botan::Botan PROPERTIES ++ IMPORTED_IMPLIB_DEBUG "${_Botan_PREFIX}/debug/lib/%{implib_name}" ++ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/bin/%{shared_lib_name}" ++ ) ++ endif() ++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) ++ set_target_properties(Botan::Botan PROPERTIES ++ IMPORTED_IMPLIB_RELEASE "${_Botan_PREFIX}/lib/%{implib_name}" ++ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/bin/%{shared_lib_name}" ++ ) + set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) + set_target_properties(Botan::Botan + PROPERTIES diff --git a/ports/botan/libcxx-winpthread-fixes.patch b/ports/botan/libcxx-winpthread-fixes.patch index e490804de36d66..2b6b0274b2fa55 100644 --- a/ports/botan/libcxx-winpthread-fixes.patch +++ b/ports/botan/libcxx-winpthread-fixes.patch @@ -15,7 +15,7 @@ @@ -627,6 +627,8 @@ static_cast(pthread_set_name_np(thread.native_handle(), name.c_str())); #elif defined(BOTAN_TARGET_OS_IS_NETBSD) - static_cast(pthread_set_name_np(thread.native_handle(), "%s", const_cast(name.c_str()))); + static_cast(pthread_setname_np(thread.native_handle(), "%s", const_cast(name.c_str()))); + #elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD) + static_cast(pthread_setname_np(thread.native_handle(), name.c_str())); #elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(BOTAN_BUILD_COMPILER_IS_MSVC) diff --git a/ports/botan/portfile.cmake b/ports/botan/portfile.cmake index ca6a0c14ee7553..1854eee9010e8a 100644 --- a/ports/botan/portfile.cmake +++ b/ports/botan/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO randombit/botan REF "${VERSION}" - SHA512 13f40635fc92b00b9392aa8ed96b5825f0cc8147d51337e2c225e0f29d0428732293190aa5fb2a7d2c5e7d57db748ae0fbed4536dee8af00e8d6fd405e784e1d + SHA512 5b3e22ad14bf0c37d97835c8309d1a5797cfab67b14ebfad9fd69a999ee27fe97d42ecff5e57e598d21575d053c07c30995f8c2d5f3a23433fb59d6bab45e1e7 HEAD_REF master PATCHES embed-debug-info.patch @@ -11,6 +11,7 @@ vcpkg_from_github( configure-zlib.patch fix_android.patch libcxx-winpthread-fixes.patch + fix-cmake-usage.patch ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}") @@ -176,6 +177,8 @@ else() endif() endif() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Botan-3.3.0) + file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-3/botan" "${CURRENT_PACKAGES_DIR}/include/botan") if(pkgconfig_requires) diff --git a/ports/botan/vcpkg.json b/ports/botan/vcpkg.json index 5a28565a04a91b..5ff0ca125b3e8e 100644 --- a/ports/botan/vcpkg.json +++ b/ports/botan/vcpkg.json @@ -1,12 +1,15 @@ { "name": "botan", - "version": "3.2.0", - "port-version": 1, + "version": "3.3.0", "description": "A cryptography library written in C++11", "homepage": "https://botan.randombit.net", "license": "BSD-2-Clause", "supports": "!uwp", "dependencies": [ + { + "name": "vcpkg-cmake-config", + "host": true + }, { "name": "vcpkg-cmake-get-vars", "host": true diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 513477ba5d256c..78795aa8e9fa17 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -97,6 +97,10 @@ boringssl:x64-windows=skip boringssl:x64-windows-static=skip boringssl:x64-windows-static-md=skip boringssl:x86-windows=skip +# Broken with NDK r25 and fixed in NDK r26 +botan:arm-neon-android=fail +botan:arm64-android=fail +botan:x64-android=fail brpc:x64-android=fail buck-yeh-bux:x64-android=fail c4core:arm-neon-android=fail diff --git a/versions/b-/botan.json b/versions/b-/botan.json index 3f411eabd45e80..fb1a553fea2fd5 100644 --- a/versions/b-/botan.json +++ b/versions/b-/botan.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "559118768851fefb7f0bbcbf363863d907fd6a12", + "version": "3.3.0", + "port-version": 0 + }, { "git-tree": "4c689678282e82a42d29348c05a022f237e54700", "version": "3.2.0", diff --git a/versions/baseline.json b/versions/baseline.json index 2ac7f40ae9ca31..270660e633e254 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1325,8 +1325,8 @@ "port-version": 0 }, "botan": { - "baseline": "3.2.0", - "port-version": 1 + "baseline": "3.3.0", + "port-version": 0 }, "box2d": { "baseline": "2.4.1",