summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorQue Quotion <quequotion@gmail.com>2018-11-27 18:23:02 +0900
committerAllan McRae <allan@archlinux.org>2018-11-27 22:48:43 +1000
commit508b4e3ec0cb3e365942f4dc0626edda4789932b (patch)
treed47fd87b0ba310da989e45423180c4fda2610957 /scripts/makepkg.sh.in
parent0bb04fa16a82db133dd010478c1256bc8500c5e7 (diff)
downloadpacman-508b4e3ec0cb3e365942f4dc0626edda4789932b.tar.xz
Split prepare_buildenv() to libmakepkg
This opens the door for third parties to provide libmakepkg extentions for the purpose of altering the build environment. Signed-off-by: Que Quotion <quequotion@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in44
1 files changed, 1 insertions, 43 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d92e4aac..4449ccf7 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -48,11 +48,10 @@ declare -r startdir="$(pwd -P)"
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
-build_options=('ccache' 'distcc' 'buildflags' 'makeflags')
splitpkg_overrides=('pkgdesc' 'arch' 'url' 'license' 'groups' 'depends'
'optdepends' 'provides' 'conflicts' 'replaces' 'backup'
'options' 'install' 'changelog')
-readonly -a build_options splitpkg_overrides
+readonly -a splitpkg_overrides
known_hash_algos=('md5' 'sha1' 'sha224' 'sha256' 'sha384' 'sha512')
@@ -380,47 +379,6 @@ source_buildfile() {
source_safe "$@"
}
-prepare_buildenv() {
- # clear user-specified buildflags if requested
- if check_option "buildflags" "n"; then
- unset CPPFLAGS CFLAGS DEBUG_CFLAGS CXXFLAGS DEBUG_CXXFLAGS LDFLAGS
- fi
-
- if check_option "debug" "y"; then
- DEBUG_CFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
- DEBUG_CXXFLAGS+=" -fdebug-prefix-map=$srcdir=${DBGSRCDIR:-/usr/src/debug}"
- CFLAGS+=" $DEBUG_CFLAGS"
- CXXFLAGS+=" $DEBUG_CXXFLAGS"
- fi
-
- # clear user-specified makeflags if requested
- if check_option "makeflags" "n"; then
- unset MAKEFLAGS
- fi
-
- # ensure all necessary build variables are exported
- export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS CHOST
-
- local ccache=0
-
- # use ccache if it is requested (check buildenv and PKGBUILD opts)
- if check_buildoption "ccache" "y" && [[ -d /usr/lib/ccache/bin ]]; then
- export PATH="/usr/lib/ccache/bin:$PATH"
- ccache=1
- fi
-
- # use distcc if it is requested (check buildenv and PKGBUILD opts)
- if check_buildoption "distcc" "y"; then
- if (( ccache )); then
- export CCACHE_PREFIX="${CCACHE_PREFIX:+$CCACHE_PREFIX }distcc"
- export CCACHE_BASEDIR="$srcdir"
- elif [[ -d /usr/lib/distcc/bin ]]; then
- export PATH="/usr/lib/distcc/bin:$PATH"
- fi
- export DISTCC_HOSTS
- fi
-}
-
run_function_safe() {
local restoretrap restoreshopt