You are not logged in.

#1 2019-06-06 20:51:25

Axejob
Member
Registered: 2019-06-06
Posts: 2

[Solved] Compiling and installing pacman to a custom dir

I'm trying to make my first open source contribution and have made a patch for pacman, unfortunately I'm a beginner and don't know how to test it without overwriting the normal pacman installation.

Using the '--prefix' and 'DESTDIR' options with the configure and make install scripts does install everything in the chosen folder, but running the binary in installDir/usr/local/bin/pacman just returns

 error: config file /usr/local/etc/pacman.conf could not be read: No such file or directory 

How do people normally test their compiled code without ruining the system?

Last edited by Axejob (2019-06-08 01:18:52)

Offline

#2 2019-06-06 23:25:58

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

Re: [Solved] Compiling and installing pacman to a custom dir

You shouldn't need to install it at all to test it.  Just compile it (without any special prefix options) and run it from where it is.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-06-06 23:40:09

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

Re: [Solved] Compiling and installing pacman to a custom dir

In the git source directory:

./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-doc --enable-git-version --enable-debug --enable-warningflags
make
./src/pacman/pacman -Syu

Offline

#4 2019-06-08 01:18:29

Axejob
Member
Registered: 2019-06-06
Posts: 2

Re: [Solved] Compiling and installing pacman to a custom dir

Allan wrote:

In the git source directory:

./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-doc --enable-git-version --enable-debug --enable-warningflags
make
./src/pacman/pacman -Syu

Thanks for the answer, it works. My patch on the other hand...

Offline

#5 2019-06-08 07:01:29

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

Re: [Solved] Compiling and installing pacman to a custom dir

If the patch is in libalpm, maybe you have to specify its location with LD_LIBRARY_PATH when running your freshly built pacman?


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

Offline

#6 2019-06-08 09:33:23

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

Re: [Solved] Compiling and installing pacman to a custom dir

progandy wrote:

If the patch is in libalpm, maybe you have to specify its location with LD_LIBRARY_PATH when running your freshly built pacman?

No.  The path I gave is actually a wrapper script that handles all that.

Offline

Board footer

Powered by FluxBB