Skip to content

Commit 740b7c1

Browse files
committed
Fix Docker builds and add ARM support
1 parent d08e085 commit 740b7c1

File tree

6 files changed

+97
-124
lines changed

6 files changed

+97
-124
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
ARCH: [x86_64, i386]
10+
ARCH: [x86_64, i686, aarch64, armhf]
1111

1212
name: AppImage ${{ matrix.ARCH }}
1313
runs-on: ubuntu-latest

ci/Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# current Debian oldstable as of Dec 2023
2+
# we use Debian because they still provide i386 builds
3+
# (also, they ship Qt 5.15.2, so we no longer have to rely on third-party builds)
4+
# and it provides a C++17 compatible compiler out of the box!
5+
FROM debian:bullseye
6+
7+
ARG ARCH
8+
ARG DOCKER_ARCH
9+
ARG CMAKE_ARCH
10+
ENV ARCH=${ARCH} DOCKER_ARCH=${DOCKER_ARCH} CMAKE_ARCH=${CMAKE_ARCH}
11+
12+
ENV DEBIAN_FRONTEND=noninteractive
13+
14+
RUN apt-get update && \
15+
apt-get install -y qtbase5-dev qttools5-dev-tools qtwayland5-dev-tools qtwayland5-private-dev \
16+
libgl1 libdrm-dev mesa-common-dev \
17+
build-essential libssl-dev autoconf automake libtool \
18+
wget vim-common desktop-file-utils pkgconf libgpgme-dev \
19+
libglib2.0-dev libcairo2-dev librsvg2-dev libfuse-dev git libcurl4-openssl-dev argagg-dev libgcrypt20-dev libboost-dev \
20+
liblzma-dev libzstd-dev zlib1g-dev libarchive-dev
21+
22+
RUN wget -qO- https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.28.0-debian-bullseye-"${CMAKE_ARCH}".tar.gz | \
23+
tar xzv -C/usr --strip-components=1
24+
25+
COPY ./install-gtest.sh /
26+
RUN bash /install-gtest.sh
27+
28+
COPY pkgconfig/*.pc /
29+
RUN mv /*.pc /usr/lib/*-linux-gnu*/pkgconfig/
30+
31+
ENV APPIMAGE_EXTRACT_AND_RUN=1
32+
33+
ENV DOCKER=1
34+
35+
#RUN git clone https://github.com/nlohmann/json.git -b v3.11.2 --depth=1 && \
36+
# cd json && \
37+
# mkdir build && \
38+
# cd build && \
39+
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && \
40+
# make -j "$(nproc --ignore=1)" install && \
41+
# cd ../.. && \
42+
# rm -rf json/
43+
44+
RUN apt-get update && apt-get install -y nlohmann-json3-dev
45+
46+
# work around bug in FindCURL.cmake, which does not parse the pkg-config provided protocols and features into lists causing
47+
# the comparison in the loop to yield false negative results
48+
# this makes it use curl-config which works much better
49+
RUN rm /usr/lib/*-linux-gnu*/pkgconfig/libcurl.pc

ci/Dockerfile.i386

Lines changed: 0 additions & 52 deletions
This file was deleted.

ci/Dockerfile.x86_64

Lines changed: 0 additions & 48 deletions
This file was deleted.

ci/build-in-docker.sh

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,67 @@
11
#! /bin/bash
22

3-
if [[ "$DIST" == "" ]] || [[ "$ARCH" == "" ]]; then
4-
echo "Usage: env ARCH=... DIST=... bash $0"
3+
if [[ "$ARCH" == "" ]]; then
4+
echo "Usage: env ARCH=... bash $0"
55
exit 1
66
fi
77

8-
set -e
9-
set -x
8+
set -euxo pipefail
9+
10+
case "$ARCH" in
11+
x86_64)
12+
docker_platform=linux/amd64
13+
;;
14+
i686)
15+
CMAKE_ARCH=i386
16+
docker_platform=linux/386
17+
;;
18+
armhf)
19+
docker_platform=linux/arm32/v7
20+
;;
21+
aarch64)
22+
docker_platform=linux/arm64/v8
23+
;;
24+
*)
25+
echo "Unsupported architecture: $ARCH"
26+
exit 2
27+
esac
28+
29+
CMAKE_ARCH="${CMAKE_ARCH:-"$ARCH"}"
1030

1131
cwd="$PWD"
1232
repo_root="$(readlink -f "$(dirname "$0")"/..)"
1333

1434
# needed to keep user ID in and outside Docker in sync to be able to write to workspace directory
15-
image=appimageupdate-build:"$DIST"-"$ARCH"
16-
dockerfile=Dockerfile."$ARCH"
17-
18-
if [ ! -f "$repo_root"/ci/"$dockerfile" ]; then
19-
echo "Error: $dockerfile could not be found"
20-
exit 1
21-
fi
35+
image=appimageupdate-build
2236

2337
# building local image to "cache" installed dependencies for subsequent builds
24-
docker build -t "$image" -f "$repo_root"/ci/"$dockerfile" --build-arg DIST="$DIST" "$repo_root"/ci
38+
docker build \
39+
--platform "$docker_platform" \
40+
-t "$image" \
41+
--build-arg ARCH="$ARCH" \
42+
--build-arg CMAKE_ARCH="$CMAKE_ARCH" \
43+
"$repo_root"/ci
2544

2645
# run the build with the current user to
2746
# a) make sure root is not required for builds
2847
# b) allow the build scripts to "mv" the binaries into the /out directory
2948
uid="$(id -u)"
49+
50+
tty_args=()
51+
if [ -t 0 ]; then tty_args+=("-t"); fi
52+
3053
# mount workspace read-only, trying to make sure the build doesn't ever touch the source code files
3154
# of course, this only works reliably if you don't run this script from that directory
3255
# but it's still not the worst idea to do so
33-
docker run --platform "$ARCH" \
34-
--user "$uid" --rm -i -e ARCH -e GITHUB_RUN_NUMBER -e CI=1 -v "$repo_root":/ws:ro -v "$cwd":/out "$image" \
35-
bash -xec 'cd /out && bash -xe /ws/ci/build-appimages.sh'
56+
docker run \
57+
--rm \
58+
-i \
59+
"${tty_args[@]}" \
60+
-e CI=1 \
61+
-e GITHUB_RUN_NUMBER \
62+
-v "$repo_root":/ws:ro \
63+
-v "$cwd":/out \
64+
-w /out \
65+
--user "$uid" \
66+
"$image" \
67+
bash /ws/ci/build-appimages.sh

ci/entrypoint.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)