Skip to content

Commit

Permalink
Api24 (#96)
Browse files Browse the repository at this point in the history
* api 24

* api 24 and kdab openssl
  • Loading branch information
PeterPetrik committed May 31, 2023
1 parent 9a7d3d5 commit 1b3e097
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: macos-12
env:
QT_VERSION: '6.5.1'
ANDROIDAPI: 28
ANDROIDAPI: 24
NDK_VERSION: r25b
NDK_VERSION_FULL: r25b
JDK_VERSION: 11
Expand Down
2 changes: 1 addition & 1 deletion android/config.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export ROOT_OUT_PATH=<where you want build SDK>
### Currently suggested versions ####
# should be downloaded from https://dl.google.com/android/repository/android-ndk-r25b-darwin.zip
export ANDROIDNDKVER=r25
export ANDROIDAPI=28 # == CMake's ANDROID_NATIVE_API_LEVEL == gradle's minSdkVersion == Dockerfile ANDROID_NDK_PLATFORM
export ANDROIDAPI=24 # == CMake's ANDROID_NATIVE_API_LEVEL == gradle's minSdkVersion == Dockerfile ANDROID_NDK_PLATFORM

#### PATHS ####
export ANDROIDSDK="/path/to/android-sdk"
Expand Down
44 changes: 7 additions & 37 deletions android/recipes/openssl/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,13 @@ function shouldbuild_openssl() {

# function called to build the source code
function build_openssl() {
# Setup compiler toolchain based on CPU architecture
if [ "X${ARCH}" == "Xarmeabi-v7a" ]; then
export SSL_ARCH=android-arm
elif [ "X${ARCH}" == "Xarm64-v8a" ]; then
export SSL_ARCH=android-arm64
else
echo "Error: Please report issue to enable support for arch (${ARCH})."
exit 1
fi

push_arm
# export CC=$TOOLCHAIN_FULL_PREFIX-clang
# export CFLAGS=""
export ANDROID_NDK_HOME="$ANDROIDNDK"

try $BUILD_openssl/Configure shared ${SSL_ARCH} -D__ANDROID_API__=$ANDROIDAPI --prefix=/
${MAKE} depend
${MAKE} DESTDIR=${STAGE_PATH} SHLIB_VERSION_NUMBER= build_libs

# install
try ${MAKE} SHLIB_VERSION_NUMBER= DESTDIR=$STAGE_PATH install_dev

cd $STAGE_PATH/lib
rm libcrypto.a
rm libssl.a

$STRIP --strip-all libcrypto.so
mv libcrypto.so libcrypto_3.so
try patchelf --set-soname libcrypto_3.so libcrypto_3.so

$STRIP --strip-all libssl.so
mv libssl.so libssl_3.so
try patchelf --set-soname libssl_3.so libssl_3.so

try patchelf --replace-needed libcrypto.so libcrypto_3.so libssl_3.so

pop_arm
cd $BUILD_openssl
try mkdir -p ${STAGE_PATH}/include/openssl
try mkdir -p ${STAGE_PATH}/lib

try cp ssl_3/include/openssl/* ${STAGE_PATH}/include/openssl/
try cp ssl_3/${ARCH}/libssl_3.so ${STAGE_PATH}/lib/
try cp ssl_3/${ARCH}/libcrypto_3.so ${STAGE_PATH}/lib/
}

# function called after all the compile have been done
Expand Down
10 changes: 9 additions & 1 deletion android/recipes/postgresql/patches/configure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@

else
as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5

@@ -13999,7 +13999,7 @@ fi
fi


-for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/tas.h sys/uio.h sys/un.h termios.h ucred.h wctype.h
+for ac_header in atomic.h copyfile.h execinfo.h getopt.h ifaddrs.h mbarrier.h poll.h sys/epoll.h sys/event.h sys/ipc.h sys/personality.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/signalfd.h sys/sockio.h sys/tas.h sys/uio.h sys/un.h termios.h ucred.h wctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
7 changes: 7 additions & 0 deletions android/recipes/postgresql/recipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function prebuild_postgresql() {
try cp $ROOT_OUT_PATH/.packages/config.guess $BUILD_postgresql/conftools

try patch -p1 < $RECIPE_postgresql/patches/configure.patch
if [ $ANDROIDAPI -ge 26 ]; then
# remove langinfo.h removal from configure
# nl_langinfo introduced in ANDROIDAPI >= 26
# https://github.com/KhronosGroup/SPIRV-Cross/issues/891
echo "check postgresql recipe"
exit 1
fi

touch .patched
}
Expand Down
8 changes: 4 additions & 4 deletions versions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export MD5_webp=7e047f2cbaf584dff7a8a7e0f8572f18
# "qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed"
# see https://github.com/KDAB/android_openssl/tree/master for building instructions
# see https://wiki.qt.io/Qt_6.5_Tools_and_Versions
# Qt 6.5.1 OpenSSL 3.0.7
export VERSION_openssl=3.0.7
export URL_openssl=https://github.com/openssl/openssl/releases/download/openssl-${VERSION_openssl}/openssl-${VERSION_openssl}.tar.gz
export MD5_openssl=545478ce41b96bf3beacb4dc58b36c77
# Qt 6.5.1 OpenSSL 3.x
export VERSION_openssl=82c850cbc602ca4d20c82552e618b0a98b196f3c
export URL_openssl=https://github.com/KDAB/android_openssl/archive/${VERSION_openssl}.tar.gz
export MD5_openssl=6cb9f4816bb3cf737dd5c18ed4e47d79

0 comments on commit 1b3e097

Please sign in to comment.