help-guix
[Top][All Lists]
Advanced

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

Re: Creating a package using two sources/origins


From: (
Subject: Re: Creating a package using two sources/origins
Date: Tue, 13 Dec 2022 06:17:04 +0000

Heya,

On Mon Dec 12, 2022 at 11:58 PM GMT, dabbede@gmail.com wrote:
> (define-public my-help
>   (package
>     (inherit hello)
>     (name "my-help")
>     (arguments
>       #~(modify-phases %standard-phases
>       (add-after 'unpack 'unpack-extra-sources
>         (lambda _
>           (copy-recursively #+xenomai-origin
>                             "extra-source-directory")))))))

Nope, that's not quite correct. Your ARGUMENTS should look like this:

  (arguments
   (list #:phases
         #~(modify-phases %standard-phases
             (add-after 'unpack 'unpack-extra-sources
               (lambda _
                 (copy-recursively #+xenomai-origin
                                   "extra-source-directory"))))))

You can think of ARGUMENTS as a bunch of keyword arguments to pass to the
procedure that runs the build.

> Finally, if not too much out of scope, can you explain me why the #+
> ungexp can accept an origin object instead of a package? I assumed
> from the documentation that gexp where used only to reference among
> derivation of packages.

You've seen a ``.drv'' path being printed out by the CLI, right?  They contain
instructions to build a store item.  Packages are /lowered/ into DERIVATIONs,
but so are ORIGINs, LOCAL-FILEs, COMPUTED-FILEs, and any other kind of
"file-like object" or "lowerable object", such as the object you create with
FILE-APPEND.  The thing they all have it common is that they all have a lowering
procedure defined using DEFINE-GEXP-COMPILER; you can see a few examples of that
in ``guix/gexp.scm'' and ``guix/packages.scm''.  So, you can use UNGEXP and
UNGEXP-NATIVE on anything that has been DEFINE-GEXP-COMPILERed, and its
derivation will be built and its store path substituted.

    -- (

Attachment: signature.asc
Description: PGP signature


reply via email to

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