Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#31140 - USE flags in PKGBUILDs

Attached to Project: Pacman
Opened by erdbeer (erdbeer) - Wednesday, 15 August 2012, 14:46 GMT
Task Type Feature Request
Category General
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 4.0.3
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Greetings,
I'd like to propose something like the Gentoo USE flags for Arch so users can decide more easily which features they want to have in their software and which not.

Let's imagine there's libasdf and it is used by some package, but not necessary for it to work. The PKGBUILD of 'some package' then could have the line
USE[asdf]="yes"
which the user can simply modify to switch on or off the use of libasdf in 'some package' (or just leave it or comment it out to keep the default).
Some more code in the PKGBUILD may be needed to change the dependency list if needed, eg.:
generate_deps() {
if [[ ${USE[asdf]} == "yes" ]]; then
if ! in_array libasdf "${USE[@]}"; then
depends=("${depends[@]}" libasdf)
fi
else
depends=(${depends[@]/libasdf/})
fi
# that code for every relevant USE flag
}
If USE[asdf] is "yes", it adds libasdf to depends if it is not already in the list. If it is not "yes", it removes libasdf from depends. This function is called by makepkg after loading the PKGBUILD. generate_deps may not only modify depends but also other variables, e.g. makedepends or optdepends.

If users would like not only 'some package' without libasdf but instead their whole system, they can define GLOBALUSE[asdf]="no" in makepkg.conf. GLOBALUSE's values overwrite those of USE from the PKGBUILD so they don't have to change that for every package they compile.

build() also has to be aware of the flags. Example:
[[ ${USE[asdf]} == "yes" ]] && ./configure --with-asdf || ./configure
Note that at this point USE has already been merged with GLOBALUSE, so there's no need to check GLOBALUSE.

I've attached a patch for makepkg. Please excuse my (probably) bad coding style since I'm no bash programmer.
This task depends upon

Loading...