Skip to content

Commit a34c873

Browse files
authored
[botan] update to 3.3.0 (#37252)
1 parent 18e8981 commit a34c873

File tree

7 files changed

+83
-6
lines changed

7 files changed

+83
-6
lines changed

ports/botan/fix-cmake-usage.patch

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff --git a/src/build-data/botan-config.cmake.in b/src/build-data/botan-config.cmake.in
2+
index 8d14c4e..46e2cbc 100644
3+
--- a/src/build-data/botan-config.cmake.in
4+
+++ b/src/build-data/botan-config.cmake.in
5+
@@ -65,21 +65,29 @@ if(DEFINED ${CMAKE_FIND_PACKAGE_NAME}_FOUND AND NOT ${${CMAKE_FIND_PACKAGE_NAME}
6+
return()
7+
endif()
8+
9+
-# botan-config.cmake lives in "${_Botan_PREFIX}/lib/cmake/Botan-X": traverse up to $_Botan_PREFIX
10+
+# botan-config.cmake lives in "${_Botan_PREFIX}/share/botan": traverse up to $_Botan_PREFIX
11+
set(_Botan_PREFIX "${CMAKE_CURRENT_LIST_DIR}")
12+
get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY)
13+
get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY)
14+
-get_filename_component(_Botan_PREFIX "${_Botan_PREFIX}" DIRECTORY)
15+
16+
%{if build_static_lib}
17+
if(NOT TARGET Botan::Botan-static)
18+
add_library(Botan::Botan-static STATIC IMPORTED)
19+
set_target_properties(Botan::Botan-static
20+
PROPERTIES
21+
- IMPORTED_LOCATION "${_Botan_PREFIX}/lib/%{static_lib_name}"
22+
- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}"
23+
+ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include"
24+
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
25+
INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}")
26+
+ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{static_lib_name}")
27+
+ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
28+
+ set_target_properties(Botan::Botan-static PROPERTIES
29+
+ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/lib/%{static_lib_name}"
30+
+ )
31+
+ endif()
32+
+ set_property(TARGET Botan::Botan-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
33+
+ set_target_properties(Botan::Botan-static PROPERTIES
34+
+ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/lib/%{static_lib_name}"
35+
+ )
36+
endif()
37+
%{endif}
38+
39+
@@ -100,10 +108,20 @@ if(NOT TARGET Botan::Botan)
40+
add_library(Botan::Botan SHARED IMPORTED)
41+
set_target_properties(Botan::Botan
42+
PROPERTIES
43+
- IMPORTED_LOCATION "${_Botan_shared_lib}"
44+
- IMPORTED_IMPLIB "${_Botan_implib}"
45+
- INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include/botan-%{version_major}"
46+
+ INTERFACE_INCLUDE_DIRECTORIES "${_Botan_PREFIX}/include"
47+
INTERFACE_LINK_OPTIONS "SHELL:%{cxx_abi_flags}")
48+
+ if(EXISTS "${_Botan_PREFIX}/debug/lib/%{implib_name}")
49+
+ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
50+
+ set_target_properties(Botan::Botan PROPERTIES
51+
+ IMPORTED_IMPLIB_DEBUG "${_Botan_PREFIX}/debug/lib/%{implib_name}"
52+
+ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/bin/%{shared_lib_name}"
53+
+ )
54+
+ endif()
55+
+ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
56+
+ set_target_properties(Botan::Botan PROPERTIES
57+
+ IMPORTED_IMPLIB_RELEASE "${_Botan_PREFIX}/lib/%{implib_name}"
58+
+ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/bin/%{shared_lib_name}"
59+
+ )
60+
set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
61+
set_target_properties(Botan::Botan
62+
PROPERTIES

ports/botan/libcxx-winpthread-fixes.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@@ -627,6 +627,8 @@
1616
static_cast<void>(pthread_set_name_np(thread.native_handle(), name.c_str()));
1717
#elif defined(BOTAN_TARGET_OS_IS_NETBSD)
18-
static_cast<void>(pthread_set_name_np(thread.native_handle(), "%s", const_cast<char*>(name.c_str())));
18+
static_cast<void>(pthread_setname_np(thread.native_handle(), "%s", const_cast<char*>(name.c_str())));
1919
+ #elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
2020
+ static_cast<void>(pthread_setname_np(thread.native_handle(), name.c_str()));
2121
#elif defined(BOTAN_TARGET_OS_HAS_WIN32) && defined(BOTAN_BUILD_COMPILER_IS_MSVC)

ports/botan/portfile.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO randombit/botan
44
REF "${VERSION}"
5-
SHA512 13f40635fc92b00b9392aa8ed96b5825f0cc8147d51337e2c225e0f29d0428732293190aa5fb2a7d2c5e7d57db748ae0fbed4536dee8af00e8d6fd405e784e1d
5+
SHA512 5b3e22ad14bf0c37d97835c8309d1a5797cfab67b14ebfad9fd69a999ee27fe97d42ecff5e57e598d21575d053c07c30995f8c2d5f3a23433fb59d6bab45e1e7
66
HEAD_REF master
77
PATCHES
88
embed-debug-info.patch
@@ -11,6 +11,7 @@ vcpkg_from_github(
1111
configure-zlib.patch
1212
fix_android.patch
1313
libcxx-winpthread-fixes.patch
14+
fix-cmake-usage.patch
1415
)
1516
file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}")
1617

@@ -176,6 +177,8 @@ else()
176177
endif()
177178
endif()
178179

180+
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Botan-3.3.0)
181+
179182
file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-3/botan" "${CURRENT_PACKAGES_DIR}/include/botan")
180183

181184
if(pkgconfig_requires)

ports/botan/vcpkg.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"name": "botan",
3-
"version": "3.2.0",
4-
"port-version": 1,
3+
"version": "3.3.0",
54
"description": "A cryptography library written in C++11",
65
"homepage": "https://botan.randombit.net",
76
"license": "BSD-2-Clause",
87
"supports": "!uwp",
98
"dependencies": [
9+
{
10+
"name": "vcpkg-cmake-config",
11+
"host": true
12+
},
1013
{
1114
"name": "vcpkg-cmake-get-vars",
1215
"host": true

scripts/ci.baseline.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ boringssl:x64-windows=skip
9797
boringssl:x64-windows-static=skip
9898
boringssl:x64-windows-static-md=skip
9999
boringssl:x86-windows=skip
100+
# Broken with NDK r25 and fixed in NDK r26
101+
botan:arm-neon-android=fail
102+
botan:arm64-android=fail
103+
botan:x64-android=fail
100104
brpc:x64-android=fail
101105
buck-yeh-bux:x64-android=fail
102106
c4core:arm-neon-android=fail

versions/b-/botan.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "559118768851fefb7f0bbcbf363863d907fd6a12",
5+
"version": "3.3.0",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "4c689678282e82a42d29348c05a022f237e54700",
510
"version": "3.2.0",

versions/baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,8 +1325,8 @@
13251325
"port-version": 0
13261326
},
13271327
"botan": {
1328-
"baseline": "3.2.0",
1329-
"port-version": 1
1328+
"baseline": "3.3.0",
1329+
"port-version": 0
13301330
},
13311331
"box2d": {
13321332
"baseline": "2.4.1",

0 commit comments

Comments
 (0)