Merge pull request #3404 from mardy/botan26

[botan] Update to 2.6.0
This commit is contained in:
Alexander Karatarakis 2018-07-03 20:58:58 -07:00 committed by GitHub
commit 7225914442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 80 deletions

View File

@ -1,56 +0,0 @@
From b41cc93b63c99525e71291424466cdd45d92f770 Mon Sep 17 00:00:00 2001
From: Mikhail Paulyshka <me@mixaill.tk>
Date: Sun, 12 Mar 2017 04:34:10 +0300
Subject: [PATCH] fix CRT linking for static library for MSVC
---
configure.py | 15 +++++++++++++++
src/build-data/cc/msvc.txt | 8 ++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
index faf5120c5..9c545cf5f 100755
--- a/configure.py
+++ b/configure.py
@@ -976,6 +976,21 @@ class CompilerInfo(object):
if flag != None and flag != '' and flag not in abi_link:
abi_link.append(flag)
+ if options.build_shared_lib:
+ if options.with_debug_info:
+ if 'dynamic-debug' in self.mach_abi_linking:
+ abi_link.append(self.mach_abi_linking['dynamic-debug'])
+ else:
+ if 'dynamic' in self.mach_abi_linking:
+ abi_link.append(self.mach_abi_linking['dynamic'])
+ else:
+ if options.with_debug_info:
+ if 'static-debug' in self.mach_abi_linking:
+ abi_link.append(self.mach_abi_linking['static-debug'])
+ else:
+ if 'static' in self.mach_abi_linking:
+ abi_link.append(self.mach_abi_linking['static'])
+
if options.with_coverage_info:
if self.coverage_flags == '':
raise ConfigureError('No coverage handling for %s' % (self.basename))
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
index c1b820b91..e6182b0fa 100644
--- a/src/build-data/cc/msvc.txt
+++ b/src/build-data/cc/msvc.txt
@@ -53,6 +53,10 @@ default-debug -> "$(LINKER) /DEBUG"
</binary_link_commands>
<mach_abi_linking>
-all -> "/MD /bigobj"
-all-debug -> "/MDd /bigobj"
+all -> "/bigobj"
+all-debug -> "/bigobj"
+static -> "/MT"
+static-debug -> "/MTd"
+dynamic -> "/MD"
+dynamic-debug -> "/MDd"
</mach_abi_linking>
--
2.11.0.windows.1

View File

@ -1,3 +1,3 @@
Source: botan
Version: 2.0.1
Description: A cryptography library written in C++11
Version: 2.6.0-1
Description: A cryptography library written in C++11

View File

