Commit 01fbc165 authored by Johan Ouwerkerk's avatar Johan Ouwerkerk

Provide a generic autotools helper script (wrapper around build-standalone)

Example usage in CI scripts:

   /opt/helpers/build-autotools libsodium https://github.com/jedisct1/libsodium.git src/libsodium 1.0.18

The third argument is an optional branch/tag name to checkout.
It may also be left out in which case 'master' will be assumed by default.
parent c1d51bcc
Pipeline #16443 skipped with stage
...@@ -163,7 +163,7 @@ RUN sed -i.bak "s|#define QT_NO_DBUS|//#define QT_NO_DBUS //we install it sep ...@@ -163,7 +163,7 @@ RUN sed -i.bak "s|#define QT_NO_DBUS|//#define QT_NO_DBUS //we install it sep
ENV QMAKESPEC android-clang ENV QMAKESPEC android-clang
RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git RUN /opt/helpers/build-cmake libintl-lite https://github.com/j-jorge/libintl-lite.git
COPY build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \ COPY build-autotools build-qt build-generic build-eigen build-poppler build-vlcqt build-gstreamer-binaries build-kde-dependencies build-kde-project create-apk get-apk-args \
target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-standalone build-discount 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch /opt/helpers/ target-from-manifest.py target-from-appdata.py cp-with-prefix skip build-standalone build-discount 0001-Hack-Use-mktags-from-native-build-when-crosscompilin.patch /opt/helpers/
RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_PATH/src/android/templates/AndroidManifest.xml \ RUN sed -i.bak 's/android:minSdkVersion="16"/android:minSdkVersion="21"/g' $QT_PATH/src/android/templates/AndroidManifest.xml \
......
#!/bin/bash
set -e
#
# Determine an appropriate parallelism setting (autotools builds are usually slow enough as it is)
# The jobs formula matches with what ninja seems to think is a good default on my machine, and is fairly conservative anyway.
#
cores="$(nproc --all)"
jobs="$(($cores * 5 / 4))"
NAME="$1"
GIT_URL="$2"
GIT_BRANCH_OR_TAG_REF="${3:-master}"
WORKDIR="$(pwd)/src/$NAME"
if [ -z "$NAME" ]
then
echo "No name specified (usage: $(basename "$0") <name> <url> <optional tag/branch>)" >&2
exit 1
elif [ -z "$GIT_URL" ]
then
echo "No git url specified (usage: $(basename "$0") <name> <url> <optional tag/branch>)" >&2
exit 1
else
echo "Will attempt to build '$NAME' ($GIT_BRANCH_OR_TAG_REF) from $GIT_URL"
fi
if [ -e "$WORKDIR" ]
then
echo "There appears to be something else already at '$WORKDIR'" >&2
echo "This may mess up your build of '$NAME', proceeding to remove it with prejudice..." >&2
rm -rf "$WORKDIR"
fi
generate_autotools_script ()
{
cat << SCRIPT
./autogen.sh
./configure --prefix=/opt/kdeandroid-deps --host="\${ANDROID_NDK_TOOLCHAIN_PREFIX}"
make -j$jobs
make install
SCRIPT
}
git clone --depth 1 --branch "$GIT_BRANCH_OR_TAG_REF" "$GIT_URL" "$WORKDIR"
cd "$WORKDIR"
/opt/helpers/build-standalone "$(generate_autotools_script)"
echo "Build of $NAME succeeded, cleaning up $WORKDIR ..."
rm -rf "$WORKDIR"
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