Verified Commit ae9172e7 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳 Committed by Linus Jahn

android: Strip binaries

parent 335dd370
Pipeline #16809 passed with stages
in 91 minutes and 1 second
#!/usr/bin/env bash
function strip_directory_arm() {
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip $(find $1 -name "*armeabi-v7a*".so)
}
function strip_directory_arm64() {
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip $(find $1 -name "*arm64*".so)
}
# KDE Frameworks Version, either master or a version number
KAIDAN_SOURCES=$(dirname "$(readlink -f "${0}")")/..
......@@ -14,6 +22,16 @@ git submodule update --init
sudo apt update
sudo apt -y install inkscape optipng
# HACK
# We don't want debug symbols, but gradle doesn't strip those anymore seemingly.
# Therefore patch the KDE scripts not to build them into the binary at all.
sudo sed -i 's/-DCMAKE_BUILD_TYPE=debug/-DCMAKE_BUILD_TYPE=Release/g' -i /opt/helpers/build-cmake
# HACK 2
# Strip Qt before building
strip_directory_arm "/opt/Qt/lib/"
strip_directory_arm64 "/opt/Qt/lib/"
# Build dependencies
GIT_EXTRA="--branch ${KF5_VERSION}" /opt/helpers/build-kde-dependencies --withProject kirigami knotifications
/opt/helpers/build-cmake qxmpp https://github.com/qxmpp-project/qxmpp.git -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF
......@@ -21,12 +39,17 @@ GIT_EXTRA="--branch ${KF5_VERSION}" /opt/helpers/build-kde-dependencies --withPr
# Trick the script to not clone kaidan once again
if ! [ -f "${KAIDAN_SOURCES}/kaidan/" ]; then
ln -s ${KAIDAN_SOURCES} ${PWD}/src/kaidan
ln -s ${KAIDAN_SOURCES} ${PWD}/src/kaidan
fi
# Build Kaidan
/opt/helpers/build-cmake ${CI_PROJECT_NAME} ${CI_REPOSITORY_URL} -DQTANDROID_EXPORTED_TARGET=kaidan -DANDROID_APK_DIR=${CI_PROJECT_DIR}/src/${CI_PROJECT_NAME}/misc/android -DI18N=1 -DUSE_KNOTIFICATIONS=ON
# HACK 3
# Strip build directory before deploying
strip_directory_arm ./build-arm
strip_directory_arm64 ./build-arm64
# pack apk
${CI_PROJECT_DIR}/src/${CI_PROJECT_NAME}/utils/render-logos.sh
/opt/helpers/create-apk ${CI_PROJECT_NAME}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment