[pacman-dev] Configure --prefix in PKGBUILD scripts
Hi I was thinking a way of changing --prefix= used in configure. I think it's desirable to have a chance to change this to another directory, specially in BSD where a lot of userland applications should not be replaced with packages. pkgsrc does that by installing on /usr/pkg its bin, doc, lib, etc ... We could add to makepkg.conf the option PREFIX so we can use later $PREFIX in PKGBUILD. For Archlinux we could specify /usr by default and use /usr/pac for others, or whatever the user needs to. This wouldn't affect ABS behaviour in Archlinux IMHO What do you think guys? :) Regards, Antonio Huete
Antonio Huete Jimenez wrote:
I was thinking a way of changing --prefix= used in configure. I think it's desirable to have a chance to change this to another directory, specially in BSD where a lot of userland applications should not be replaced with packages.
pkgsrc does that by installing on /usr/pkg its bin, doc, lib, etc ...
We could add to makepkg.conf the option PREFIX so we can use later $PREFIX in PKGBUILD. For Archlinux we could specify /usr by default and use /usr/pac for others, or whatever the user needs to. This wouldn't affect ABS behaviour in Archlinux IMHO
What do you think guys? :)
Let me get this correct. You want to add a PREFIX option in makepkg.conf so then people will use "./configure --prefix=${PREFIX}" in the PKGBUILDs and thus PKGBUILDs are portable across operating systems? If I interpreted you right there, it seems a bit of a waste of time to me. When writing an Arch PKGBUILD, why would anybody write "${PREFIX}" instead of "/usr". One is a lot simpler, clearer and shorter and when writing a PKGBUILD for Arch, you are targeting Arch not every other operating system. Also, if porting Arch PKGBUILDs to other operating systems, changing the prefix is likely to be the easy part... Allan
I don't think that costs too much effort and I think it would be even a nice feature. Why should we have separate ABS tree for each operating system? That sound a lot of more effort. But well, this is just an opinion. Cheers, Antonio Huete 2008/6/4 Allan McRae <mcrae_allan@hotmail.com>:
Antonio Huete Jimenez wrote:
I was thinking a way of changing --prefix= used in configure. I think it's desirable to have a chance to change this to another directory, specially in BSD where a lot of userland applications should not be replaced with packages.
pkgsrc does that by installing on /usr/pkg its bin, doc, lib, etc ...
We could add to makepkg.conf the option PREFIX so we can use later $PREFIX in PKGBUILD. For Archlinux we could specify /usr by default and use /usr/pac for others, or whatever the user needs to. This wouldn't affect ABS behaviour in Archlinux IMHO
What do you think guys? :)
Let me get this correct. You want to add a PREFIX option in makepkg.conf so then people will use "./configure --prefix=${PREFIX}" in the PKGBUILDs and thus PKGBUILDs are portable across operating systems?
If I interpreted you right there, it seems a bit of a waste of time to me. When writing an Arch PKGBUILD, why would anybody write "${PREFIX}" instead of "/usr". One is a lot simpler, clearer and shorter and when writing a PKGBUILD for Arch, you are targeting Arch not every other operating system.
Also, if porting Arch PKGBUILDs to other operating systems, changing the prefix is likely to be the easy part...
Allan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
On 04/06/2008, at 6:57 PM, Antonio Huete Jimenez wrote:
I don't think that costs too much effort and I think it would be even a nice feature.
Why should we have separate ABS tree for each operating system? That sound a lot of more effort. But well, this is just an opinion.
Cheers, Antonio Huete
Because there are differences in operating systems. I hate to say this, but it's not KISS. Having an extra variable in there like that would add ambiguity and confusion. When --prefix=/usr is used it's obvious that it's going into /usr, that's not the case with --prefix="$ {PREFIX}". Also with some Makefiles DESTDIR is used, so we'd have to use `make DESTDIR="$pkgdir${PREFIX}" install`. Some files go into /var and other directories, that aren't under a common prefix, so imo it's just too complicated and confusing to do that.
On Wed, Jun 4, 2008 at 5:23 AM, Allan McRae <mcrae_allan@hotmail.com> wrote:
Antonio Huete Jimenez wrote:
I was thinking a way of changing --prefix= used in configure. I think it's desirable to have a chance to change this to another directory, specially in BSD where a lot of userland applications should not be replaced with packages.
pkgsrc does that by installing on /usr/pkg its bin, doc, lib, etc ...
We could add to makepkg.conf the option PREFIX so we can use later $PREFIX in PKGBUILD. For Archlinux we could specify /usr by default and use /usr/pac for others, or whatever the user needs to. This wouldn't affect ABS behaviour in Archlinux IMHO
What do you think guys? :)
Let me get this correct. You want to add a PREFIX option in makepkg.conf so then people will use "./configure --prefix=${PREFIX}" in the PKGBUILDs and thus PKGBUILDs are portable across operating systems?
If I interpreted you right there, it seems a bit of a waste of time to me. When writing an Arch PKGBUILD, why would anybody write "${PREFIX}" instead of "/usr". One is a lot simpler, clearer and shorter and when writing a PKGBUILD for Arch, you are targeting Arch not every other operating system.
Also, if porting Arch PKGBUILDs to other operating systems, changing the prefix is likely to be the easy part...
-1
And how is supposed I can change the prefix for a wide variety of PKGBUILD 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. 2008/6/4 Dan McGee <dpmcgee@gmail.com>:
On Wed, Jun 4, 2008 at 5:23 AM, Allan McRae <mcrae_allan@hotmail.com> wrote:
Antonio Huete Jimenez wrote:
I was thinking a way of changing --prefix= used in configure. I think it's desirable to have a chance to change this to another directory, specially in BSD where a lot of userland applications should not be replaced with packages.
pkgsrc does that by installing on /usr/pkg its bin, doc, lib, etc ...
We could add to makepkg.conf the option PREFIX so we can use later $PREFIX in PKGBUILD. For Archlinux we could specify /usr by default and use /usr/pac for others, or whatever the user needs to. This wouldn't affect ABS behaviour in Archlinux IMHO
What do you think guys? :)
Let me get this correct. You want to add a PREFIX option in makepkg.conf so then people will use "./configure --prefix=${PREFIX}" in the PKGBUILDs and thus PKGBUILDs are portable across operating systems?
If I interpreted you right there, it seems a bit of a waste of time to me. When writing an Arch PKGBUILD, why would anybody write "${PREFIX}" instead of "/usr". One is a lot simpler, clearer and shorter and when writing a PKGBUILD for Arch, you are targeting Arch not every other operating system.
Also, if porting Arch PKGBUILDs to other operating systems, changing the prefix is likely to be the easy part...
-1
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
On Wed, Jun 4, 2008 at 6:34 AM, Antonio Huete Jimenez <ahuete.devel@gmail.com> wrote:
And how is supposed I can change the prefix for a wide variety of PKGBUILD 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.
Please try to refrain from top-posting when the quoted email is relevant. You are asking for two conflicting things, and confusing two relatively different issues. Are you using BSD as: 1. A kernel where you want to build the Arch userland around? 2. An existing operating system where you are going to manage a few packages with pacman? For situation (1), I can see your point- in this case, maybe the Arch ABS tree should be relatively usable out of the box. But guess what? Arch isn't BSD, so just because you change the kernel doesn't mean the package paths change- part of the Arch mindset is not using /usr/local by default, etc. so changing paths just because you changed to a BSD kernel would be unjustified. For situation (2), you are dealing with a whole different set of issues. pacman and makepkg are not pkgsrc replacements, so how could you expect PKGBUILDs designed for a Linux system and with certain configure options would work flawlessly on your BSD system? For the rest of us, this PREFIX option would just make things less KISS and we wouldn't use it (because it is easier to deal with /usr rather than $PREFIX). It sounds like I'm ragging and being Mr. Negative here, but you have to realize this PREFIX thing is *one* small difference in a world of many between an Arch system and an existing BSD system. -Dan
2008/6/4 Dan McGee <dpmcgee@gmail.com>:
On Wed, Jun 4, 2008 at 6:34 AM, Antonio Huete Jimenez <ahuete.devel@gmail.com> wrote:
And how is supposed I can change the prefix for a wide variety of PKGBUILD 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.
Please try to refrain from top-posting when the quoted email is relevant.
You are asking for two conflicting things, and confusing two relatively different issues.
Are you using BSD as: 1. A kernel where you want to build the Arch userland around? 2. An existing operating system where you are going to manage a few packages with pacman?
I was thinking in pacman as a primary package manager for DragonFlyBSD (and possibly other BSD) if the user chooses wants to use as that. For both managing a bunch (or a huge amount) of packages and still being able to compile everything without the need of a separate build machine. BSD will have its own userland as always.
For situation (1), I can see your point- in this case, maybe the Arch ABS tree should be relatively usable out of the box. But guess what? Arch isn't BSD, so just because you change the kernel doesn't mean the package paths change- part of the Arch mindset is not using /usr/local by default, etc. so changing paths just because you changed to a BSD kernel would be unjustified.
In BSD base comes with everything (base+kernel) where base are a bunch of programs that shouldn't be overwritten when you install a package with pacman (pacman avoids overwritting but avoids installing too) for fullfilling a dependency. I know that BSD isn't Linux, of course and I understand your will of not using /usr/local as prefix, but what about using anything you want although we don't do it in my way?
For situation (2), you are dealing with a whole different set of issues. pacman and makepkg are not pkgsrc replacements, so how could you expect PKGBUILDs designed for a Linux system and with certain configure options would work flawlessly on your BSD system? For the rest of us, this PREFIX option would just make things less KISS and we wouldn't use it (because it is easier to deal with /usr rather than $PREFIX).
I agree with you that things should be kept KISS, but sometimes keeping things so KISS just complicate it if you want to do complex things.
It sounds like I'm ragging and being Mr. Negative here, but you have to realize this PREFIX thing is *one* small difference in a world of many between an Arch system and an existing BSD system.
Yup, too many differences but I think we would need to take advantage of all that work done in pacman for being able to compile it under FreeBSD.
-Dan
It may seem that I have arrived here to your list with a will of changing everything with the only intention of adapting ABS/pacman to BSD environments, but that's away from my real intention. I just want to help without having any BSD/Linux wars, nothing more :)
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
On Wed, Jun 4, 2008 at 8:13 AM, Antonio Huete Jimenez <ahuete.devel@gmail.com> wrote:
2008/6/4 Dan McGee <dpmcgee@gmail.com>:
On Wed, Jun 4, 2008 at 6:34 AM, Antonio Huete Jimenez <ahuete.devel@gmail.com> wrote:
And how is supposed I can change the prefix for a wide variety of PKGBUILD 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 clear. 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@g" 1 --prefix=/usr\ 1 extra/rosegarden/PKGBUILD: cmake . -DCMAKE_INSTALL_PREFIX=`kde-config --prefix` -DWANT_LIRC=OFF 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. :)
On 2008-06-04, Travis Willard wrote:
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.
On the "it could be useful" side, I'm not sure the original suggestion included the need to change the current PKGBUILDs, just that it could be a useful aid for some packagers. --markc
2008/6/4 Mark Constable <markc@renta.net>:
On 2008-06-04, Travis Willard wrote:
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.
On the "it could be useful" side, I'm not sure the original suggestion included the need to change the current PKGBUILDs, just that it could be a useful aid for some packagers.
--markc
The only remaining thing I could just figure out is to use git to manage the ABS tree, generate branches for every OS it's being ported, and provide monthly sets of patches providing OS specific changes that don't affect ArchLinux at all (and AL devel don't have to take any action on them if they don't want). All this monthly set patches can be managed with tags. By the way, I don't eat donuts, but nice joke :-D
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
On 04/06/2008, at 10:15 PM, Antonio Huete Jimenez wrote:
The only remaining thing I could just figure out is to use git to manage the ABS tree, generate branches for every OS it's being ported, and provide monthly sets of patches providing OS specific changes that don't affect ArchLinux at all (and AL devel don't have to take any action on them if they don't want).
All this monthly set patches can be managed with tags.
I really don't see the point of branching the Archlinux ABS tree. It's the Archlinux ABS tree, not some generic ABS tree that's supposed to work for everything. More importantly it's a set of PKGBUILDs for a Linux system. BSD isn't Linux, and although some of the userland is similar, a lot of it is not. Somewhere along the line there will be more differences than similarities in the PKGBUILDs, and imo, it's just easier to copy the Archilnux ABS tree and work off that. Now a generic set of PKGBUILDs for the BSD system may be a good idea. They would definitely have more similarities than ones from a Linux system. Also I just want to make clear that the ABS tree is separate from the makepkg and pacman projects.
On 2008-06-04, Allan McRae wrote:
If I interpreted you right there, it seems a bit of a waste of time to me. When writing an Arch PKGBUILD, why would anybody write "${PREFIX}" instead of "/usr". One is a lot simpler, clearer and shorter and when writing a PKGBUILD for Arch, you are targeting Arch not every other operating system.
Also, if porting Arch PKGBUILDs to other operating systems, changing the prefix is likely to be the easy part...
I think the point is that if you are dealing with building a complete distro, or a large set of packages, then the $PREFIX variable only has to be set in one place, and then changed only in one place to rebuild the same set of packages for another arch with a different --prefix= requirement. Sure, the porting process is far more involved but then when it comes to time automate the procedure then I could imagine this global $PREFIX value could be very useful and far better than using sed to mass change any --prefix value in individual PKGBUILDs. I could also using this value to set the -DCMAKE_INSTALL_PREFIX value for KDE4s cmake invocation too. --markc
participants (6)
-
Allan McRae
-
Antonio Huete Jimenez
-
Dan McGee
-
Mark Constable
-
Sebastian Nowicki
-
Travis Willard