[pacman-dev] Configure --prefix in PKGBUILD scripts

Travis Willard travis at archlinux.org
Wed Jun 4 09:23:56 EDT 2008

On Wed, Jun 4, 2008 at 8:13 AM, Antonio Huete Jimenez
<ahuete.devel at gmail.com> wrote:
> 2008/6/4 Dan McGee <dpmcgee at gmail.com>:
>> On Wed, Jun 4, 2008 at 6:34 AM, Antonio Huete Jimenez
>> <ahuete.devel at gmail.com> wrote:
>> > And how is supposed I can change the prefix for a wide variety of
>> > and still have them useable under Archlinux and others???
>> >
>> > I still say that having separate ABS tree don't have any benefit for
>> > other
>> > OSes.

I'd like to add a couple comments here.  I'm not totally opposed to
the idea, per se, but there are a handful of issues I'd like to make

First off, there's not going to be a 'one-size-fits-all' prefix.  For
example, I ran this on the i686 ABS tree just now:

$ grep -r -- "--prefix" */*/PKGBUILD | sed "s#.*\(--prefix[= ][^
]*\).*#\1#" | sort | uniq -c | sort
      1 --prefix=
      1 --prefix=""
      1 --prefix=${PREFIX}
      1 --prefix=${startdir}/pkg/usr
      1 --prefix=/home/mailman
      1 --prefix=/opt/kde\
      1 --prefix=/opt/zope
      1 --prefix=/usr/lib/klibc
      1 --prefix=/usr/share
      1 --prefix=/usr at g"
      1 --prefix=/usr\
      1 extra/rosegarden/PKGBUILD:  cmake .
      2 --prefix /usr
      3 --prefix=/
      8 --prefix=/opt/NX
     11 --prefix=$startdir/pkg/usr
    174 --prefix=/opt/kde
   1541 --prefix=/usr

While --prefix=/usr is far and away the most common, there are a good
number of other prefixes in use, so a single PREFIX= value in
makepkg.conf might be a misnomer.

Secondly, there's only so far you can go with portability.  In my
opinion, PKGBUILDs and the packages they make are tied to the distro
they're used on - perhaps making steps toward generalizing the
PGKBUILDs in this way is a good idea, but I could imagine that you'd
still have little changes, here-and-there, to make in most PKGBUILDs
to ready them for another distro anyway.  Each and every PKGBUILD was
written under the assumption that they'd be used on ArchLinux, and
that assumption may cause problems if you're trying to use them
one-for-one, even with this PREFIX change.

Thirdly, let's assume we do agree that having PREFIX= in makepkg.conf
is a good idea.  Then, someone has to go through our mountain of
PKGBUILDs and update them - as you said, it's not as simple as a sed
instruction, so somebody DOES have to do all that work, and I can bet
you dollars to donuts it's not going to be any of the Archlinux devs.

Food for thought. :)

More information about the pacman-dev mailing list