Skip to content

Commit

Permalink
Fix ARM builds
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Dec 4, 2023
1 parent 104ed48 commit 92439fe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 19 additions & 15 deletions ci/build-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,32 @@ cleanup() {
trap cleanup EXIT

# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
OLD_CWD=$(readlink -f .)
REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")"
OLD_CWD="$(readlink -f .)"

pushd "$BUILD_DIR"

if [ "$ARCH" == "x86_64" ]; then
EXTRA_CMAKE_ARGS=()
elif [ "$ARCH" == "i386" ]; then
EXTRA_CMAKE_ARGS=("-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT/cmake/toolchains/i386-linux-gnu.cmake")
else
echo "Architecture not supported: $ARCH" 1>&2
exit 1
fi
case "$ARCH" in
x86_64|armhf|aarch64)
AIK_ARCH="$ARCH"
;;
i386)
AIK_ARCH="i686"
;;
*)
echo "Architecture not supported: $ARCH" 1>&2
exit 1
;;
esac

cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}"
cmake -G Ninja "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}"

make -j$(nproc)
nprocs="$(nproc)"
[[ "$nprocs" -gt 2 ]] && nprocs="$(nproc --ignore=1)"

make install DESTDIR=AppDir
ninja -v -j"$nprocs"

AIK_ARCH="$ARCH"
[ "$ARCH" == "i386" ] && AIK_ARCH="i686"
env DESTDIR=AppDir ninja -v install

wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
chmod +x linuxdeploy-"$ARCH".AppImage
Expand Down
2 changes: 1 addition & 1 deletion ci/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ docker run \
<<\EOF
apt-get update
apt-get install -y gcc g++ cmake git wget file curl
apt-get install -y gcc g++ ninja-build cmake git wget file curl
bash -euxo pipefail ci/build-appimage.sh
Expand Down

0 comments on commit 92439fe

Please sign in to comment.