From 749e10dee66f476ebb7b86372282b645813ad3af Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Tue, 26 Sep 2023 14:12:36 +0300 Subject: [PATCH] Upgrade OpenSSL 3.0.11 and Android NDK r26 (#558) IB-7835, IB-7836 Signed-off-by: Raul Metsma --- .github/workflows/build.yml | 6 +-- build-library.sh | 6 +-- build.ps1 | 2 +- cmake | 2 +- examples/android/build.gradle | 2 +- patches/vcpkg-ports/openssl/portfile.cmake | 4 +- patches/vcpkg-ports/openssl/vcpkg.json | 2 +- prepare_osx_build_environment.sh | 46 +++++++--------------- vcpkg.json | 2 +- 9 files changed, 26 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70ca57d18..6f116d504 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: env: MAKEFLAGS: "" VER_SUFFIX: .VS${{ matrix.toolset }} - VERSION: 3.16.0.${{ github.run_number }} + VERSION: 3.17.0.${{ github.run_number }} steps: - name: Checkout uses: actions/checkout@v3 @@ -165,7 +165,7 @@ jobs: - name: Prepare vcpkg X64 uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: 4a8d11802f0a9ffbe5c68f6143d61d469d800a7d + vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json runVcpkgInstall: true runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]" @@ -175,7 +175,7 @@ jobs: - name: Prepare vcpkg X86 uses: lukka/run-vcpkg@v11 with: - vcpkgGitCommitId: 4a8d11802f0a9ffbe5c68f6143d61d469d800a7d + vcpkgGitCommitId: 6a349fe1fbea1e5fcda2e0775f555d829a5e82df vcpkgJsonGlob: ${{ steps.path.outputs.value }}/vcpkg.json runVcpkgInstall: true runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]" diff --git a/build-library.sh b/build-library.sh index 5602f7702..07ec33b9f 100755 --- a/build-library.sh +++ b/build-library.sh @@ -5,7 +5,7 @@ set -e if [ "$#" -eq 0 ]; then echo "Usage:" echo " $0 target [maketask]" - echo " target: osx ios iossimulator ioscatalyst androidarm androidarm64 androidx86 androidx86_64" + echo " target: osx ios iossimulator ioscatalyst androidarm androidarm64 androidx86_64" echo "To control iOS, macOS builds set environment variables:" echo " minimum deployment target" echo " - MACOSX_DEPLOYMENT_TARGET=10.15" @@ -24,10 +24,6 @@ case "$@" in TARGET=androidx86_64 ARCH="x86_64" ;; - *x86*) - TARGET=androidx86 - ARCH="x86" - ;; *arm64*) TARGET=androidarm64 ARCH="arm64-v8a" diff --git a/build.ps1 b/build.ps1 index c7665e3a8..d75f0d78f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -5,7 +5,7 @@ param( [string]$vcpkg_dir = (split-path -parent $vcpkg), [string]$vcpkg_installed = $libdigidocpp, [string]$buildver = "0", - [string]$msiversion = "3.16.0.$buildver", + [string]$msiversion = "3.17.0.$buildver", [string]$msi_name = "libdigidocpp-$msiversion$env:VER_SUFFIX.msi", [string]$cmake = "cmake.exe", [string]$generator = "NMake Makefiles", diff --git a/cmake b/cmake index 60896303b..cb0452839 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 60896303b94527c015958225ac3c5c1321786975 +Subproject commit cb04528398ad10dfea1802c98d4199b29fb6f616 diff --git a/examples/android/build.gradle b/examples/android/build.gradle index ccb680ed1..1f396bb45 100644 --- a/examples/android/build.gradle +++ b/examples/android/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:8.1.1' } } diff --git a/patches/vcpkg-ports/openssl/portfile.cmake b/patches/vcpkg-ports/openssl/portfile.cmake index 71455d47c..6e98609d2 100644 --- a/patches/vcpkg-ports/openssl/portfile.cmake +++ b/patches/vcpkg-ports/openssl/portfile.cmake @@ -19,7 +19,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO openssl/openssl REF "openssl-${VERSION}" - SHA512 5c20269f9666eae0111252378baf196d74ae14a68b19cac49703d73fa564f7ae7aaf06209f5a3d7dc48c014ddb2e760bdf765141c14adde63edee552a8de015e + SHA512 4dd485720a335879bd52d0045edf65fd8397b6f6b6afb3e2c756230937304975b3bd95f67933cadde175cae81d420a692fcf7e96b9f9d2b059ea387a8d9ac305 PATCHES disable-apps.patch disable-install-docs.patch @@ -72,4 +72,4 @@ else() endif() file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/patches/vcpkg-ports/openssl/vcpkg.json b/patches/vcpkg-ports/openssl/vcpkg.json index 1252cc58e..e85770d10 100644 --- a/patches/vcpkg-ports/openssl/vcpkg.json +++ b/patches/vcpkg-ports/openssl/vcpkg.json @@ -1,6 +1,6 @@ { "name": "openssl", - "version": "3.0.10", + "version": "3.0.11", "description": "OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.", "homepage": "https://www.openssl.org", "license": "Apache-2.0", diff --git a/prepare_osx_build_environment.sh b/prepare_osx_build_environment.sh index cce6d6c94..c861cd2c7 100755 --- a/prepare_osx_build_environment.sh +++ b/prepare_osx_build_environment.sh @@ -5,9 +5,9 @@ XERCES_DIR=xerces-c-3.2.4 XALAN_DIR=xalan_c-1.12 XMLSEC_DIR=xml-security-c-2.0.4 XSD=xsd-4.0.0-i686-macosx -OPENSSL_DIR=openssl-3.0.9 -LIBXML2_DIR=libxml2-2.10.3 -ANDROID_NDK=android-ndk-r25 +OPENSSL_DIR=openssl-3.0.11 +LIBXML2_DIR=libxml2-2.11.5 +ANDROID_NDK=android-ndk-r26 FREETYPE_DIR=freetype-2.10.1 FONTCONFIG_DIR=fontconfig-2.13.1 PODOFO_DIR=podofo-0.9.4 @@ -18,22 +18,17 @@ case "$@" in case "$@" in *x86_64*) ARCH=x86_64 - ARCH_ABI="x86_64" + ARCH_ABI=x86_64 CROSS_COMPILE=x86_64-linux-android ;; - *x86*) - ARCH=x86 - ARCH_ABI="x86" - CROSS_COMPILE=i686-linux-android - ;; *arm64*) ARCH=arm64 - ARCH_ABI="arm64-v8a" + ARCH_ABI=arm64-v8a CROSS_COMPILE=aarch64-linux-android ;; *) ARCH=arm - ARCH_ABI="armeabi-v7a" + ARCH_ABI=armeabi-v7a CROSS_COMPILE=armv7a-linux-androideabi ;; esac @@ -64,7 +59,7 @@ case "$@" in *simulator*) echo "Building for iOS Simulator" TARGET_PATH=/Library/libdigidocpp.iphonesimulator - CONFIGURE="--host=arm-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" + CONFIGURE="--host=aarch64-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" SYSROOT=$(xcrun -sdk iphonesimulator --show-sdk-path) : ${ARCHS:="arm64 x86_64"} : ${IPHONEOS_DEPLOYMENT_TARGET:="12.0"} @@ -74,7 +69,7 @@ case "$@" in *ioscatalyst*) echo "Building for iOS macOS Catalyst" TARGET_PATH=/Library/libdigidocpp.iphonecatalyst - CONFIGURE="--host=x86_64-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" + CONFIGURE="--host=aarch64-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" SYSROOT=$(xcrun -sdk macosx --show-sdk-path) : ${ARCHS:="arm64 x86_64"} : ${IPHONEOS_DEPLOYMENT_TARGET:="12.0"} @@ -84,7 +79,7 @@ case "$@" in *ios*) echo "Building for iOS" TARGET_PATH=/Library/libdigidocpp.iphoneos - CONFIGURE="--host=arm-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" + CONFIGURE="--host=aarch64-apple-darwin --enable-static --disable-shared --disable-dependency-tracking" SYSROOT=$(xcrun -sdk iphoneos --show-sdk-path) : ${ARCHS:="arm64"} : ${IPHONEOS_DEPLOYMENT_TARGET:="12.0"} @@ -253,22 +248,11 @@ function openssl { *) for ARCH in ${ARCHS} do - case "${ARCH}" in - *x86_64*) - case "${ARGS}" in - *simulator*) CC="" CFLAGS="-arch x86_64" ./Configure iossimulator-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *catalyst*) CC="" CFLAGS="-target x86_64-apple-ios-macabi" ./Configure darwin64-x86_64 --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *) CC="" CFLAGS="" ./Configure darwin64-x86_64 --prefix=${TARGET_PATH} shared no-module no-tests enable-ec_nistp_64_gcc_128 - esac - ;; - *arm64*) - case "${ARGS}" in - *simulator*) CC="" CFLAGS="-arch arm64" ./Configure iossimulator-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *catalyst*) CC="" CFLAGS="-target x86_64-apple-ios-macabi" ./Configure darwin64-arm64 --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *ios*) CC="" CFLAGS="" ./Configure ios64-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; - *) CC="" CFLAGS="" ./Configure darwin64-arm64 --prefix=${TARGET_PATH} shared no-module no-tests enable-ec_nistp_64_gcc_128 - esac - ;; + case "${ARGS}" in + *simulator*) CC="" CFLAGS="-arch ${ARCH}" ./Configure iossimulator-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; + *catalyst*) CC="" CFLAGS="-target ${ARCH}-apple-ios-macabi" ./Configure darwin64-${ARCH} --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; + *ios*) CC="" CFLAGS="" ./Configure ios64-xcrun --prefix=${TARGET_PATH} no-shared no-dso no-module no-engine no-tests no-ui-console enable-ec_nistp_64_gcc_128 ;; + *) CC="" CFLAGS="" ./Configure darwin64-${ARCH} --prefix=${TARGET_PATH} shared no-module no-tests enable-ec_nistp_64_gcc_128 esac make -s > /dev/null if [[ ${ARCHS} == ${ARCH}* ]]; then @@ -420,7 +404,7 @@ case "$@" in *) echo "Usage:" echo " $0 [target] [task]" - echo " target: osx ios iossimulator ioscatalyst androidarm androidarm64 androidx86 androidx86_64" + echo " target: osx ios iossimulator ioscatalyst androidarm androidarm64 androidx86_64" echo " tasks: xerces, xalan, openssl, xmlsec, xsd, all, help" echo "To control iOS, macOS builds set environment variables:" echo " minimum deployment target" diff --git a/vcpkg.json b/vcpkg.json index a06d371c4..88eba5bef 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,7 +8,7 @@ "features": { "tests": { "description": "Build tests", "dependencies": ["boost-test"] } }, - "builtin-baseline": "4a8d11802f0a9ffbe5c68f6143d61d469d800a7d", + "builtin-baseline": "6a349fe1fbea1e5fcda2e0775f555d829a5e82df", "vcpkg-configuration": { "overlay-triplets": ["./patches/vcpkg-triplets"], "overlay-ports": [