[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do you write a package's deps to a file?
From: |
zimoun |
Subject: |
Re: How do you write a package's deps to a file? |
Date: |
Tue, 01 Dec 2020 10:59:09 +0100 |
Hi,
On Tue, 01 Dec 2020 at 12:13, "Bonface M. K." <bonfacemunyoki@gmail.com> wrote:
>> What do you want? Get the list of inputs and their metadata when typing
>> “guix install foo”? And this list becoming part of the outputs? Or
>> simply get somehow the list of inputs and their metadata? Which is
>> straightforward.
>>
>
> Yes! Ideally I want to get details of the package
> inputs, so that I could use that info to write to
> a file somewhere in the outputs dir. The end goal
> is to use that file to display (on some website)
> the dependencies the project has. So when you do,
> say, `guix install <my-awesome-package>`, as part
> of your outputs, you also generate a file that
> explicitly list the deps as part of your output ;)
>
>>
>> Well, I am interested by the answer of: is it possible to get the
>>
>
> I think Efraim's suggestion in this thread is more
> pragmatic ;)
The Efraim’s suggestion–also the Julien’s suggestion about use the
package data directly– is not what you are describing above. It is
“simply get somehow the list of inputs and their metadata, which is
straightforward.” :-)
Basically, first step you run “./pre-inst-env guix repl -- script.scm”
which contains ’package-inputs’ (or any other ’package-direct-inputs’,
’package-propagated-inputs’, etc.) with formatting and second step you
manually add to the package this generated file in one phase to get it
in the output.
The file ’script.scm’ is more or less one illustration in this blog
post:
<https://guix.gnu.org/en/blog/2020/reproducible-computations-with-guix/>
Now, is it possible to embed this first step in the package definition
as an extra phase and run it via ’invoke’ or similar?
(And I am still interested by the answer of «is it possible to get the
metadata of the inputs in phases?» :-))
All the best,
simon