Skip to content

Commit

Permalink
[botan] update to 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheney-W committed Mar 8, 2024
1 parent ab887c5 commit e616652
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 3 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
5 changes: 4 additions & 1 deletion ports/botan/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ 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
pkgconfig.patch
verbose-install.patch
configure-zlib.patch
fix_android.patch
fix-cmake-usage.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}")

Expand Down Expand Up @@ -154,6 +155,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
6 changes: 5 additions & 1 deletion ports/botan/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "botan",
"version": "3.2.0",
"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
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": "fed3b649e0e25cebaa23b4945428c923e2be89ae",
"version": "3.3.0",
"port-version": 0
},
{
"git-tree": "3482b0255e093b6d091aa4aff11992c89ec45d6e",
"version": "3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@
"port-version": 0
},
"botan": {
"baseline": "3.2.0",
"baseline": "3.3.0",
"port-version": 0
},
"box2d": {
Expand Down

0 comments on commit e616652

Please sign in to comment.