From 6bc073976a0bb055bc2c1ff28d5ae5c0686a6d3b Mon Sep 17 00:00:00 2001 From: Phillip Smith Date: Tue, 30 Apr 2013 09:10:08 +1000 Subject: [PATCH] makepkg: add support for CARCH environment var Add support for overriding configuration in /etc/makepkg.conf and ~/.makepkg.conf by setting the environment variable CARCH similar to how SRCDEST and PKGDEST behave. --- doc/makepkg.8.txt | 4 ++++ scripts/makepkg.sh.in | 2 ++ 2 files changed, 6 insertions(+) diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt index ecee63a..5716202 100644 --- a/doc/makepkg.8.txt +++ b/doc/makepkg.8.txt @@ -223,6 +223,10 @@ Environment Variables Folder where the package will be built. Overrides the corresponding value defined in linkman:makepkg.conf[5]. +**CARCH=**"(i686|x86_64)":: + Force build for a specific architecture. Useful for cross-compiling. + Overrides the corresponding value defined in linkman:makepkg.conf[5]. + Configuration ------------- See linkman:makepkg.conf[5] for more details on configuring makepkg using the diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index da620a4..50bf41d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2604,6 +2604,7 @@ trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' E [[ -n ${SRCEXT} ]] && _SRCEXT=${SRCEXT} [[ -n ${GPGKEY} ]] && _GPGKEY=${GPGKEY} [[ -n ${PACKAGER} ]] && _PACKAGER=${PACKAGER} +[[ -n ${CARCH} ]] && _CARCH=${CARCH} # default config is makepkg.conf MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf} @@ -2703,6 +2704,7 @@ PKGEXT=${_PKGEXT:-$PKGEXT} SRCEXT=${_SRCEXT:-$SRCEXT} GPGKEY=${_GPGKEY:-$GPGKEY} PACKAGER=${_PACKAGER:-$PACKAGER} +CARCH=${_CARCH:-$CARCH} if (( ! INFAKEROOT )); then if (( EUID == 0 && ! ASROOT )); then -- 1.8.2.1