Compare commits

...

3 Commits

Author SHA1 Message Date
27e99a32cd add zsh sourcing script 2026-02-22 22:17:35 -05:00
3d67fe8d6e minor cleanup 2026-01-17 14:23:41 -05:00
1e047e2ba2 Add SKIP_NATIVE to skip building for native
* remove tail
* DEBUG_SHELL: pause before copying
2026-01-17 12:01:35 -05:00
3 changed files with 51 additions and 9 deletions

41
aur.sh Normal file
View File

@@ -0,0 +1,41 @@
# shellcheck shell=bash
aur_build() {
local args=()
while [[ $# -gt 0 ]]; do
case $1 in
--debug) args+=("-e" "DEBUG_SHELL=y") ;;
--skip-native) args+=("-e" "SKIP_NATIVE=y") ;;
*)
echo "Unknown option: $1"
return 1
;;
esac
shift
done
podman run --pull newer --rm -it "${args[@]}" -v "$PWD:/w" gitea.balki.me/balki/aur_builder:latest
}
_aur_build() {
local -a flags
flags=(
'--debug:pause in a debug bash shell'
'--skip-native:do not force native architecture'
)
_describe 'flags' flags
}
compdef _aur_build aur_build
aur_upload() {
curl --user "balki:${ARCH_REPO_TOKEN?token missing}" \
--upload-file "${1?package file missing}" \
https://gitea.balki.me/api/packages/balki-aur/arch/balki-aur
}
compdef '_files -g "*.pkg.tar.zst"' aur_upload
zstyle ':completion:*:*:aur_upload:*' file-sort modification
# vim: set filetype=zsh:

View File

@@ -10,5 +10,7 @@ done
# Enables all extra features supported by host CPU
CFLAGS="$CFLAGS -march=native -mtune=native"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
if [ "${SKIP_NATIVE-n}" = n ]; then
CFLAGS="$CFLAGS -march=native -mtune=native"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
fi

13
run.sh
View File

@@ -3,11 +3,11 @@
set -xeuo pipefail
if [[ ! -f /w/PKGBUILD ]]; then
echo "Missing PKGBUILD in /w"
exit 1
echo "Missing PKGBUILD in /w"
exit 1
fi
# /etc/hosts is managed by podman. Copying or editing with `sed -i` does not seem to work. Only appendig works
# /etc/hosts is managed by podman. Copying or editing with `sed -i` does not seem to work. Only appending works
# podman sets up 169.254.1.2 to be the ip of the host
sudo sh -c 'echo "100.64.0.2 archmirror.i.balki.me" >> /etc/hosts'
sudo sh -c 'echo "100.64.0.2 gitea.balki.me" >> /etc/hosts'
@@ -19,8 +19,7 @@ cp -r /w .
cd ./w
if [ "${DEBUG_SHELL-n}" = y ]; then
echo "Stopping before build... Run 'exit 1' to skip building"
tail -12 "$0"
echo "$0 : Stopping before build... Run 'exit 1' to skip building"
bash
fi
@@ -34,9 +33,9 @@ fi
LOGDEST=../output PKGDEST=../output makepkg --syncdeps --log
sudo cp -r ../output /w
if [ "${DEBUG_SHELL-n}" = y ]; then
echo "Build complete"
bash
fi
sudo cp -r ../output /w