unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: "Bonface M. K." <bonfacemunyoki@gmail.com>
Cc: help-guix@gnu.org, Pjotr Prins <pjotr2020@thebird.nl>
Subject: Re: How do you write a package's deps to a file?
Date: Tue, 01 Dec 2020 10:59:09 +0100	[thread overview]
Message-ID: <86y2ihvocy.fsf@gmail.com> (raw)
In-Reply-To: <86k0u1ga7x.fsf@gmail.com>

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


  reply	other threads:[~2020-12-01 10:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 16:25 How do you write a package's deps to a file? Bonface M. K.
2020-11-30 17:17 ` Julien Lepiller
2020-11-30 23:23   ` zimoun
2020-12-01  9:13     ` Bonface M. K.
2020-12-01  9:59       ` zimoun [this message]
2020-12-01 18:04         ` Bonface M. K.
2020-12-01  8:29   ` Bonface M. K.
2020-12-01  7:35 ` Efraim Flashner
2020-12-01  9:15   ` Bonface M. K.

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=86y2ihvocy.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=bonfacemunyoki@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=pjotr2020@thebird.nl \
    /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.
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).