qports/.forgejo/patches/build.patch

82 lines
2.4 KiB
Diff
Raw Normal View History

2024-08-16 01:59:24 +00:00
diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh
old mode 100644
new mode 100755
2024-08-16 04:16:21 +00:00
index c3b8f7a..2d09c31
2024-08-16 01:59:24 +00:00
--- a/usr/local/bin/build.sh.orig
+++ b/usr/local/bin/build.sh
2024-08-16 04:16:21 +00:00
@@ -7,13 +7,14 @@
2024-08-16 01:59:24 +00:00
set -eu -o pipefail
readonly APORTSDIR=$CI_PROJECT_DIR
-readonly REPOS="main community testing non-free"
+readonly ALPINE_REPOS="main community testing"
readonly ARCH=$(apk --print-arch)
# gitlab variables
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
: "${REPODEST:=$HOME/packages}"
-: "${MIRROR:=https://dl-cdn.alpinelinux.org/alpine}"
2024-08-16 02:09:53 +00:00
+: "${MIRROR:=https://ayakael.net/api/packages/forge/alpine}"
2024-08-16 01:59:24 +00:00
+: "${ALPINE_MIRROR:=http://dl-cdn.alpinelinux.org/alpine}"
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
: "${CI_DEBUG_BUILD:=}"
2024-08-16 04:16:21 +00:00
@@ -67,13 +68,23 @@ report() {
2024-08-16 01:59:24 +00:00
}
get_release() {
2024-08-16 04:16:21 +00:00
+ echo $(grep PRETTY_NAME /etc/os-release | awk '{print $3}' | tr -d '"')
2024-08-16 01:59:24 +00:00
+}
+
2024-08-16 04:16:21 +00:00
+readonly REPOS="qubes-$(get_release)"
+
2024-08-16 01:59:24 +00:00
+get_qubes_release() {
case $BASEBRANCH in
- *-stable) echo v"${BASEBRANCH%-*}";;
- master) echo edge;;
- *) die "Branch \"$BASEBRANCH\" not supported!"
+ r*) echo $BASEBRANCH;;
+ main) echo r4.3;;
esac
}
+# hack to support at-root packages
2024-08-16 04:17:23 +00:00
+changed_repos() {
2024-08-16 01:59:24 +00:00
+ echo "."
2024-08-16 04:17:23 +00:00
+}
2024-08-16 01:59:24 +00:00
+
build_aport() {
local repo="$1" aport="$2"
cd "$APORTSDIR/$repo/$aport"
2024-08-16 04:16:21 +00:00
@@ -101,11 +112,11 @@ set_repositories_for() {
2024-08-16 01:59:24 +00:00
release=$(get_release)
for repo in $REPOS; do
[ "$repo" = "non-free" ] && continue
- [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue
repos="$repos $MIRROR/$release/$repo $REPODEST/$repo"
[ "$repo" = "$target_repo" ] && break
done
- doas sh -c "printf '%s\n' $repos > /etc/apk/repositories"
+ doas sh -c "printf '%s\n' $repos >> /etc/apk/repositories"
doas apk update
}
2024-08-16 04:16:21 +00:00
@@ -118,7 +129,15 @@ apply_offset_limit() {
2024-08-16 01:59:24 +00:00
}
setup_system() {
- doas sh -c "echo $MIRROR/$(get_release)/main > /etc/apk/repositories"
+ local repos='' repo=''
+ local release
+
+ release=$(get_release)
+ for repo in $ALPINE_REPOS; do
+ [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
+ repos="$repos $ALPINE_MIRROR/$release/$repo"
+ done
+ doas sh -c "printf '%s\n' $repos > /etc/apk/repositories"
doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system"
abuild-keygen -ain
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf