You've already forked aur_builder
Compare commits
3 Commits
2e7e85b81c
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 27e99a32cd | |||
| 3d67fe8d6e | |||
| 1e047e2ba2 |
41
aur.sh
Normal file
41
aur.sh
Normal 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:
|
||||||
@@ -10,5 +10,7 @@ done
|
|||||||
|
|
||||||
# Enables all extra features supported by host CPU
|
# Enables all extra features supported by host CPU
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -march=native -mtune=native"
|
if [ "${SKIP_NATIVE-n}" = n ]; then
|
||||||
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
CFLAGS="$CFLAGS -march=native -mtune=native"
|
||||||
|
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
||||||
|
fi
|
||||||
|
|||||||
13
run.sh
13
run.sh
@@ -3,11 +3,11 @@
|
|||||||
set -xeuo pipefail
|
set -xeuo pipefail
|
||||||
|
|
||||||
if [[ ! -f /w/PKGBUILD ]]; then
|
if [[ ! -f /w/PKGBUILD ]]; then
|
||||||
echo "Missing PKGBUILD in /w"
|
echo "Missing PKGBUILD in /w"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# 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 archmirror.i.balki.me" >> /etc/hosts'
|
||||||
sudo sh -c 'echo "100.64.0.2 gitea.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
|
cd ./w
|
||||||
|
|
||||||
if [ "${DEBUG_SHELL-n}" = y ]; then
|
if [ "${DEBUG_SHELL-n}" = y ]; then
|
||||||
echo "Stopping before build... Run 'exit 1' to skip building"
|
echo "$0 : Stopping before build... Run 'exit 1' to skip building"
|
||||||
tail -12 "$0"
|
|
||||||
bash
|
bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -34,9 +33,9 @@ fi
|
|||||||
|
|
||||||
LOGDEST=../output PKGDEST=../output makepkg --syncdeps --log
|
LOGDEST=../output PKGDEST=../output makepkg --syncdeps --log
|
||||||
|
|
||||||
sudo cp -r ../output /w
|
|
||||||
|
|
||||||
if [ "${DEBUG_SHELL-n}" = y ]; then
|
if [ "${DEBUG_SHELL-n}" = y ]; then
|
||||||
echo "Build complete"
|
echo "Build complete"
|
||||||
bash
|
bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo cp -r ../output /w
|
||||||
|
|||||||
Reference in New Issue
Block a user