Skip to content

Commit

Permalink
[botan] update to 3.3.0 (#37252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheney-W authored Mar 23, 2024
1 parent 18e8981 commit a34c873
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 6 deletions.
62 changes: 62 additions & 0 deletions ports/botan/fix-cmake-usage.patch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion ports/botan/libcxx-winpthread-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@@ -627,6 +627,8 @@
static_cast<void>(pthread_set_name_np(thread.native_handle(), name.c_str()));
#elif defined(BOTAN_TARGET_OS_IS_NETBSD)
static_cast<void>(pthread_set_name_np(thread.native_handle(), "%s", const_cast<char*>(name.c_str())));
static_cast<void>(pthread_setname_np(thread.native_handle(), "%s", const_cast<char*>(name.c_str())));
+ #elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+ static_cast<void>(pthread_setname_np(thread.native_handle(), name.c_str()));
#elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(BOTAN_BUILD_COMPILER_IS_MSVC)
Expand Down
5 changes: 4 additions & 1 deletion ports/botan/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")

Expand Down Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions ports/botan/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/botan.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "559118768851fefb7f0bbcbf363863d907fd6a12",
"version": "3.3.0",
"port-version": 0
},
{
"git-tree": "4c689678282e82a42d29348c05a022f237e54700",
"version": "3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a34c873

Please sign in to comment.