From c94bfbaba3b9ec57ec4082b3476b2a34aa0b9a29 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 23 Feb 2007 19:51:24 +0000 Subject: Implementing feature request: * Added these three possible options (or !options, more likely), to the PKGBUILD possibilities: - ccache - distcc - makeflags * Removed the --noccache and -j flags from makepkg as their functionality is better used by adding the above options to a PKGBUILD- keep the functionality where it is needed. Testing would be appreciated, I didn't do much of that yet. --- doc/PKGBUILD.5 | 20 +++++++++++++++++--- doc/makepkg.8 | 8 -------- doc/makepkg.conf.5 | 3 +-- scripts/makepkg | 34 +++++++++++++++++++--------------- 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/doc/PKGBUILD.5 b/doc/PKGBUILD.5 index 34bdc263..747b9f15 100644 --- a/doc/PKGBUILD.5 +++ b/doc/PKGBUILD.5 @@ -59,7 +59,7 @@ multiple licenses are applicable for a package, list all of them: Specifies a special install script that is to be included in the package. This file should reside in the same directory as the \fB\*(PB\fP, and will be copied into the package by \fBmakepkg\fP. It does not need to be included in the -\fIsource\fP array. (e.g. \fBinstall=pkgname.install\fP) +\fIsource\fP array (e.g. \fBinstall=pkgname.install\fP). .TP .B source \fI(array)\fP @@ -99,8 +99,8 @@ one could install all KDE packages by installing the 'kde' group. .TP .B arch \fI(array)\fP -Defines on which architectures the given package is available. (e.g. -\fBarch=('i686' 'x86_64')\fP) +Defines on which architectures the given package is available (e.g. +\fBarch=('i686' 'x86_64')\fP). .TP .B backup \fI(array)\fP @@ -166,6 +166,20 @@ Leave libtool (.la) files in packages. Specify "!libtool" to remove them. .B emptydirs Leave empty directories in packages. .TP +.B ccache +Allow the use of \fBccache\fP during build. More useful in its negative form +"!ccache" with select packages that have problems building with \fBccache\fP. +.TP +.B distcc +Allow the use of \fBdistcc\fP during build. More useful in its negative form +"!distcc" with select packages that have problems building with \fBdistcc\fP. +.TP +.B makeflags +Allow the use of user-specific makeflags during build as specified in +\fBmakepkg.conf\fP. More useful in its negative form "!makeflags" with select +packages that have problems building with custom makeflags such as "-j2" (or +higher). +.TP .B force Force the package to be upgraded by a \fBpacman\fP system upgrade operation, even if the version number would normally not trigger such an upgrade. This is diff --git a/doc/makepkg.8 b/doc/makepkg.8 index 1a0a4eb5..22a39b47 100644 --- a/doc/makepkg.8 +++ b/doc/makepkg.8 @@ -32,10 +32,6 @@ build-time or run-time dependencies, it will look for the dependencies' them it will call \fBmakepkg\fP to build and install the missing dependencies. The child calls will be made with the \fB-b\fP and \fB-i\fP options. .TP -.B \-B, --noccache -Disable the use of \fBccache\fP during build (useful for select packages that -have problems with \fBccache\fP). -.TP .B \-c, --clean Clean up leftover work files and directories after a successful build. .TP @@ -72,10 +68,6 @@ Output syntax and command line options. .B \-i, --install Install or upgrade the package after a successful build using \fBpacman\fP. .TP -.B \-j \fIjobs\fP -Sets MAKEFLAGS="-j\fIjobs\fP" before building the package. This is useful for -overriding the \fIMAKEFLAGS\fP setting in \fBmakepkg.conf\fP. -.TP .B \-m, --nocolor Disable color in output messages. .TP diff --git a/doc/makepkg.conf.5 b/doc/makepkg.conf.5 index 7b764060..23fc1d1f 100644 --- a/doc/makepkg.conf.5 +++ b/doc/makepkg.conf.5 @@ -68,8 +68,7 @@ Colorize output messages, making output easier to read. .B ccache Use ccache to cache compilation by default. This allows for faster compiles if you are continuously recompiling the same packages. It can be disabled for -individual packages by passing the \fB-B\fP or \fB--noccache\fP flag to -\fBmakepkg\fP. +individual packages by placing \fB!ccache\fP in the \fB\*(PB\fP options array. .RE .TP .B DISTCC_HOSTS="\fIhost1 ...\fP" diff --git a/scripts/makepkg b/scripts/makepkg index 7cc5871d..b825bdff 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -356,7 +356,6 @@ usage() { echo echo "Options:" echo " -b, --builddeps Build missing dependencies from source" - echo " -B, --noccache Do not use ccache during build" echo " -c, --clean Clean up work files after build" echo " -C, --cleancache Clean up source files from the cache" echo " -d, --nodeps Skip all dependency checks" @@ -365,7 +364,6 @@ usage() { echo " -g, --geninteg Generate integrity checks for source files" echo " -h, --help This help" echo " -i, --install Install package after successful build" - echo " -j Set MAKEFLAGS to \"-j\" before building" echo " -L, --log Log package build process" echo " -m, --nocolor Disable colorized output messages" echo " -o, --nobuild Download and extract files only" @@ -421,7 +419,6 @@ while [ "$#" -ne "0" ]; do --syncdeps) DEP_BIN=1 ;; --usesudo) SUDO=1 ;; --builddeps) DEP_SRC=1 ;; - --noccache) USE_CCACHE="n" ;; --nodeps) NODEPS=1 ;; --noextract) NOEXTRACT=1 ;; --install) INSTALL=1 ;; @@ -441,10 +438,9 @@ while [ "$#" -ne "0" ]; do exit 1 ;; -*) - while getopts "bBcCdefghij:Lmop:rRsS-" opt; do + while getopts "bcCdefghiLmop:rRsS-" opt; do case $opt in b) DEP_SRC=1 ;; - B) USE_CCACHE="n" ;; c) CLEANUP=1 ;; C) CLEANCACHE=1 ;; d) NODEPS=1 ;; @@ -456,7 +452,6 @@ while [ "$#" -ne "0" ]; do exit 0 ;; i) INSTALL=1 ;; - j) export MAKEFLAGS="-j$OPTARG" ;; L) LOGGING=1 ;; m) USE_COLOR="n" ;; o) NOBUILD=1 ;; @@ -524,7 +519,7 @@ fi source $BUILDSCRIPT -# check for no-no's +# check for no-no's in the build script if [ -z "$pkgver" ]; then error "pkgver is not allowed to be empty." exit 1 @@ -553,7 +548,8 @@ if [ "$install" -a ! -f "$install" ]; then exit 1 fi -if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} -a "$FORCE" = "0" -a "$GENINTEG" = "0" ]; then +if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} + -a "$FORCE" = "0" -a "$GENINTEG" = "0" ]; then if [ "$INSTALL" = "1" ]; then warning "a package has already been built, installing existing package." installpackage @@ -564,8 +560,9 @@ if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} -a "$FORCE" = fi fi -# Enter the fakeroot environment if necessary. This will call the makepkg script again -# as the fake root user. We detect this by passing a sentinel option (-F) to makepkg +# Enter the fakeroot environment if necessary. This will call the makepkg +# script again as the fake root user. We detect this by passing a sentinel +# option (-F) to makepkg. if [ "$EUID" != "0" ]; then if [ "$(check_buildenv fakeroot)" = "y" ]; then if [ $(type -p fakeroot) ]; then @@ -819,17 +816,24 @@ else fi mkdir -p $startdir/pkg - # use distcc if requested - if [ "$(check_buildenv distcc)" = "y" ]; then + # use distcc if it is requested (check buildenv and PKGBUILD opts) + if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + else if [ "$(check_option distcc)" = "n" ]; then + # if it is not wanted, clear the makeflags too + export MAKEFLAGS="" fi - # use ccache if it's available - # USE_CCACHE still here because it is a command line option - if [ ! "$USE_CCACHE" = "n" -a "$(check_buildenv ccache)" = "y" ]; then + # use ccache if it is requested (check buildenv and PKGBUILD opts) + if [ "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then [ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH fi + # clear user-specified makeflags if requested + if [ "$(check_option makeflags)" = "n" ]; then + export MAKEFLAGS="" + fi + # build msg "Starting build()..." -- cgit v1.2.3-70-g09d2