abr: only export when defined, cleanup sccache

This commit is contained in:
psykose 2023-03-26 09:46:43 +00:00
parent e47b48ea7b
commit f979ec7015
2 changed files with 24 additions and 20 deletions

View file

@ -1,6 +1,6 @@
# Maintainer: psykose <alice@ayaya.dev>
pkgname=abr
pkgver=1
pkgver=2
pkgrel=0
pkgdesc="abr~!"
url="https://git.ddd.rip/ptrcnull/aports"
@ -40,6 +40,6 @@ package() {
}
sha512sums="
1a01d9a9cc3fd29622c803193e7b60c4c5855a65db786cb5d826fdd03a2ab071baff70a6bf01d7cd82e2c638a0691700e7810dca070b30071a0ad4066bc73b13 abr
77ce846c861098f4a3da15768be1aba6ae4a87dbbddca0146f55b2f6c933b05c6891a649db073f49f4fa33c1e083660a61b54aabbc8b548ebbdacb3b9a385568 abr
71d8cb1e5e57ff739915fa4de1f5699afa60ab36e2e5219c4c366af5ceab24dc6ee55e738d29ca2b63dd5e387de7661594fc86bf2183d787932e75b4c03c6a9f apkbuild-anitya
"

40
abr/abr
View file

@ -1,25 +1,26 @@
#!/bin/sh -e
# clean self and do not pass through any environment
# except env, because it doesn't matter too much for this specific purpose
# except path/home, because it doesn't matter too much for this specific purpose,
# and home is required
# and a few that are useful to keep some cache paths
if [ -z "$_CLEAN" ]; then
exec env -i \
_CLEAN=1 \
CARGO_HOME="$CARGO_HOME" \
GNUPGHOME="$GNUPGHOME" \
GOCACHE="$GOCACHE" \
GOMODCACHE="$GOMODCACHE" \
GOPATH="$GOPATH" \
GOTMPDIR="$GOTMPDIR" \
HOME="$HOME" \
PATH="$PATH" \
XDG_CACHE_HOME="$XDG_CACHE_HOME" \
XDG_CONFIG_HOME="$XDG_CONFIG_HOME" \
${CARGO_HOME:+CARGO_HOME="$CARGO_HOME"} \
${GNUPGHOME:+GNUPGHOME="$GNUPGHOME"} \
${GOCACHE:+GOCACHE="$GOCACHE"} \
${GOMODCACHE:+GOMODCACHE="$GOMODCACHE"} \
${GOPATH:+GOPATH="$GOPATH"} \
${GOTMPDIR:+GOTMPDIR="$GOTMPDIR"} \
${XDG_CACHE_HOME:+XDG_CACHE_HOME="$XDG_CACHE_HOME"} \
${XDG_CONFIG_HOME:+XDG_CONFIG_HOME="$XDG_CONFIG_HOME"} \
"$0" "$@"
fi
while getopts "j:fmnx" opt; do
while getopts "j:fmnsx" opt; do
case "$opt" in
'j')
jobs="$OPTARG"
@ -42,6 +43,9 @@ while getopts "j:fmnx" opt; do
'n')
nonice=1
;;
's')
nosccache=1
;;
'x')
# skip checks
export ABUILD_BOOTSTRAP=1
@ -56,18 +60,18 @@ shift "$((OPTIND - 1))"
# loop again to check if rootbld
for arg; do
if eltest "${arg:-x}" =~ "rootbld"; then
# not available in rootbld
nosccache=1
if eltest "$arg" =~ "rootbld" || [ -n "$nosccache" ]; then
# pointless in rootbld
# TODO: maybe we can mount something into rootbld without patches
:
else
extra="$extra sccache"
export RUSTC_WRAPPER=sccache
fi
done
if [ -z "$nosccache" ]; then
export RUSTC_WRAPPER=sccache
fi
if [ -z "$nomemhack" ]; then
extra="scudo-malloc"
extra="$extra scudo-malloc"
export LD_PRELOAD="/usr/lib/libscudo.so"
fi