You are not logged in.

#1 2015-02-28 11:15:31

schnusch
Member
Registered: 2015-02-28
Posts: 1

prefix in PKGBUILDs

I would recommend to make PKGBUILDs more flexible by adding the possibilty to install to a custom prefix. This would need another variable like $srcdir or $pkgdir in makepkg (say $prefix), but still provide backwards compatibility for older versions without support for this variable.

Here a patch for coreutils:

diff -urN coreutils/PKGBUILD coreutils_prefixed/PKGBUILD
--- coreutils/PKGBUILD	2015-02-28 11:40:26.205559513 +0100
+++ coreutils_prefixed/PKGBUILD	2015-02-28 11:41:44.479080115 +0100
@@ -26,8 +26,8 @@
 build() {
   cd $pkgname-$pkgver
   ./configure \
-      --prefix=/usr \
-      --libexecdir=/usr/lib \
+      --prefix="${prefix:-/usr}" \
+      --libexecdir="${prefix:-/usr}/lib" \
       --with-openssl \
       --enable-no-install-program=groups,hostname,kill,uptime
   make

I don't claim this solution to be the ideal, but I would see great use in this feature.

Offline

#2 2015-02-28 11:26:25

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: prefix in PKGBUILDs

You probably want to open a feature request against pacman in the bug tracker...


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2015-02-28 16:13:58

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,384
Website

Re: prefix in PKGBUILDs

No you don't...  this is nothing to do with pacman.  And I doubt Arch would support that either.

Offline

#4 2015-02-28 16:16:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: prefix in PKGBUILDs

Nothing needs to be added for this.  Any package that supports prefix specification in the build/install will already work this way.  Just define the PREFIX variable you want to use.  Note that the patch in your initial post only patches a PKGBUILD.  If /usr/ is hardcoded in the PKGBUILD and you'd rather have it use the PREFIX variable, report that to the maintainer of the PKGBUILD or edit it yourself.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-02-28 17:23:04

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: prefix in PKGBUILDs

I don't see a reason for a global option in makepkg for compiling a few select packages with a different prefix. Simply edit each PKGBUILD you need, that should not be too much work. Regardless, if you want to install multiple versions of a package in different locations (e.g. opt), you'll have to modify the package name and other metadata, too.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2015-02-28 19:14:26

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: prefix in PKGBUILDs

Allan wrote:

No you don't...  this is nothing to do with pacman.  And I doubt Arch would support that either.

But...

% pacman -Qo makepkg
/usr/bin/makepkg is owned by pacman 4.2.1-1

So if he wanted the dev group to see the request, why not open the FS against core/pacman?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2015-02-28 19:20:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: prefix in PKGBUILDs

Trilby wrote:

Nothing needs to be added for this.

What feature is being requested?  Variables can already be defined by users and used in PKGBUILDs.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2015-03-01 04:01:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,384
Website

Re: prefix in PKGBUILDs

graysky wrote:
Allan wrote:

No you don't...  this is nothing to do with pacman.  And I doubt Arch would support that either.

But...

% pacman -Qo makepkg
/usr/bin/makepkg is owned by pacman 4.2.1-1

So if he wanted the dev group to see the request, why not open the FS against core/pacman?

Filing it against pacman ensures only I see it, and not the whole dev group

Offline

#9 2015-03-01 04:32:16

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: prefix in PKGBUILDs

Allan wrote:

Filing it against pacman ensures only I see it, and not the whole dev group

But you already saw it big_smile


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB