Re: How do you write a package's deps to a file?

2020-12-01 Thread Bonface M. K.
Hi all! Was finally able to hack something that works! See below: zimoun writes: > > (And I am still interested by the answer of «is it possible to get the > metadata of the inputs in phases?» :-)) > Yes it's possible. The trick is to use "this-package" which can *only* be used inside a package

Re: How do you write a package's deps to a file?

2020-12-01 Thread zimoun
Hi, On Tue, 01 Dec 2020 at 12:13, "Bonface M. K." 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.

Re: How do you write a package's deps to a file?

2020-12-01 Thread Bonface M. K.
Hi Efraim! Efraim Flashner writes: [...] >> Notice that the version, home page and description >> are repeated across rows. Herein lies my question: >> How would you fetch the details of the inputs(like >> version, home-page, description) etc etc from a >> modifed phase. Do I need to create a cl

Re: How do you write a package's deps to a file?

2020-12-01 Thread Bonface M. K.
Hi! zimoun writes: [...] > …I am not convinced it is the right level to extract the > information you need since ’input’ is, e.g., > > ;;; (("source" . > "/gnu/store/hbdalsf5lpf01x4dcknwx6xbn6n5km6k-hello-2.10.tar.gz")) > ;;; (("grep" . "/gnu/store/yhqc5imq7sn2sf9f48dj4gk12y4kw4s4-grep-3.4"

Re: How do you write a package's deps to a file?

2020-12-01 Thread Bonface M. K.
Hi! Julien Lepiller writes: > The reason you always get the same data is because > you're assigning "name" inside the sexp > (build-side), but you're using it inside tge > unquote (host-side), so it refers to the name of > the package you're building. > Ah yes! I see that now. Silly me ~.~ > I

Re: How do you write a package's deps to a file?

2020-11-30 Thread Efraim Flashner
On Mon, Nov 30, 2020 at 07:25:11PM +0300, Bonface M. K. wrote: > > Hi guix! I want to output the deps of a package to > a writable file. Like say the "hello" world > package, I'd like to insert a file after, say the > install phase, so that later I could parse it and > serve it from a website. Her

Re: How do you write a package's deps to a file?

2020-11-30 Thread zimoun
Hi, >>#+begin_src scheme >>(add-after 'install 'create-dependency-file >> (lambda* (#:key inputs outputs #:allow-other-keys) [...] >> (map (lambda (input) >>(let ((name (car input))) (pk i

Re: How do you write a package's deps to a file?

2020-11-30 Thread Julien Lepiller
The reason you always get the same data is because you're assigning "name" inside the sexp (build-side), but you're using it inside tge unquote (host-side), so it refers to the name of the package you're building. I think you're doing it wrong, because some input names have no corresponding pac

How do you write a package's deps to a file?

2020-11-30 Thread Bonface M. K.
Hi guix! I want to output the deps of a package to a writable file. Like say the "hello" world package, I'd like to insert a file after, say the install phase, so that later I could parse it and serve it from a website. Here's a snip of what I have: #+begin_src scheme (add-after 'install 'create-