From: "Vinícius dos Santos Oliveira" <vini.ipsmaker@gmail.com>
To: guix-devel@gnu.org
Subject: What features does a language/runtime need to use guix as a package manager?
Date: Wed, 3 Mar 2021 15:31:32 -0300 [thread overview]
Message-ID: <CAK9RveKWMp99JRbBCdRL1JaQVG-buBgt7qTEB+2q6KV39PHujw@mail.gmail.com> (raw)
Hi,
I was curious about how a language/runtime module system needs to be
designed to use guix as a package manager. I'm developing my own
require() function for a Lua host and I'd like to make sure it can use
guix as a package manager.
From a tutorial by Andrew Tropin[1] I learned about
native-search-paths. So I changed my module system to use a *_PATH
environment variable so guix could teach the Lua-based runtime where
to find the modules.
Then there is the next question: how does the module know where to
install itself to? A similar problem is found in GStreamer, so I'll
refer to the GStreamer scenario from now on.
The guix GStreamer package defines native-search-paths to
GST_PLUGIN_SYSTEM_PATH=lib/gstreamer-1.0. As far as I tested, if a
package gstreamer-foobar depends on gstreamer and install files to
${prefix}/lib/gstreamer-1.0, then GST_PLUGIN_SYSTEM_PATH will be
automatically updated to also contain gstreamer-foobar's
/gnu/store/*/lib/gstreamer-1.0.
My question here is: how should the software packaged in
gstreamer-foobar find out the proper directory to install its plugins?
Should it be ${prefix}/lib/gstreamer-1.0? Should it be
${prefix}/lib/gstreamer-1.1? That's something that shouldn't be
hardcoded. As far as I see, it can just use the pluginsdir from
GStreamer's pkg-config definition. Like so:
$ pkg-config --variable=pluginsdir gstreamer-1.0
However this command will print the wrong dir in guix. It'll print
something like:
/gnu/store/9if71w58d5mkxfxyc7fpz289qssnkqsv-gstreamer-1.18.2/lib/gstreamer-1.0
But that's the "namespace" for the gstreamer package, not for the
gstreamer-foobar package. A solution would be to invoke pkg-config as
follows:
$ pkg-config --define-variable="prefix=${prefix}"
--variable=pluginsdir gstreamer-1.0
This will actually print the proper ${prefix}/lib/gstreamer-1.0. But
that's my question here. How should pkg-config be invoked properly? I
could just as well invoke it as:
$ pkg-config --define-variable="prefix=${prefix}"
--define-variable=libdir='${prefix}/lib' --variable=pluginsdir
gstreamer-1.0
[1] https://youtu.be/R8DtPnP4eL8
--
Vinícius dos Santos Oliveira
https://vinipsmaker.github.io/
next reply other threads:[~2021-03-04 19:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 18:31 Vinícius dos Santos Oliveira [this message]
2021-03-04 20:37 ` What features does a language/runtime need to use guix as a package manager? Leo Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK9RveKWMp99JRbBCdRL1JaQVG-buBgt7qTEB+2q6KV39PHujw@mail.gmail.com \
--to=vini.ipsmaker@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).