You are not logged in.

#1 2015-10-15 11:00:02

bjornvaktaren
Member
Registered: 2015-06-30
Posts: 2

Install AUR packages in another folder

Hello everyone,

I would like to install two versions of a software, both are available on AUR (root5 and root), in self-contained folder, e.g. ~/builds/root5. Can i just modify $pkgdir in PKGBUILD before running makepkg? Do I just set pkgdir=/my/custom/location? Before or inside package()?

Cheers

Offline

#2 2015-10-15 11:20:31

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

Re: Install AUR packages in another folder

No.  Pkgdir is simply where makepkg assembles the package.  For example, if pkgdir happens to be /tmp/aur/mypackage/pkg then all the files to be installed will be under that like /tmp/aur/mypackage/pkg/usr/bin/mybinary.  Note that everything that is part of pkgdir is trimmed for the actual installation: /tmp/aur/mypackage/pkg/usr/bin/mybinary becomes /usr/bin/mybinary.

You don't want to use a different pkgdir, you want to install to somewhere other than /usr/bin under the pkgdir.  This is generally accomplished by chaing DESTDIR in the call to `make install` in the package function.  Or more generally, it is changing the package function so files are copied to or installed to ${pkgdir}/my/custom/location.

However, I would not advise having that location in your home directory - this might not even work, or if it does it could have odd consequences.  You can easily install to /opt/ this way, but if you want the binaries in your home directory, then just don't ever install them: just run them from your home directory location.


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

Offline

#3 2015-10-15 11:22:34

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Install AUR packages in another folder

No, pkgdir is the directory where the files will be placed before turning it into a package, it is a temporary directory and have nothing to do with the final destination. Basically, makepkg will make a tar version of what is in pkgdir, with pkgdir as the root of the files and pacman will untar this package in /  (there is also a support for additional installation scripts, but it is the basic idea). What you want to do is not supported. You will have to compile your software by hand or modify the PKGBUILD to build two separate non conflicting packages. The way to do this is dependent of the software you compile, there is no general method. You may want to use different --prefix in the configure script of the package (if it has one). The --prefix directory is where the final files should end up. But you have to be careful of some files particularly the *.desktop and icons files.

Offline

#4 2015-10-15 12:12:16

bjornvaktaren
Member
Registered: 2015-06-30
Posts: 2

Re: Install AUR packages in another folder

Alright! Thanks guys.

I will modify the PKGBUILD to use /opt instead during in the configuration. It may be a stupid question but I presume that for pacman to know about the installed packages I must use PKGBUILD+makepkg? pacman has no way of keeping track of a simple ./configure, make, make install right?

Offline

#5 2015-10-15 14:15:43

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: Install AUR packages in another folder

Yes, you need to use a PKGBUILD. Pacman has no way of knowing about every file you install without it being in a package.

Offline

#6 2015-10-15 15:21:14

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

Re: Install AUR packages in another folder

As noted above, install to /opt and use a PKGBUILD so pacman knows about it - or you can never install the package, but just build it somewhere in your home directory and add that location to your $PATH.

The latter strategy is commonly used for local builds.  For example, I have a ~/code/bin directory that is in my $PATH, so I can build stuff and put it there to use it without installing to the filesystem root.  This is fine for simple things - but if the binary would expect or require other files like .desktop files, or icons in specific locations this approach might be problematic.


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

Offline

#7 2017-03-09 03:47:37

harubyy
Member
Registered: 2017-03-09
Posts: 26

Re: Install AUR packages in another folder

I have been playing with PKGBUILD and went through man makepkg.conf but I still cannot make pacman install into a local folder that I specify. Can someone point something useful? It shouldn/'t be this hard.

Update: I built the package with makepkg -s and didn't install it and added to my path as Trilby pointed out. Sorry, I guess I was distracted while I was reading the answers

Last edited by harubyy (2017-03-09 03:55:41)

Offline

#8 2017-03-09 05:19:56

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Install AUR packages in another folder

Hi harubyy, please have a read over our Forum Etiquette; we discourage posting on such old threads: https://wiki.archlinux.org/index.php/Co … bumping.22

You're welcome to start your own thread, and link to this one if it is relevant.

Closing.

Offline

Board footer

Powered by FluxBB