index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Andreas Baumann <mail@andreasbaumann.cc> | 2023-06-08 12:04:12 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2023-06-08 12:04:12 +0200 |
commit | 249205486a837399b9675cb5fc93de8588e83523 (patch) | |
tree | 7c3393b716cb578012ad9cbfb702cdba0eed17ea | |
parent | ad30dbfa9d70185f67d29b87ae5b59bb3b97cc45 (diff) |
-rw-r--r-- | src/lib/repo/arch32.sh | 10 | ||||
-rw-r--r-- | src/lib/repo/clone.sh | 12 |
diff --git a/src/lib/repo/arch32.sh b/src/lib/repo/arch32.sh new file mode 100644 index 0000000..5f7c5c5 --- /dev/null +++ b/src/lib/repo/arch32.sh @@ -0,0 +1,10 @@ +pkgctl_repo_patch_arch32() { + local pkgname="$1" + + # add the remote branch with our patches + git -C "${pkgname}" remote add -m master archlinux32 https://git.archlinux32.org/packages/ + + # extend architecture with our architecture + awk -i inplace '!/^arch=[^#]*any/ {gsub(/^arch=\(/,"arch=(i486 i686 pentium4 ")}; {print}' \ + "${pkgname}/PKGBUILD" +}
\ No newline at end of file diff --git a/src/lib/repo/clone.sh b/src/lib/repo/clone.sh index 08bded4..58fd1ff 100644 --- a/src/lib/repo/clone.sh +++ b/src/lib/repo/clone.sh @@ -12,6 +12,8 @@ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/common.sh source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh # shellcheck source=src/lib/repo/configure.sh source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/configure.sh +# shellcheck source=src/lib/repo/arch32.sh +source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/arch32.sh source /usr/share/makepkg/util/message.sh @@ -35,6 +37,7 @@ pkgctl_repo_clone_usage() { --protocol https Clone the repository over https --switch VERSION Switch the current working tree to a specified version --universe Clone all existing packages, useful for cache warming + --arch32 Make all required modifications to build on Archlinux32 -j, --jobs N Run up to N jobs in parallel (default: $(nproc)) -h, --help Show this help text @@ -57,6 +60,7 @@ pkgctl_repo_clone() { local MAINTAINER= local VERSION= local CONFIGURE_OPTIONS=() + local ARCH32=0 local jobs= jobs=$(nproc) @@ -116,6 +120,10 @@ pkgctl_repo_clone() { jobs=$2 shift 2 ;; + --arch32) + ARCH32=1 + shift + ;; --) shift break @@ -195,5 +203,9 @@ pkgctl_repo_clone() { if [[ -n "${VERSION}" ]]; then pkgctl_repo_switch "${VERSION}" "${pkgbase}" fi + + if (( ARCH32 )); then + pkgctl_repo_patch_arch32 "${pkgbase}" + fi done } |