[Top][All Lists]

[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: Bonface M. K.
Subject: Re: How do you write a package's deps to a file?
Date: Tue, 01 Dec 2020 21:04:22 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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 definition and no where else. Stumbled
across that when poring through some guix package
definitions, moreso skriblio.

Here's my working phase:
--8<---------------cut here---------------start------------->8---
(add-after 'install 'generate-dependency-file
                 (lambda* (#:key inputs outputs #:allow-other-keys)
                        (assoc-ref outputs "out")
                     (lambda (port)
                        port "
#### System Inputs (generated from Guix)
|Name | Version | Home Page | Description |
                           (lambda (input)
                             (let* ((pkg (cadr input))
                                    (name (package-name pkg))
                                    (version (package-version pkg))
                                    (home-page (package-home-page pkg))
                                    (description (package-description pkg)))
                                "| **" name "** | "
                                version " | "
                                home-page " | "
                                description " | "
                                " |\n")))
                              (package-propagated-inputs this-package)))))
--8<---------------cut here---------------end--------------->8---

Bonface M. K. <>
Chief Emacs Bazu / Rieng ya software sare
Mchochezi of: <> / Twitter: @BonfaceKilz
GPG Key: D4F09EB110177E03C28E2FE1F5BBAE1E0392253F

Attachment: signature.asc
Description: PGP signature

reply via email to

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