[botan] Fix 2.6.0 issues

This commit is contained in:
Alexander Karatarakis 2018-06-29 21:41:08 -07:00
parent 4fbe9f8610
commit d65e5703cc
2 changed files with 32 additions and 18 deletions

View File

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

View File

@ -13,9 +13,21 @@ vcpkg_extract_source_archive(${ARCHIVE})
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")
@ -31,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})
@ -45,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")
@ -68,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)
@ -90,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()