From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.devel Subject: Re: Make the pkgconfig file of Guile relocatable. Date: Mon, 28 Feb 2022 15:03:23 +0800 Message-ID: References: <86tuckqoge.fsf@163.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a1745c05d90ea526" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1750"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel To: Zhu Zihao Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Feb 28 08:04:31 2022 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nOa59-0000Az-Ec for guile-devel@m.gmane-mx.org; Mon, 28 Feb 2022 08:04:31 +0100 Original-Received: from localhost ([::1]:53612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOa58-0000Cn-6x for guile-devel@m.gmane-mx.org; Mon, 28 Feb 2022 02:04:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOa4I-00089R-1f for guile-devel@gnu.org; Mon, 28 Feb 2022 02:03:38 -0500 Original-Received: from [2607:f8b0:4864:20::f35] (port=34483 helo=mail-qv1-xf35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nOa4G-0002nt-Au for guile-devel@gnu.org; Mon, 28 Feb 2022 02:03:37 -0500 Original-Received: by mail-qv1-xf35.google.com with SMTP id ba20so11668808qvb.1 for ; Sun, 27 Feb 2022 23:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h4SXaXJxFrc+EdX0OqB5PKIOL460bXcl6BUdC9yR4YY=; b=nlRgKGnsgYM22pXZ0L6PyyzeVqVxR0/N0+vIbwgQoI6BtGhMATMyMcL6Mjn0SqRmrj ZfLKsH78Y5gBkjxuL7wc2E1BlPUMyuoYU7ACPer0VhlCtCAicP3hrd7I4wqUAxoeCUTr lcK13f+RsHkbC36CxmGGlErZ8whQEA6mp+hcbfUXXPpKKqOwxcak6bXEzApy+FPG7Fav SvgbjEW6TgtzRIUEgXFWn+Tgt35KwsXzRcKaf4/Q5s62Q6qfsuy6bU5egsS+DHCkUPRv 6z7Qzu6MKrLmL4une6D/VSxiMqIIPmx3FYuYP5QYtiSprRsGEGHhYaaQxlAluRmMCOFr 68xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h4SXaXJxFrc+EdX0OqB5PKIOL460bXcl6BUdC9yR4YY=; b=TYwjp4sNL7HFcpfZZn0wBL6wJ8tTShRQ/qhZ2AzGr6JoDc0qBmQfpfS/SW7qf3jWvC J5aagWGrJjYp9uVAle5lbwgPsa1EBDww00fv18vEfd0lr9JEBxS1nG22+RMsjkDogfcN bbe4PPr2tFoUNSKCH9preb1fj95JLBcROE10bnniKv0ukPPtOIJFyBskIJNUPX0GrBE2 Fsfk+CuqbahFxJC93OU8WJdgxBs7U3Fq/FuNYHYuXdQqUzCSVtxrK8KQNV3rCeDXRWFZ lQDFA95VeUt7LSbzt+fZ1cMKvfYARdyfYPwYg+jjAv7ae3p21A2nKd8cTp0Rgq971Aw4 ItCQ== X-Gm-Message-State: AOAM533eSA1rrEL6wXbO9aUXQHRZ9Cq8fBtzxHBWrFDLviI2R9xQmMD0 cJ2D1LmdgOsJB/8fbVBkrGnZzGf1GKdHtJj/fGQ= X-Google-Smtp-Source: ABdhPJzUNFWIgAvLQ+LvQNEfEfciSzvqLiDEPWRjvG3m3Gu84YAiIEvXenZJNJolExXNRrfFSjmBiU/A+y6jInU1ypI= X-Received: by 2002:a0c:ec04:0:b0:432:274a:a1fe with SMTP id y4-20020a0cec04000000b00432274aa1femr13007781qvo.68.1646031815143; Sun, 27 Feb 2022 23:03:35 -0800 (PST) In-Reply-To: <86tuckqoge.fsf@163.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f35 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=nalaginrut@gmail.com; helo=mail-qv1-xf35.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21156 Archived-At: --000000000000a1745c05d90ea526 Content-Type: text/plain; charset="UTF-8" hi Zihao! I think the substitution is OK. But if you want to package for Guix, you need to go Guix way. Guix package has made a similar approach, for example, you may check "guix edit artanis" to see how it substitutes the dir for Artanis. Best regards. On Mon, Feb 28, 2022 at 12:27 AM Zhu Zihao wrote: > > Currently, the guile-3.0.pc.in in 'meta' use the variable substitution > directly. > > prefix=@prefix@ > exec_prefix=@exec_prefix@ > bindir=@bindir@ > libdir=@libdir@ > includedir=@includedir@ > datarootdir=@datarootdir@ > datadir=@datadir@ > pkgdatadir=@datadir@/guile > pkgincludedir=@includedir@/guile > > sitedir=@sitedir@ > extensiondir=@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/extensions > siteccachedir=@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache > libguileinterface=@LIBGUILE_INTERFACE@ > > sitedir, siteccachedir and extensiondir will be subsituted to the full > path of the install path of Guile. > > But sometimes I want to install guile module in different > prefix(e.g. NixOS, Guix, flatpak). I have to adjust these variable > manually. > > My idea is change the definition of sitedir, siteccachedir, extensiondir > use the variable substition of pkg-config instead of autotools. > > For example > > sitedir=${datadir}/guile/site/@GUILE_EFFECTIVE_VERSION@ > siteccachedir=${libdir}/guile/@GUILE_EFFECTIVE_VERSION@/extensions > > .... > > So I can use > > pkg-config guile-3.0 --define-variable=libdir=$MY_PREFIX > --variable=siteccachedir > > to get the correct install directory. > > Thoughts? > -- > Retrieve my PGP public key: > > gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F > > Zihao > --000000000000a1745c05d90ea526 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
hi Zihao!

I think the substitutio= n is OK.=C2=A0
But if you want to package for Guix, you need to go Guix= way.
Guix package has made a similar approach, for example, you ma= y check "guix edit artanis" to see how it substitutes the dir for= Artanis.=C2=A0

Best regards.

<= br>

On Mon, Feb 28, 2022 at 12:27 AM Zhu Zihao <all_but_last@163.com> wrote:

Currently, the guile-3.0.pc.in in 'meta' use the variable substitu= tion
directly.

prefix=3D@prefix@
exec_prefix=3D@exec_prefix@
bindir=3D@bindir@
libdir=3D@libdir@
includedir=3D@includedir@
datarootdir=3D@datarootdir@
datadir=3D@datadir@
pkgdatadir=3D@datadir@/guile
pkgincludedir=3D@includedir@/guile

sitedir=3D@sitedir@
extensiondir=3D@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/extensions
siteccachedir=3D@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache
libguileinterface=3D@LIBGUILE_INTERFACE@

sitedir, siteccachedir and extensiondir will be subsituted to the full
path of the install path of Guile.

But sometimes I want to install guile module in different
prefix(e.g. NixOS, Guix, flatpak). I have to adjust these variable
manually.

My idea is change the definition of sitedir, siteccachedir, extensiondir use the variable substition of pkg-config instead of autotools.

For example

sitedir=3D${datadir}/guile/site/@GUILE_EFFECTIVE_VERSION@
siteccachedir=3D${libdir}/guile/@GUILE_EFFECTIVE_VERSION@/extensions

....

So I can use

pkg-config guile-3.0 --define-variable=3Dlibdir=3D$MY_PREFIX --variable=3Ds= iteccachedir

to get the correct install directory.

Thoughts?
--
Retrieve my PGP public key:

=C2=A0 gpg --recv-keys D47A9C8B2AE3905B563D9135BE42B352A9F6821F

Zihao
--000000000000a1745c05d90ea526--