-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As a consequence of bionic having gone end-of-life, we move to using Debian oldstable as a consequence. This also required changes to prebuilt-cmake, which now supports a lot more distros for all of x86_64, i386, armhf and aarch64.
- Loading branch information
1 parent
e57e1fc
commit 5731f09
Showing
7 changed files
with
98 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ARG DOCKER_ARCH | ||
|
||
# current Debian oldstable as of Dec 2023 | ||
# we use Debian because they still provide i386 builds | ||
FROM ${DOCKER_ARCH}/debian:bullseye | ||
|
||
ARG ARCH | ||
ARG DOCKER_ARCH | ||
ARG CMAKE_ARCH | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
gcc g++ make libxpm-dev git libcurl4-openssl-dev libssl-dev wget zlib1g-dev libc6-dev bsdmainutils pkgconf libgcrypt20-dev ca-certificates file libglib2.0-0 | ||
|
||
RUN wget https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.28.0-debian-bullseye-${CMAKE_ARCH}.tar.gz -O- | \ | ||
tar xz -C /usr/local --strip-components=1 | ||
|
||
COPY ./install-gtest.sh / | ||
RUN bash /install-gtest.sh | ||
|
||
COPY libgcrypt.pc /usr/lib/i386-linux-gnu/pkgconfig/libgcrypt.pc | ||
RUN triplet="$(find /usr/lib/ -maxdepth 1 -type d -iname '*-linux-gnu*' | head -n1 | rev | cut -d/ -f1 | rev)" && \ | ||
sed -i "s|x86_64-linux-gnu|${triplet}|g" /usr/lib/*/pkgconfig/libgcrypt.pc | ||
|
||
# work around bug in FindCURL.cmake, which does not parse the pkg-config provided protocols and features into lists causing | ||
# the comparison in the loop to yield false negative results | ||
# this makes it use curl-config which works much better | ||
RUN rm /usr/lib/*/pkgconfig/libcurl.pc | ||
|
||
ENV APPIMAGE_EXTRACT_AND_RUN=1 | ||
|
||
ENV ARCH=${ARCH} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,64 @@ | ||
#! /bin/bash | ||
|
||
if [[ "$DIST" == "" ]] || [[ "$ARCH" == "" ]]; then | ||
echo "Usage: env ARCH=... DIST=... bash $0" | ||
if [[ "$ARCH" == "" ]]; then | ||
echo "Usage: env ARCH=... bash $0" | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
set -x | ||
set -euxo pipefail | ||
|
||
case "$ARCH" in | ||
x86_64) | ||
DOCKER_ARCH=amd64 | ||
;; | ||
i686) | ||
CMAKE_ARCH=i386 | ||
DOCKER_ARCH=i386 | ||
;; | ||
armhf) | ||
DOCKER_ARCH=arm32v7 | ||
;; | ||
aarch64) | ||
DOCKER_ARCH=arm64v8 | ||
;; | ||
*) | ||
echo "Unsupported architecture: $ARCH" | ||
exit 2 | ||
esac | ||
|
||
CMAKE_ARCH="${CMAKE_ARCH:-"$ARCH"}" | ||
|
||
cwd="$PWD" | ||
repo_root="$(readlink -f "$(dirname "$0")"/..)" | ||
repo_root="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)" | ||
|
||
# needed to keep user ID in and outside Docker in sync to be able to write to workspace directory | ||
uid="$(id -u)" | ||
image=zsync2-build:"$DIST"-"$ARCH"-uid"$uid" | ||
dockerfile=Dockerfile."$DIST"-"$ARCH" | ||
|
||
if [ ! -f "$repo_root"/ci/"$dockerfile" ]; then | ||
echo "Error: $dockerfile could not be found" | ||
exit 1 | ||
fi | ||
image=zsync2-build:"$ARCH" | ||
|
||
# building local image to "cache" installed dependencies for subsequent builds | ||
docker build -t "$image" -f "$repo_root"/ci/"$dockerfile" --build-arg UID="$uid" "$repo_root"/ci | ||
docker build \ | ||
"${tty_args[@]}" \ | ||
-t "$image" \ | ||
--build-arg ARCH="$ARCH" \ | ||
--build-arg DOCKER_ARCH="$DOCKER_ARCH" \ | ||
--build-arg CMAKE_ARCH="$CMAKE_ARCH" \ | ||
"$repo_root"/ci | ||
|
||
tty_args=() | ||
if [ -t 0 ]; then tty_args+=("-t"); fi | ||
|
||
# mount workspace read-only, trying to make sure the build doesn't ever touch the source code files | ||
# of course, this only works reliably if you don't run this script from that directory | ||
# but it's still not the worst idea to do so | ||
docker run --rm -i -e CI=1 -e GITHUB_RUN_NUMBER -v "$repo_root":/ws:ro -v "$cwd":/out "$image" \ | ||
bash -xec 'cd /out && bash -xe /ws/ci/build-appimages.sh' | ||
docker run \ | ||
--rm \ | ||
-i \ | ||
"${tty_args[@]}" \ | ||
-e CI=1 \ | ||
-e GITHUB_RUN_NUMBER \ | ||
-v "$repo_root":/ws:ro \ | ||
-v "$cwd":/out \ | ||
-w /out \ | ||
--user "$uid" \ | ||
"$image" \ | ||
bash /ws/ci/build-appimages.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters