From 2d7784b9132474cc1dee0266f4a0c80fde7443bd Mon Sep 17 00:00:00 2001 From: luc Date: Mon, 18 Mar 2024 12:32:36 +0100 Subject: [PATCH] Update to openssl 3.2.1 --- .github/workflows/build-dep-openssl.yml | 4 +- .../android/app/build.gradle | 8 ++-- .../build_openssl_for_andV8.sh | 46 ++++++++----------- .../build_openssl_for_linux.sh | 31 +++++-------- .../build_openssl_for_mac64_and_iosV8.sh | 4 +- .../build_openssl_for_win64.bat | 33 ++++++++----- 6 files changed, 59 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build-dep-openssl.yml b/.github/workflows/build-dep-openssl.yml index 4fd624b1..999093f0 100644 --- a/.github/workflows/build-dep-openssl.yml +++ b/.github/workflows/build-dep-openssl.yml @@ -64,10 +64,10 @@ jobs: uses: actions/upload-artifact@v3 with: name: prebuilt-openssl-mac64 - path: ${{ github.workspace }}/externals/prebuilt/mac64_openssl_1.1.1g + path: ${{ github.workspace }}/externals/prebuilt/mac64_openssl_3.2.1 - name: Archive prebuilt openssl ios uses: actions/upload-artifact@v3 with: name: prebuilt-openssl-ios - path: ${{ github.workspace }}/externals/prebuilt/iosV8_openssl_1.1.1g + path: ${{ github.workspace }}/externals/prebuilt/iosV8_openssl_3.2.1 diff --git a/apps/app_demo_slproject/android/app/build.gradle b/apps/app_demo_slproject/android/app/build.gradle index a3faacfa..b5bda59e 100644 --- a/apps/app_demo_slproject/android/app/build.gradle +++ b/apps/app_demo_slproject/android/app/build.gradle @@ -3,10 +3,10 @@ apply plugin: 'com.android.application' android { signingConfigs { release { - keyAlias 'cpvrlab' - keyPassword '?' // Change to your key password - storeFile file('../cpvrlab-release-key') - storePassword '?' // Change to your store password + keyAlias 'slproject-release-key' + keyPassword '' // Change to your key password + storeFile file('../slproject-release-key') + storePassword '' // Change to your store password } } compileSdkVersion 29 diff --git a/externals/prebuild_scripts/build_openssl_for_andV8.sh b/externals/prebuild_scripts/build_openssl_for_andV8.sh index a0f201d2..afded68e 100755 --- a/externals/prebuild_scripts/build_openssl_for_andV8.sh +++ b/externals/prebuild_scripts/build_openssl_for_andV8.sh @@ -7,18 +7,22 @@ # the variable TOOLCHAIN (search below). E.g. on macos it is # $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin -openssl_VERSION="OpenSSL_1_1_1h" +ANDROID_NDK_VERSION="r20b" + +openssl_VERSION="3.2.1" if [ -n "$1" ] then openssl_VERSION="$1" fi - -if [ "$ANDROID_NDK_HOME" == "" ] +WORK_PATH=$(cd "$(dirname "$0")";pwd) +if [ ! -d android-ndk-r20b ] then - echo "android ndk home not defined" - echo "export ANDROID_NDK_HOME=/path/Android/ndk-bundle/" - exit + wget https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip + unzip android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip fi +export ANDROID_NDK_HOME="android-ndk-r20b" +export ANDROID_NDK_PATH=${WORK_PATH}/${ANDROID_NDK_HOME} +export ANDROID_NDK_ROOT=${ANDROID_NDK_PATH} ARCH=andV8 ZIPFILE=${ARCH}_openssl @@ -26,29 +30,15 @@ ZIPFILE=${ARCH}_openssl clear echo "Building openssl Version: $openssl_VERSION" -if [ ! -d "openssl/.git" ]; then - git clone https://github.com/openssl/openssl.git -fi - -# Get all assimp tags and check if the requested exists -cd openssl -git tag > openssl_tags.txt - -if grep -Fx "$openssl_VERSION" openssl_tags.txt > /dev/null; then - git checkout $openssl_VERSION - git pull origin $openssl_VERSION -else - echo "No valid openssl tag passed as 1st parameter !!!!!" - exit +if [ ! -d "openssl-${openssl_VERSION}" ]; then + wget https://www.openssl.org/source/openssl-${openssl_VERSION}.tar.gz + tar -zxf openssl-${openssl_VERSION}.tar.gz fi -ls - +cd openssl-${openssl_VERSION} -export CC=clang -export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin +export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin:$PATH export API=21 -export PATH=$TOOLCHAIN:$PATH architecture=android-arm64 export PREFIX=$(pwd)/../$ZIPFILE @@ -70,10 +60,10 @@ make install cd .. -if [ -d "../prebuilt/${ARCH}_openssl" ] +if [ -d "../prebuilt/${ARCH}_openssl-${openssl_VERSION}" ] then - rm -rf ../prebuilt/${ARCH}_openssl + rm -rf ../prebuilt/${ARCH}_openssl-${openssl_VERSION} fi -mv ${ZIPFILE} ../prebuilt/${ARCH}_openssl/ +mv ${ZIPFILE} ../prebuilt/${ARCH}_openssl-${openssl_VERSION}/ diff --git a/externals/prebuild_scripts/build_openssl_for_linux.sh b/externals/prebuild_scripts/build_openssl_for_linux.sh index 6e29d17e..45a88318 100755 --- a/externals/prebuild_scripts/build_openssl_for_linux.sh +++ b/externals/prebuild_scripts/build_openssl_for_linux.sh @@ -5,37 +5,26 @@ # #################################################### -VERSION="1.1.1h" -openssl_VERSION="OpenSSL_1_1_1h" +VERSION="3.2.1" #if [ -n "$1" ] #then -# openssl_VERSION="$1" +# VERSION="$1" #fi ARCH=linux ZIPFILE=${ARCH}_openssl_${VERSION} clear -echo "Building openssl Version: $openssl_VERSION" +echo "Building openssl Version: $VERSION" -if [ ! -d "openssl/.git" ]; then - git clone https://github.com/openssl/openssl.git +if [ ! -d "openssl-${VERSION}" ]; then + wget https://www.openssl.org/source/openssl-${VERSION}.tar.gz + tar -zxf openssl-${VERSION}.tar.gz fi -# Get all assimp tags and check if the requested exists -cd openssl -git tag > openssl_tags.txt +cd "openssl-${VERSION}" -if grep -Fx "$openssl_VERSION" openssl_tags.txt > /dev/null; then - git checkout $openssl_VERSION - git pull origin $openssl_VERSION -else - echo "No valid openssl tag passed as 1st parameter !!!!!" - exit -fi - - -export CC=clang +#export CC=clang export PREFIX=$(pwd)/../$ZIPFILE if [ ! -d "$PREFIX" ] @@ -43,7 +32,9 @@ then mkdir $PREFIX fi -./config --prefix=$PREFIX --openssldir=$PREFIX +#./config --prefix=$PREFIX --openssldir=$PREFIX + +./Configure ${x86_64} --prefix=$PREFIX --openssldir=$PREFIX if [ $? -ne 0 ] then diff --git a/externals/prebuild_scripts/build_openssl_for_mac64_and_iosV8.sh b/externals/prebuild_scripts/build_openssl_for_mac64_and_iosV8.sh index 8a790fc9..81399ee1 100755 --- a/externals/prebuild_scripts/build_openssl_for_mac64_and_iosV8.sh +++ b/externals/prebuild_scripts/build_openssl_for_mac64_and_iosV8.sh @@ -10,7 +10,8 @@ echo "============================================================" git clone https://github.com/jasonacox/Build-OpenSSL-cURL.git -OPENSSL_VER=1.1.1g +#OPENSSL_VER=1.1.1g +OPENSSL_VER=3.2.1 OUTDIR_MAC=mac64_openssl_"$OPENSSL_VER" OUTDIR_IOS=iosV8_openssl_"$OPENSSL_VER" BUILDDIR=Build-OpenSSL-cURL @@ -35,3 +36,4 @@ cp -R ../prebuild_scripts/$BUILDDIR/openssl/iOS/include $OUTDIR_IOS/include cp -R ../prebuild_scripts/$BUILDDIR/openssl/iOS/lib $OUTDIR_IOS/release cp ../prebuild_scripts/$BUILDDIR/LICENSE $OUTDIR_MAC/ cp ../prebuild_scripts/$BUILDDIR/LICENSE $OUTDIR_IOS/ + diff --git a/externals/prebuild_scripts/build_openssl_for_win64.bat b/externals/prebuild_scripts/build_openssl_for_win64.bat index c8fc1fda..19e7c3fb 100644 --- a/externals/prebuild_scripts/build_openssl_for_win64.bat +++ b/externals/prebuild_scripts/build_openssl_for_win64.bat @@ -5,10 +5,12 @@ @echo off -set OPENSSL_VERSION="OpenSSL_1_1_1h" +::set OPENSSL_VERSION="OpenSSL_3_2_1" +set VERSION="3.2.1" if "%1" == "" ( - set OPENSSL_VERSION="%1" + set VERSION="%1" + ::set OPENSSL_VERSION="%1" ) :: To enable downloading prebuilds copy @@ -17,21 +19,28 @@ set MAX_NUM_CPU_CORES=6 set SLPROJECT_ROOT=%2 set PREFIX=%cd%\..\prebuilt\win64_openssl -echo Building OpenSSL Version: %OPENSSL_VERSION% +::echo Building OpenSSL Version: %OPENSSL_VERSION% +echo Building OpenSSL Version: %VERSION% echo Installation directory: %PREFIX% echo Using %MAX_NUM_CPU_CORES% cpu cores for build. ::-----------------------------------------------------------------:: -if not exist openssl ( - git clone https://github.com/openssl/openssl.git -) else ( - echo openssl already exists -) -cd openssl -git checkout %OPENSSL_VERSION% -git pull origin %OPENSSL_VERSION% +::if not exist openssl ( +:: git clone https://github.com/openssl/openssl.git +::) else ( +:: echo openssl already exists +::) +::cd openssl +::git checkout %OPENSSL_VERSION% +::git pull origin %OPENSSL_VERSION% +:: +::perl Configure VC-WIN64A --prefix=%PREFIX% --openssldir=%PREFIX% + +if [ ! -d "openssl-${VERSION}" ]; then + curl https://www.openssl.org/source/openssl-${VERSION}.tar.gz + tar -zxf openssl-${VERSION}.tar.gz +fi -perl Configure VC-WIN64A --prefix=%PREFIX% --openssldir=%PREFIX% nmake clean nmake