Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-03-08 11:53:41 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2024-03-08 11:53:41 +0100
commit5d63dda662fe4ac5f6b0bf176f4a978c5bbc7a9a (patch)
tree64b9349af703b57e6b63acc266db5c52556008f9 /src
parent03386c76dff8e133da109c13e1d648682b64b139 (diff)
added more arch32 specific PKGBUILD patching
Diffstat (limited to 'src')
-rw-r--r--src/lib/repo/arch32.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/lib/repo/arch32.sh b/src/lib/repo/arch32.sh
index 3ee248e..7bdf628 100644
--- a/src/lib/repo/arch32.sh
+++ b/src/lib/repo/arch32.sh
@@ -1,14 +1,55 @@
# does local adaptions needed to build for Archlinux32
+# (this should be held in sync with builder/lib/common-functions mangle_pkgbuild)
+#
+# mangle_pkgbuild $PKGBUILD [$sub_pkgrel]
+#
+# append $sub_pkgrel to the pkgrel
+# remove $pkgrel from {make,check,opt,}depends
pkgctl_repo_patch_arch32() {
local pkgname="$1"
+
+ #~ local PKGBUILD="$1"
+ #~ local sub_pkgrel="$2"
# add the remote branch with our patches
git -C "${pkgname}" remote add -m master archlinux32 git://git.archlinux32.org/packages
git -C "${pkgname}" fetch --depth 1 archlinux32
+ #~ if [ -n "${sub_pkgrel}" ]; then
+ #~ sub_pkgrel=".${sub_pkgrel}"
+ #~ fi
+
# extend architecture with our architecture
awk -i inplace '!/^arch=[^#]*any/ {gsub(/^arch=\(/,"arch=(i486 i686 pentium4 ")}; {print}' \
"${pkgname}/PKGBUILD"
+
+ #~ if grep -q '^\s*pkgname=["'"'"']\?lib32-' "${pkgname}/${PKGBUILD}"; then
+ #~ sed -i '
+ #~ s/^\(\s*pkgrel=\)['"'"'"]\?\([0-9]\+\)\.[0-9]*['"'"'"]\?\s*\(#.*\)\?$/\1"\2"/
+ #~ ' "${pkgname}/PKGBUILD"
+ #~ fi
+
+ #~ sed -i '
+ #~ s/^\(\s*pkgrel=\)['"'"'"]\?\([0-9]\+\)\(\.[0-9.]*\)\?['"'"'"]\?\s*\(#.*\)\?$/\1"\2'"${sub_pkgrel:-\\3}"'"/
+ #~ ' "${pkgname}/PKGBUILD"
+
+ # remove "lib32-" and "gcc-multilib" from {make,check,opt,}depends
+ # shellcheck disable=SC2016
+ sed -i '
+ /^\s*\(make\|check\|opt\|\)depends\(_[^=[:space:]]\+\)\?=(/ {
+ :a
+ /^\s*\(\S[^=]*\)=(\(\([^()"'"'"']\|"[^"]*"\|['"'"'][^'"'"']*['"'"']\s*\)*\(#[^\n]*\n\)\?\)*)/! {
+ $b
+ N
+ ba
+ }
+ :b
+ s/\(=.*["'"'"'([:space:]]\)lib32-/\1/g
+ s/\(=.*["'"'"'([:space:]]\)gcc-multilib\(["'"'"')[:space:]]\)/\1gcc\2/g
+ s/\(=.*["'"'"'([:space:]][^[:space:]$]\+[<=>]\S\+\)-[^:"'"'"')[:space:]]\+\([:"'"'"')[:space:]]\)/\1\2/g
+ tb
+ }
+ ' "${pkgname}/PKGBUILD"
# iterate the arch32 diffs in the archlinux32/master branch (we don't know
# the destination repo, so we just scan both 'core' and 'extra' as well as