From nobody Mon Jul 25 08:15:35 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LrtCF02dKz4Wp9q for ; Mon, 25 Jul 2022 08:15:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LrtCD6jvKz3p8M; Mon, 25 Jul 2022 08:15:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658736936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jb2aUft7cM7SgXWR391idDjxajL9lOKkvtfAAQvt6Dk=; b=uDMy2ReL7A9fM649dMm9tsm/6CL/phBDiXNMNJiNdY4rf3CJUNRmp8xEfXJyF0NfCPTPhU 108B/ZeNAUDirU1griBM8LU06PeUiRaLkJ3uU8lpkigMuxWQCEpkUKrBocg0LY0PD1s7F2 hq63JFcwW4x6X/Jlib6LMkVKN24pjWtULGzDaGAWAsMD39J7twuNaXDDeiBCa7t78P0rfq g+dadQizWgIfvCWvrRDYb5pG0iR2gIyVP7swH/Wxfc68VK5NXN4Kvv2G8CA613t8Fa5Qoc S3etOFQP1k22kLyEgVj4d4c3o8RuGhxeNrmXg0a+RD7pKPLRT1y8z/ijIoUA1g== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4LrtCD56shz13TK; Mon, 25 Jul 2022 08:15:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id B8F9DF2911; Mon, 25 Jul 2022 10:15:35 +0200 (CEST) Date: Mon, 25 Jul 2022 10:15:35 +0200 From: Baptiste Daroussin To: Andrea Pappacoda Cc: freebsd-hackers@FreeBSD.org Subject: Re: pkg-config and share/ Message-ID: <20220725081535.vuxy74odqt2cxdnw@aniel.nours.eu> References: <50B3D276-5E68-4F87-97FB-71D75D3D9602@pappacoda.it> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50B3D276-5E68-4F87-97FB-71D75D3D9602@pappacoda.it> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658736936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jb2aUft7cM7SgXWR391idDjxajL9lOKkvtfAAQvt6Dk=; b=G7tnRVpE/edvtECgyLvEOjBoGK6V5rB3RY4s12GJpMum/9rGARG6lN1UPbKzvbHMw4xgCL PWj+O6EatQXXZGRHEf2Nx/cfiDtrbzfVtB30bEjL58xDE5g6g2TO4NM9MA84c7NSdaOp72 caoU4kWxH5DO459rDkDFmjCzI3W67Ti1eHV/7f1hbci6TGFtD+sMAV/ljIbbnlVZ0He0nL 2aY5+7Z2l80ogGN+A7g9du96KK1FICRIoX8XVGQ/V9h3m/V9PU+ePg+enXrcrlynO+bknO J7QjvpEfelEPFV8vdNuQUkAQ8leysDW9LWLmjJa4ePvAwbrWY7PXblW380poQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658736936; a=rsa-sha256; cv=none; b=fjjcA0qkBSeLstHnUV60CGvFA1bgbB1qzeNNSWG7Sd0gGX0aC6mZmcYXGy6F5KFOTMzfBJ ZF4BsTWdlS4W7ye0otzjQ7W75J0W+sw6z/hxbvrBl6d3KKIN4OWlAxwuw1Jm5QlXKpkuDl oRFb9MpodfWvW04RFS7UEG6DLNVRAWZNjee4ms7Fmhd+DjDwWLEaCzmyCOom+TdYuPVFdz 4Vj7WYgj6QMhEcqlxBnQb5eGfzG65lh6rJNhTHIPPWM745sCJ6zACBfQiG7jD8yjsDyF9x 1nQkH91BVlRU1fyxvt/hw64OeE3IV1rWPd+eh7b/CCop3BgcO0BGfIhXHgG43g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Sun, Jul 24, 2022 at 02:36:14PM +0200, Andrea Pappacoda wrote: > Hi everyone! First time on the FreeBSD mailing lists, I hope this is not in the wrong section :) > > I'd like to ask/discuss about FreeBSD's pkg-config behaviour. [As far as I understand][1], on FreeBSD pkgconf looks for .pc files in the /usr/lib and /usr/libdata directories, but completely ignores /usr/share. Why is that? Where should arch-independent packages install their .pc files? > > I came here after a short discussion on a [GitHub issue][2], and I recommend looking at that thread too because it gives a lot of information about what the issue with not looking in share/ is, but in short it creates interoperability problems with OSs wanting to use that directory for cross-build purposes. > > Could somebody please help me understand why things work this way here, and if this unusual pkg-config behaviour could be improved? > > Thanks! > > [1]: https://cgit.freebsd.org/ports/tree/devel/pkgconf/Makefile#n23 > > [2]: https://github.com/marzer/tomlplusplus/pull/165 Hello, pkgconf does not look into /usr/lib but only /usr/libdata, tradionnaly on freebsd libdata has been used to store things used by the tool chain somehow but not being an actual library: gcc's configuration data at the time, ldscripts at the time, both empty now. man hier(4) will provide you the information. 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. I do hope that this answers your question! Best regards, Bapt