unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What features does a language/runtime need to use guix as a package manager?
@ 2021-03-03 18:31 Vinícius dos Santos Oliveira
  2021-03-04 20:37 ` Leo Prikler
  0 siblings, 1 reply; 2+ messages in thread
From: Vinícius dos Santos Oliveira @ 2021-03-03 18:31 UTC (permalink / raw)
  To: guix-devel

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/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-04 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 18:31 What features does a language/runtime need to use guix as a package manager? Vinícius dos Santos Oliveira
2021-03-04 20:37 ` Leo Prikler

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).