guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Few Packaging Questions


From: Ludovic Courtès
Subject: Re: A Few Packaging Questions
Date: Sun, 07 Aug 2022 23:02:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi Christopher,

Christopher Rodriguez <cdr255@gmail.com> skribis:

> Hello All,
>
> 1. Is there a way to call non-exported procedures from a module in
> Guile?

In general this is not recommended (if it’s private, it’s for a reason;
plus the compiler might choose to inline the procedure at its call
site(s), in which case it doesn’t exist as such at run time), but if you
really have to, you can use @@ to get at a procedure, as in:

  (@@ (guix build ant-build-system) strip-jar-timestamps)

> 2. Is there a list of variables accessible using gexps somewhere, or
> some source code I might be able to glean the same information from?
>
> I have just discovered #$output as a somewhat useful tool, and I'm
> currently looking to learn more ahead of when I might need them.

#$output is an exception, a trick to refer to the output of the
derivation in which the gexp appears.

Other than that, you can think of #$ as ‘unquote’ in regular
Lisp/Scheme.

> 3. What is the canonical way in the new input system to reference a
> specific output of a package?

You’d write a list, like: (list guile-3.0 guile-json).

Check out
<https://guix.gnu.org/manual/devel/en/html_node/Defining-Packages.html>
and related parts of the manual, and see
<https://guix.gnu.org/en/blog/2021/the-big-change/> for a longer
discussion.

> label 'openjdk' does not match package name 'openjdk:jdk'

You can ignore that; we should fix that ‘guix lint’ warning: it was
helpful with “old-style” inputs, but it wrongfully flags new-style
inputs, as in the example you give.

HTH!

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]