pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: detect packages on system path when building



On 2020-05-04 20:56, Klaatu wrote:
On Tuesday, May 05, 2020 01:53:59 PM you wrote:
I'm sure this has been asked before, but I've searched and can't seem to
find the answer.

* I have foo installed in /usr/bin
* I want to install bar with pkgsrc to /usr/local/bin
* bar requires foo

Pkgsrc detects packages in /usr/local, and so it attempts to install a local
version of foo. How do I tell pkgsrc about system's /usr/bin/foo so as to
avoid a new local install?

Please trust that I've weighed the risk of doing this (and promise not to
email should a package fail because of it).

I've tried setting the LOCALBASE to /usr/bin temporarily during my build,
but that failed and so I feel I'm on the wrong path there.

What am I missing?

Thanks!
Darn, I forgot to mention that for this question, I'm running pkgsrc on
Slackware Linux.

Everything's working as expected on my NetBSD box.

Thanks.

First consider whether you really want to do that.  It might save some time up-front but cost you later.

If a pkgsrc package depends on something it did not install itself, then the version, build options, and/or install tree might not be suitable for the dependent package, causing run-time issues.

Also, upgrades to either pkgsrc or the system that installed the foreign dependency can spontaneously break things, since the two package managers cannot track each other's dependencies.  I personally don't like spending time diagnosing and fixing things that were working fine before I ran a routine update, so I always set

PREFER_NATIVE=        no
PREFER_PKGSRC=        yes

in my mk.conf to ensure that pkgsrc installs all the dependencies it needs.

If possible, I avoid installing duplicate software *outside* pkgsrc and try to use pkgsrc for everything.

Best,

    JB



Home | Main Index | Thread Index | Old Index