aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/botan
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/botan
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/botan')
-rw-r--r--vcpkg/ports/botan/0009-fix-regression-f2bf049-85491b3.patch13
-rwxr-xr-xvcpkg/ports/botan/configure46
-rw-r--r--vcpkg/ports/botan/configure-zlib.patch24
-rw-r--r--vcpkg/ports/botan/embed-debug-info.patch17
-rw-r--r--vcpkg/ports/botan/fix-cmake-usage.patch79
-rw-r--r--vcpkg/ports/botan/fix_android.patch13
-rw-r--r--vcpkg/ports/botan/libcxx-winpthread-fixes.patch14
-rw-r--r--vcpkg/ports/botan/pkgconfig.patch14
-rw-r--r--vcpkg/ports/botan/portfile.cmake205
-rw-r--r--vcpkg/ports/botan/vcpkg.json33
-rw-r--r--vcpkg/ports/botan/verbose-install.patch13
11 files changed, 471 insertions, 0 deletions
diff --git a/vcpkg/ports/botan/0009-fix-regression-f2bf049-85491b3.patch b/vcpkg/ports/botan/0009-fix-regression-f2bf049-85491b3.patch
new file mode 100644
index 0000000..7dd1df3
--- /dev/null
+++ b/vcpkg/ports/botan/0009-fix-regression-f2bf049-85491b3.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.py b/configure.py
+index fcf9e7e..c0f72df 100755
+--- a/configure.py
++++ b/configure.py
+@@ -2351,6 +2351,8 @@ def create_template_vars(source_paths, build_paths, options, modules, disabled_m
+ # just transfer them over to just the compiler invocations
+ variables['cc_compile_flags'] = '%s %s' % (variables['cxx_abi_flags'], variables['cc_compile_flags'])
+ variables['cxx_abi_flags'] = ''
++ else:
++ variables['ldflags'] = '%s %s' % (variables['ldflags'], variables['cc_compile_flags'])
+
+ variables['lib_flags'] = cc.gen_lib_flags(options, variables)
+
diff --git a/vcpkg/ports/botan/configure b/vcpkg/ports/botan/configure
new file mode 100755
index 0000000..e125299
--- /dev/null
+++ b/vcpkg/ports/botan/configure
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+set -e
+
+declare -a OUT_OPTIONS
+
+INTERPRETER=python3
+
+LAST_SEEN=
+COPY_OPTIONS=no
+COPY_PREFIX=yes
+BUILD_TYPE=RELEASE
+for OPTION; do
+ case "${OPTION},${COPY_OPTIONS}" in
+ */configure.py,no)
+ OUT_OPTIONS+=("${OPTION}")
+ INTERPRETER="${LAST_SEEN}"
+ COPY_OPTIONS=yes
+ ;;
+ --prefix=*,yes)
+ if [ "${COPY_PREFIX}" = "yes" ] ; then
+ OUT_OPTIONS+=("${OPTION}")
+ COPY_PREFIX=no
+ fi
+ ;;
+ --*=*,yes)
+ OUT_OPTIONS+=("${OPTION}")
+ ;;
+ *=*)
+ ;;
+ *,yes)
+ OUT_OPTIONS+=("${OPTION}")
+ if [ "${OPTION}" = "--debug-mode" ] ; then
+ BUILD_TYPE=DEBUG
+ fi
+ ;;
+ esac
+ LAST_SEEN="${OPTION}"
+done
+
+set -x
+export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
+"${INTERPRETER}" "${OUT_OPTIONS[@]}"
+
+sed -e "1i\\
+ZLIB_LIBS = \$(ZLIB_LIBS_${BUILD_TYPE})" -i -- Makefile
diff --git a/vcpkg/ports/botan/configure-zlib.patch b/vcpkg/ports/botan/configure-zlib.patch
new file mode 100644
index 0000000..5fda5ff
--- /dev/null
+++ b/vcpkg/ports/botan/configure-zlib.patch
@@ -0,0 +1,24 @@
+diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in
+index 5102933..0fa5920 100644
+--- a/src/build-data/makefile.in
++++ b/src/build-data/makefile.in
+@@ -20,7 +20,7 @@ LDFLAGS = %{ldflags}
+
+ EXE_LINK_CMD = %{exe_link_cmd}
+
+-LIB_LINKS_TO = %{external_link_cmd} %{link_to}
++LIB_LINKS_TO = %{external_link_cmd} $(ZLIB_LIBS) %{link_to}
+ BUILD_DIR_LINK_PATH = %{build_dir_link_path}
+ EXE_LINKS_TO = %{link_to_botan} $(LIB_LINKS_TO) %{extra_libs}
+
+diff --git a/src/lib/compression/zlib/info.txt b/src/lib/compression/zlib/info.txt
+index 1102bc5..34047fa 100644
+--- a/src/lib/compression/zlib/info.txt
++++ b/src/lib/compression/zlib/info.txt
+@@ -5,6 +5,4 @@ ZLIB -> 20160412
+ load_on vendor
+
+ <libs>
+-all!windows -> z
+-windows -> zlib
+ </libs>
diff --git a/vcpkg/ports/botan/embed-debug-info.patch b/vcpkg/ports/botan/embed-debug-info.patch
new file mode 100644
index 0000000..14d2a5c
--- /dev/null
+++ b/vcpkg/ports/botan/embed-debug-info.patch
@@ -0,0 +1,17 @@
+diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
+index 64b6eae..66258ca 100644
+--- a/src/build-data/cc/msvc.txt
++++ b/src/build-data/cc/msvc.txt
+@@ -20,10 +20,10 @@ optimization_flags "/O2 /Oi /Zc:throwingNew"
+ size_optimization_flags "/O1 /Os"
+
+ # for debug info in the object file (required if using sccache):
+-#debug_info_flags "/Z7"
++debug_info_flags "/Z7"
+
+ # for using a PDB file:
+-debug_info_flags "/Zi /FS"
++#debug_info_flags "/Zi /FS"
+
+ preproc_flags "/nologo /EP /Zc:preprocessor"
+
diff --git a/vcpkg/ports/botan/fix-cmake-usage.patch b/vcpkg/ports/botan/fix-cmake-usage.patch
new file mode 100644
index 0000000..e1c8f59
--- /dev/null
+++ b/vcpkg/ports/botan/fix-cmake-usage.patch
@@ -0,0 +1,79 @@
+diff --git a/src/build-data/botan-config.cmake.in b/src/build-data/botan-config.cmake.in
+index 8d14c4e..cfc9277 100644
+--- a/src/build-data/botan-config.cmake.in
++++ b/src/build-data/botan-config.cmake.in
+@@ -65,27 +65,36 @@ 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}
+
+ %{if implib_name}
+-set(_Botan_implib "${_Botan_PREFIX}/lib/%{implib_name}")
+-set(_Botan_shared_lib "${_Botan_PREFIX}/bin/%{shared_lib_name}")
++set(_Botan_implib "${_Botan_PREFIX}/lib/%{implib_name}")
++set(_Botan_implib_debug "${_Botan_PREFIX}/debug/lib/%{implib_name}")
++set(_Botan_shared_lib "${_Botan_PREFIX}/bin/%{shared_lib_name}")
+ %{endif}
+ %{unless implib_name}
+ set(_Botan_implib "")
+@@ -100,10 +109,28 @@ 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/%{shared_lib_name}")
++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
++ set_target_properties(Botan::Botan PROPERTIES
++ IMPORTED_LOCATION_DEBUG "${_Botan_PREFIX}/debug/bin/%{shared_lib_name}"
++ )
++ if(NOT _Botan_implib STREQUAL "")
++ set_target_properties(Botan::Botan PROPERTIES
++ IMPORTED_IMPLIB_DEBUG ${_Botan_implib_debug}
++ )
++ endif()
++ endif()
++ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
++ set_target_properties(Botan::Botan PROPERTIES
++ IMPORTED_LOCATION_RELEASE "${_Botan_PREFIX}/bin/%{shared_lib_name}"
++ )
++ if(NOT _Botan_implib STREQUAL "")
++ set_target_properties(Botan::Botan PROPERTIES
++ IMPORTED_IMPLIB_RELEASE ${_Botan_implib}
++ )
++ endif()
+ set_property(TARGET Botan::Botan APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+ set_target_properties(Botan::Botan
+ PROPERTIES
diff --git a/vcpkg/ports/botan/fix_android.patch b/vcpkg/ports/botan/fix_android.patch
new file mode 100644
index 0000000..a8b5628
--- /dev/null
+++ b/vcpkg/ports/botan/fix_android.patch
@@ -0,0 +1,13 @@
+diff --git a/src/lib/utils/prefetch.cpp b/src/lib/utils/prefetch.cpp
+index 40786b3..e0d5239 100644
+--- a/src/lib/utils/prefetch.cpp
++++ b/src/lib/utils/prefetch.cpp
+@@ -12,7 +12,7 @@
+ namespace Botan {
+
+ uint64_t prefetch_array_raw(size_t bytes, const void* arrayv) noexcept {
+-#if defined(__cpp_lib_hardware_interference_size)
++#if defined(__cpp_lib_hardware_interference_size) && (!defined(BOTAN_TARGET_OS_IS_ANDROID) || defined(NDK_IS_NEWER_THAN_25))
+ const size_t cache_line_size = std::hardware_destructive_interference_size;
+ #else
+ // We arbitrarily use a 64 byte cache line, which is by far the most
diff --git a/vcpkg/ports/botan/libcxx-winpthread-fixes.patch b/vcpkg/ports/botan/libcxx-winpthread-fixes.patch
new file mode 100644
index 0000000..e20fe9f
--- /dev/null
+++ b/vcpkg/ports/botan/libcxx-winpthread-fixes.patch
@@ -0,0 +1,14 @@
+diff --git a/src/tests/tests.h b/src/tests/tests.h
+index 284cf28..ad4996b 100644
+--- a/src/tests/tests.h
++++ b/src/tests/tests.h
+@@ -18,7 +18,9 @@
+ #include <map>
+ #include <memory>
+ #include <optional>
++#ifndef __ANDROID__
+ #include <ranges>
++#endif
+ #include <set>
+ #include <span>
+ #include <sstream>
diff --git a/vcpkg/ports/botan/pkgconfig.patch b/vcpkg/ports/botan/pkgconfig.patch
new file mode 100644
index 0000000..1f4b921
--- /dev/null
+++ b/vcpkg/ports/botan/pkgconfig.patch
@@ -0,0 +1,14 @@
+diff --git a/src/build-data/botan.pc.in b/src/build-data/botan.pc.in
+index c18b522..a5722c9 100644
+--- a/src/build-data/botan.pc.in
++++ b/src/build-data/botan.pc.in
+@@ -1,7 +1,7 @@
+ prefix=%{prefix}
+ exec_prefix=${prefix}
+-libdir=%{libdir}
+-includedir=${prefix}/include/botan-%{version_major}
++libdir=${prefix}/lib
++includedir=${prefix}/include
+
+ Name: Botan
+ Description: Crypto and TLS for Modern C++
diff --git a/vcpkg/ports/botan/portfile.cmake b/vcpkg/ports/botan/portfile.cmake
new file mode 100644
index 0000000..8a96f6c
--- /dev/null
+++ b/vcpkg/ports/botan/portfile.cmake
@@ -0,0 +1,205 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO randombit/botan
+ REF "${VERSION}"
+ SHA512 596f4c5c167d1a8d3e387b764fab95fc01827988df93da9cdf3c10d632c8e662d3f9a2121a43c79ab44534a45b7e63c0e1adef61c7666d7851b83f6065815788
+ HEAD_REF master
+ PATCHES
+ embed-debug-info.patch
+ pkgconfig.patch
+ verbose-install.patch
+ configure-zlib.patch
+ fix_android.patch
+ libcxx-winpthread-fixes.patch
+ fix-cmake-usage.patch
+ 0009-fix-regression-f2bf049-85491b3.patch # extract from PR 4255
+)
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}")
+
+if(VCPKG_TARGET_IS_MINGW)
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+vcpkg_find_acquire_program(PYTHON3)
+
+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")
+endif()
+
+vcpkg_list(SET configure_arguments
+ "--distribution-info=vcpkg ${TARGET_TRIPLET}"
+ --disable-cc-tests
+ --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})
+endif()
+
+if(VCPKG_TARGET_IS_EMSCRIPTEN)
+ vcpkg_list(APPEND configure_arguments --cpu=wasm)
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ vcpkg_list(APPEND configure_arguments --cpu=x86)
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ vcpkg_list(APPEND configure_arguments --cpu=x86_64)
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ vcpkg_list(APPEND configure_arguments --cpu=arm32)
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ vcpkg_list(APPEND configure_arguments --cpu=arm64)
+else()
+ message(FATAL_ERROR "Unsupported architecture")
+endif()
+
+# 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()
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_list(APPEND configure_arguments --os=windows)
+
+ if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ vcpkg_list(APPEND configure_arguments --cc=msvc)
+ endif()
+
+ # 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()
+
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ vcpkg_list(APPEND configure_arguments --enable-shared-library --disable-static-library)
+ else()
+ vcpkg_list(APPEND configure_arguments --disable-shared-library --enable-static-library)
+ endif()
+
+ if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
+ set(BOTAN_MSVC_RUNTIME MD)
+ else()
+ set(BOTAN_MSVC_RUNTIME MT)
+ endif()
+
+ 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
+ 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}"
+ 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()
+ 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)
+ vcpkg_list(APPEND configure_arguments --os=mingw)
+ endif()
+
+ if(VCPKG_TARGET_IS_EMSCRIPTEN)
+ vcpkg_list(APPEND configure_arguments --cc=emcc)
+ elseif(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ vcpkg_list(APPEND configure_arguments --cc=gcc)
+ elseif(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ vcpkg_list(APPEND configure_arguments --cc=clang)
+ endif()
+ # 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}"
+ )
+ if(NOT VCPKG_TARGET_IS_EMSCRIPTEN)
+ vcpkg_copy_tools(TOOL_NAMES botan AUTO_CLEAN)
+ endif()
+endif()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/Botan-${VERSION}")
+
+file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-3/botan" "${CURRENT_PACKAGES_DIR}/include/botan")
+
+if(pkgconfig_requires)
+ list(JOIN pkgconfig_requires ", " pkgconfig_requires)
+ file(APPEND "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/botan-3.pc" "Requires.private: ${pkgconfig_requires}")
+ if(NOT VCPKG_BUILD_TYPE)
+ file(APPEND "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/botan-3.pc" "Requires.private: ${pkgconfig_requires}")
+ endif()
+endif()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/include/botan-3"
+)
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "#define BOTAN_INSTALL_PREFIX R\"(${CURRENT_PACKAGES_DIR})\"" "")
+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)
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/botan/build.h" "--prefix=${CURRENT_PACKAGES_DIR}" "")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt")
diff --git a/vcpkg/ports/botan/vcpkg.json b/vcpkg/ports/botan/vcpkg.json
new file mode 100644
index 0000000..1c2ce26
--- /dev/null
+++ b/vcpkg/ports/botan/vcpkg.json
@@ -0,0 +1,33 @@
+{
+ "name": "botan",
+ "version": "3.7.1",
+ "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
+ }
+ ],
+ "features": {
+ "amalgamation": {
+ "description": "Do an amalgamation build of the library"
+ },
+ "zlib": {
+ "description": "Build with zlib. Enable compression pipes.",
+ "dependencies": [
+ {
+ "name": "vcpkg-pkgconfig-get-modules",
+ "host": true
+ },
+ "zlib"
+ ]
+ }
+ }
+}
diff --git a/vcpkg/ports/botan/verbose-install.patch b/vcpkg/ports/botan/verbose-install.patch
new file mode 100644
index 0000000..4f6101e
--- /dev/null
+++ b/vcpkg/ports/botan/verbose-install.patch
@@ -0,0 +1,13 @@
+diff --git a/src/build-data/makefile.in b/src/build-data/makefile.in
+index 1d50a31..64789a5 100644
+--- a/src/build-data/makefile.in
++++ b/src/build-data/makefile.in
+@@ -61,7 +61,7 @@ distclean:
+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="%{build_dir}" --distclean
+
+ install: %{install_targets}
+- "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --build-dir="%{build_dir}"
++ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --build-dir="%{build_dir}" --verbose
+
+ check: tests
+ "$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="%{build_dir}"