Re: pkg-config and share/

From: Andrea Pappacoda <andrea_at_pappacoda.it>
Date: Mon, 25 Jul 2022 10:04:24 UTC
Il giorno lun 25 lug 2022 alle 11:08:24 +02:00:00, Baptiste Daroussin 
<bapt@FreeBSD.org> ha scritto:
> On Mon, Jul 25, 2022 at 10:54:57AM +0200, Alex Dupre wrote:
>>  On 25/07/22 10:15, Baptiste Daroussin wrote:
>>  > When pkg-config came out, (before my time) the .pc files were 
>> naturally added to
>>  > libdata which is where most people hacking on freebsd would have 
>> expected it.
>>  >
>>  > So when we switched to pkgconf we preserved that.
>>  >
>>  > Note that the ports tree on freebsd does not need patching as it 
>> automatically
>>  > moves the .pc files from the "linux" location to libdata.
>> 

Oh, nice! So I can simply install to share/ and FreeBSD will figure it 
out, right?

>>  I'm not sure this fully answers Andrea's question. It explains why 
>> we use
>>  `libdata` instead of `lib`, but not exactly why we don't use 
>> `share` at all.
>>  Is it desired or simply it was added in pkg-config in a second time 
>> and
>>  never added to the FreeBSD port?
> 
> Not really except if someone comes with a strong argument, we can 
> manipulate
> where pkgconf does look at, via environment variable if needed.

Yeah, I still feel that ignoring share/ is a bit odd, especially 
because you lose the possibility of determining if a given .pc file 
refers to an architecture-independent library or not. I don't know how 
much FreeBSD cares about cross-builds, but I believe that keeping 
everything in the same dir makes things harder (if not impossible).

> The reason we don't look elsewhere by default it to ensure we keep 
> the room
> "clean" and people carefully store things where they are expected to 
> be, if they
> don't, they do it on purpose and we offer mechanism to help them, 
> (the env
> variable).

Yep, this makes sense. Every choice has its own trade-offs :)

Thank you both for your replies!

-- 
OpenPGP key: 66DE F152 8299 0C21 99EF  A801 A8A1 28A8 AB1C EE49