Skip to content

Commit

Permalink
Add support for ARM architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Dec 13, 2024
1 parent 352d963 commit 69b0bc0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ARCH: [x86_64, i386]
ARCH: [x86_64, i386, aarch64, armhf]

name: AppImage ${{ matrix.ARCH }}
runs-on: ubuntu-20.04
Expand Down
20 changes: 10 additions & 10 deletions ci/build-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ 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

cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}"
case "$ARCH" in
x86_64|i386|aarch64|armhf)
;;
*)
echo "Architecture not supported: $ARCH" 1>&2
exit 1
;;
esac

cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

make -j$(nproc)

Expand Down
10 changes: 3 additions & 7 deletions ci/build-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,15 @@ fi

case "$ARCH" in
x86_64)
image_prefix=amd64
platform=linux/amd64
;;
i386)
image_prefix=i386
platform=linux/i386
;;
armhf)
image_prefix=arm32v7
platform=linux/arm/v7
;;
aarch64)
image_prefix=arm64v8
platform=linux/arm64/v8
;;
*)
Expand All @@ -30,7 +26,7 @@ case "$ARCH" in
;;
esac

image="$image_prefix"/debian:stable
image=debian:stable

repo_root="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)"

Expand All @@ -40,7 +36,7 @@ repo_root="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)"
uid="$(id -u)"

# make sure Docker image is up to date
docker pull "$image"
docker pull --platform "$platform" "$image"

docker run \
--platform "$platform" \
Expand All @@ -59,7 +55,7 @@ docker run \
<<\EOF
apt-get update
apt-get install -y gcc g++ cmake git wget file curl
apt-get install -y gcc g++ cmake git wget file curl ninja-build
bash -euxo pipefail ci/build-appimage.sh
Expand Down
5 changes: 0 additions & 5 deletions cmake/toolchains/i386-linux-gnu.cmake

This file was deleted.

0 comments on commit 69b0bc0

Please sign in to comment.