From e3470088867d254dfd966bb1fe0d108858819912 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 29 Nov 2023 09:38:04 +0100 Subject: [PATCH] [botan] Fix android and emscripten (#35318) * [botan] Fix android and emscripten * CI --- ports/botan/portfile.cmake | 19 ++++++++++++++----- ports/botan/vcpkg.json | 1 + scripts/ci.baseline.txt | 3 --- versions/b-/botan.json | 5 +++++ versions/baseline.json | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ports/botan/portfile.cmake b/ports/botan/portfile.cmake index 7d265ba541..c22752e397 100644 --- a/ports/botan/portfile.cmake +++ b/ports/botan/portfile.cmake @@ -1,4 +1,3 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO randombit/botan @@ -53,7 +52,9 @@ if("zlib" IN_LIST FEATURES) x_vcpkg_pkgconfig_get_modules(LIBS PREFIX "ZLIB" MODULES "zlib" ${pkgconfig_syntax}) endif() -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") +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) @@ -109,11 +110,17 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) vcpkg_copy_tools(TOOL_NAMES botan-cli AUTO_CLEAN) vcpkg_copy_pdbs() else() - if(VCPKG_TARGET_IS_MINGW) + 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_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + 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) @@ -141,7 +148,9 @@ else() "ZLIB_LIBS_RELEASE=${ZLIB_LIBS_RELEASE}" "ZLIB_LIBS_DEBUG=${ZLIB_LIBS_DEBUG}" ) - vcpkg_copy_tools(TOOL_NAMES botan AUTO_CLEAN) + if(NOT VCPKG_TARGET_IS_EMSCRIPTEN) + vcpkg_copy_tools(TOOL_NAMES botan AUTO_CLEAN) + endif() endif() file(RENAME "${CURRENT_PACKAGES_DIR}/include/botan-3/botan" "${CURRENT_PACKAGES_DIR}/include/botan") diff --git a/ports/botan/vcpkg.json b/ports/botan/vcpkg.json index 067569ba68..8c9fe75aee 100644 --- a/ports/botan/vcpkg.json +++ b/ports/botan/vcpkg.json @@ -1,6 +1,7 @@ { "name": "botan", "version": "3.1.1", + "port-version": 1, "description": "A cryptography library written in C++11", "homepage": "https://botan.randombit.net", "license": "BSD-2-Clause", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index f9392abee1..1df2de4d6c 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -100,9 +100,6 @@ boringssl:x64-windows=skip boringssl:x64-windows-static=skip boringssl:x64-windows-static-md=skip boringssl:x86-windows=skip -botan:arm-neon-android=fail -botan:arm64-android=fail -botan:x64-android=fail brpc:x64-android=fail buck-yeh-bux:x64-android=fail c4core:arm-neon-android=fail diff --git a/versions/b-/botan.json b/versions/b-/botan.json index 7ee8c91e54..012914ab7c 100644 --- a/versions/b-/botan.json +++ b/versions/b-/botan.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c031a70866fae7751496d7edfd01caad2773dd08", + "version": "3.1.1", + "port-version": 1 + }, { "git-tree": "d66e60d97a7a4e77df4e559fed1926a45dac3f52", "version": "3.1.1", diff --git a/versions/baseline.json b/versions/baseline.json index 259ee59f2a..232ea0cf66 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1302,7 +1302,7 @@ }, "botan": { "baseline": "3.1.1", - "port-version": 0 + "port-version": 1 }, "box2d": { "baseline": "2.4.1",