@ -1,7 +1,7 @@
include(vcpkg_common_functions)
set(BOTAN_VERSION 2.0.1)
set(BOTAN_HASH c5062ce92a6e6e333b4e6af095ed54d0c4ffacefc6ac87ec651dd1e0937793c9956b7c9c0d3acf49f059505526584168364e01c55ab72c953ad255e8396aed35)
set(BOTAN_VERSION 2.6.0)
set(BOTAN_HASH 2082b4aaac0802f117a5f75c67a69e6d364b436a0ebe543032e370c3f085752bbe1ca48051462066e13bd42e47573ebc532d1d45074fe406df032f33346ee645)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Botan-${BOTAN_VERSION})
vcpkg_download_distfile(ARCHIVE
@ -10,15 +10,24 @@ vcpkg_download_distfile(ARCHIVE
SHA512 ${BOTAN_HASH}
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-crt-linking.patch")
vcpkg_find_acquire_program(JOM)
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${PYTHON3_DIR}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BOTAN_FLAG_SHARED --disable-shared)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BOTAN_FLAG_SHARED --enable-shared-library)
set(BOTAN_FLAG_STATIC --disable-static-library)
else()
set(BOTAN_FLAG_SHARED --disable-shared-library)
set(BOTAN_FLAG_STATIC --enable-static-library)
endif()
if(VCPKG_CRT_LINKAGE STREQUAL dynamic)
set(BOTAN_MSVC_RUNTIME "--msvc-runtime=MD")
else()
set(BOTAN_MSVC_RUNTIME "--msvc-runtime=MT")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
@ -34,12 +43,14 @@ function(BOTAN_BUILD BOTAN_BUILD_TYPE)
if(BOTAN_BUILD_TYPE STREQUAL "dbg")
set(BOTAN_FLAG_PREFIX ${CURRENT_PACKAGES_DIR}/debug)
set(BOTAN_FLAG_DEBUGMODE --debug-mode)
set(BOTAN_DEBUG_PREFIX d)
set(BOTAN_DEBUG_SUFFIX "")
set(BOTAN_MSVC_RUNTIME_SUFFIX "d")
else()
set(BOTAN_FLAG_DEBUGMODE)
set(BOTAN_FLAG_PREFIX ${CURRENT_PACKAGES_DIR})
set(BOTAN_MSVC_RUNTIME_SUFFIX "")
endif()
message(STATUS "Configure ${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE}")
if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE})
@ -48,16 +59,16 @@ function(BOTAN_BUILD BOTAN_BUILD_TYPE)
make_directory(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE})
vcpkg_execute_required_process(
COMMAND "${PYTHON3}" "${SOURCE_PATH}/configure.py"
COMMAND "${PYTHON3}" "${SOURCE_PATH}/configure.py"
--cc=msvc
--cpu=${BOTAN_FLAG_CPU}
${BOTAN_FLAG_SHARED}
${BOTAN_FLAG_SHARED}
${BOTAN_FLAG_STATIC}
${BOTAN_MSVC_RUNTIME}${BOTAN_MSVC_RUNTIME_SUFFIX}
${BOTAN_FLAG_DEBUGMODE}
"--distribution-info=vcpkg ${TARGET_TRIPLET}"
--makefile-style=nmake
--with-pkcs11
--prefix=${BOTAN_FLAG_PREFIX}
--link-method=copy
--link-method=copy
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE}"
LOGNAME configure-${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE})
message(STATUS "Configure ${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE} done")
@ -71,18 +82,18 @@ function(BOTAN_BUILD BOTAN_BUILD_TYPE)
message(STATUS "Package ${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE}")
vcpkg_execute_required_process(
COMMAND "${PYTHON3}" "${SOURCE_PATH}/src/scripts/install.py"
--destdir=${BOTAN_FLAG_PREFIX}
--docdir=share
COMMAND "${PYTHON3}" "${SOURCE_PATH}/src/scripts/install.py"
--prefix=${BOTAN_FLAG_PREFIX}
--docdir=share
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE}"
LOGNAME install-${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE})
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(RENAME ${BOTAN_FLAG_PREFIX}/lib/botan${BOTAN_DEBUG_PREFIX}.dll ${BOTAN_FLAG_PREFIX}/bin/botan${BOTAN_DEBUG_PREFIX}.dll)
file(RENAME ${BOTAN_FLAG_PREFIX}/lib/botan${BOTAN_DEBUG_SUFFIX}.dll ${BOTAN_FLAG_PREFIX}/bin/botan${BOTAN_DEBUG_SUFFIX}.dll)
endif()
message(STATUS "Package ${TARGET_TRIPLET}-${BOTAN_BUILD_TYPE} done")
endfunction()
endfunction()
BOTAN_BUILD(rel)
BOTAN_BUILD(dbg)
@ -93,14 +104,14 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/botan-cli.exe)
file(RENAME ${CURRENT_PACKAGES_DIR}/include/botan-2/botan ${CURRENT_PACKAGES_DIR}/include/botan)
file(REMOVE_RECURSE
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/include/botan-2
${CURRENT_PACKAGES_DIR}/share/botan-${BOTAN_VERSION}/manual)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin)
endif()