Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/repo/arch32.sh33
-rw-r--r--src/lib/repo/clone.sh12
-rw-r--r--src/lib/valid-tags.sh7
3 files changed, 50 insertions, 2 deletions
diff --git a/src/lib/repo/arch32.sh b/src/lib/repo/arch32.sh
new file mode 100644
index 0000000..3ee248e
--- /dev/null
+++ b/src/lib/repo/arch32.sh
@@ -0,0 +1,33 @@
+# does local adaptions needed to build for Archlinux32
+pkgctl_repo_patch_arch32() {
+ local pkgname="$1"
+
+ # 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
+
+ # extend architecture with our architecture
+ awk -i inplace '!/^arch=[^#]*any/ {gsub(/^arch=\(/,"arch=(i486 i686 pentium4 ")}; {print}' \
+ "${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
+ # 'build-support')
+ listfile=$(mktemp --tmpdir="${WORKDIR}" pkgctl-arch32.XXXXXXXXXX)
+ >"${listfile}"
+ for repo in core extra build-support; do
+ git -C "${pkgname}" ls-tree -r --name-only archlinux32/master "${repo}/${pkgname}" >>"${listfile}"
+ done
+ for file in $(cat "${listfile}"); do
+ if [[ "${file##*/}" = "PKGBUILD" ]]; then
+ if [ -f "${pkgname}/PKGBUILD" ]; then
+ printf "\n\n# -- Arch32 specific --\n\n" >> "${pkgname}/PKGBUILD"
+ git -C "${pkgname}" show archlinux32/master:"${file}" >> "${pkgname}/PKGBUILD"
+ else
+ git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/PKGBUILD"
+ fi
+ else
+ git -C "${pkgname}" show archlinux32/master:"${file}" > "${pkgname}/${file##*/}"
+ fi
+ done
+}
diff --git a/src/lib/repo/clone.sh b/src/lib/repo/clone.sh
index ef6a0e2..33a333f 100644
--- a/src/lib/repo/clone.sh
+++ b/src/lib/repo/clone.sh
@@ -16,6 +16,8 @@ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/api/gitlab.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/configure.sh
# shellcheck source=src/lib/util/git.sh
source "${_DEVTOOLS_LIBRARY_DIR}"/lib/util/git.sh
+# shellcheck source=src/lib/repo/arch32.sh
+source "${_DEVTOOLS_LIBRARY_DIR}"/lib/repo/arch32.sh
source /usr/share/makepkg/util/message.sh
@@ -40,6 +42,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
@@ -63,6 +66,7 @@ pkgctl_repo_clone() {
local MAINTAINER=
local VERSION=
local CONFIGURE_OPTIONS=()
+ local ARCH32=0
local jobs=
jobs=$(nproc)
@@ -124,6 +128,10 @@ pkgctl_repo_clone() {
jobs=$2
shift 2
;;
+ --arch32)
+ ARCH32=1
+ shift
+ ;;
--)
shift
break
@@ -194,5 +202,9 @@ pkgctl_repo_clone() {
if [[ -n "${VERSION}" ]]; then
pkgctl_repo_switch "${VERSION}" "${pkgbase}"
fi
+
+ if (( ARCH32 )); then
+ pkgctl_repo_patch_arch32 "${pkgbase}"
+ fi
done
}
diff --git a/src/lib/valid-tags.sh b/src/lib/valid-tags.sh
index cef0cc6..abca7ef 100644
--- a/src/lib/valid-tags.sh
+++ b/src/lib/valid-tags.sh
@@ -4,13 +4,16 @@
:
# shellcheck disable=2034
-DEVTOOLS_VALID_ARCHES=(
+_arch=(
+ pentium4
+ i686
+ i486
x86_64
any
)
# shellcheck disable=2034
-DEVTOOLS_VALID_TAGS=(
+_tags=(
core-x86_64 core-any
core-staging-x86_64 core-staging-any
core-testing-x86_64 core-testing-any