From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YNXPJ0XyxV9pBwAA0tVLHw (envelope-from ) for ; Tue, 01 Dec 2020 07:35:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gKqTI0XyxV/VeAAAbx9fmQ (envelope-from ) for ; Tue, 01 Dec 2020 07:35:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0A80794051D for ; Tue, 1 Dec 2020 07:35:32 +0000 (UTC) Received: from localhost ([::1]:37362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk0CA-0007bF-M6 for larch@yhetil.org; Tue, 01 Dec 2020 02:35:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk0Bu-0007b3-7e for help-guix@gnu.org; Tue, 01 Dec 2020 02:35:14 -0500 Received: from flashner.co.il ([178.62.234.194]:59824) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk0Bq-00086x-Hp for help-guix@gnu.org; Tue, 01 Dec 2020 02:35:13 -0500 Received: from localhost (unknown [141.226.15.169]) by flashner.co.il (Postfix) with ESMTPSA id BF6BD402D4; Tue, 1 Dec 2020 07:35:08 +0000 (UTC) Date: Tue, 1 Dec 2020 09:35:06 +0200 From: Efraim Flashner To: "Bonface M. K." Subject: Re: How do you write a package's deps to a file? Message-ID: References: <86mtyyzuag.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qKHZgLamHEWZsy09" Content-Disposition: inline In-Reply-To: <86mtyyzuag.fsf@gmail.com> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Received-SPF: pass client-ip=178.62.234.194; envelope-from=efraim@flashner.co.il; helo=flashner.co.il X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org, Pjotr Prins Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.89 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 0A80794051D X-Spam-Score: -2.89 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: 5X7S3PEnIVwx --qKHZgLamHEWZsy09 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 30, 2020 at 07:25:11PM +0300, Bonface M. K. wrote: >=20 > 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: >=20 > #+begin_src scheme > (add-after 'install 'create-dependency-file > (lambda* (#:key inputs outputs #:allow-other-keys) > (call-with-output-file > (string-append > (assoc-ref outputs "out") > "/lib/python3.8/site-packages" > "/wqflask/DEPENDENCIES.txt") > (lambda (port) > (format > port " > #### System Inputs (generated from Guix) > |Name | Version | Home Page | Description | > |-----|---------|-----------|-------------| > |~a| > " > (apply > string-append > (map (lambda (input) > (let ((name (car input))) > (string-append > "| **" name "** | " > ,(package-version > (specification->package name)) " | " > ,(package-home-page > (specification->package name)) > " |" > ,(package-description > (specification->package name)) > " |\n"))) > inputs))) > )) > )) > #+end_src >=20 > That ^^ doesn't seem to work as I'd like it to. The output(truncated) > looks something like: > =20 > #+begin_src markdown > =E2=9E=9C guix git:(master) =E2=9C=97 cat ~/opt/python3-genenetwork2/lib= /python3.8/site-packages/wqflask/DEPENDENCIES.txt >=20 >=20 > #### System Inputs (generated from Guix) > |Name | Version | Home Page | Description | > |-----|---------|-----------|-------------| > || **python** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork = installation sumo. | > | **source** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork i= nstallation sumo. | > | **javascript-colorbox** | 3.11-guix-84cbf35 | http://genenetwork.org/ |= Genenetwork installation sumo. | > | **coreutils** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwor= k installation sumo. | > | **git** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork inst= allation sumo. | > | **which** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **grep** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork ins= tallation sumo. | > | **r** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork instal= lation sumo. | > | **r-ctl** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **r-qtl** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **r-wgcna** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork = installation sumo. | > | **redis** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **mariadb** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork = installation sumo. | > | **gemma** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **gemma-wrapper** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genene= twork installation sumo. | > | **plink-ng-gn** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetw= ork installation sumo. | > | **racket-minimal** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genen= etwork installation sumo. | > | **rust-qtlreaper** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genen= etwork installation sumo. | > | **nginx** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork in= stallation sumo. | > | **python-twint** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenet= work installation sumo. | > | **python-unittest2** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Gen= enetwork installation sumo. | > | **javascript-twitter-post-fetcher** | 3.11-guix-84cbf35 | http://genene= twork.org/ |Genenetwork installation sumo. | > | **javascript-cytoscape** | 3.11-guix-84cbf35 | http://genenetwork.org/ = |Genenetwork installation sumo. | > | **javascript-panzoom** | 3.11-guix-84cbf35 | http://genenetwork.org/ |G= enenetwork installation sumo. | > | **javascript-qtip** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Gene= network installation sumo. | > | **javascript-chroma** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Ge= nenetwork installation sumo. | > | **javascript-d3-tip** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Ge= nenetwork installation sumo. | > | **javascript-jscolor** | 3.11-guix-84cbf35 | http://genenetwork.org/ |G= enenetwork installation sumo. | > | **javascript-colorbox** | 3.11-guix-84cbf35 | http://genenetwork.org/ |= Genenetwork installation sumo. | > | **javascript-jszip** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Gen= enetwork installation sumo. | > | **js-jstat** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork= installation sumo. | > | **js-md5** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwork i= nstallation sumo. | > | **js-parsley** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genenetwo= rk installation sumo. | > | **javascript-plotly** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Ge= nenetwork installation sumo. | > | **javascript-typeahead** | 3.11-guix-84cbf35 | http://genenetwork.org/ = |Genenetwork installation sumo. | > | **js-underscore** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Genene= twork installation sumo. | > | **js-smart-time-ago** | 3.11-guix-84cbf35 | http://genenetwork.org/ |Ge= nenetwork installation sumo. | > | **javascript-nouislider** | 3.11-guix-84cbf35 | http://genenetwork.org/= |Genenetwork installation sumo. | > #+end_src >=20 > 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 closure from > which I can import the modules like say _(use (gnu > packages))_. How do I do that if that's the case? >=20 > Is it also possible to get the same information in > a fine grained manner, like say get the > propagated-inputs instead of getting /all/ inputs? >=20 I think it would be easiest to compute this outside the package definition and then add it as an input and just plop the precomputed file into place in a custom phase. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --qKHZgLamHEWZsy09 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl/F8iYACgkQQarn3Mo9 g1HydRAAppFcukrbT6kPujNjUfSS8ljtvp0DF/pPiPWWcS9MbMIberQeLqcGiIcZ baQ2L6aACsN0UxL4aAfbxmiA+MM13CODnEzhnpN9sFcrr2S8GDU1hrDk8xMRbr20 Utg9RQdLq4KsnKu3NWLKO+UiTf4N+iTnReT84QphH5T7MwaEztEthqQ31hvrLW2c oiNBNHjlj3pIc/6UewFijMCdBI/R+aM6dO1Drg63QBRvwwILroBBPIitrce5s3rV YP8Bj4CSyaSVHNcEadkOiGdb5HvuTN1GGfZvfnCz7ensFyIVomfNIfUNYsaPG3qx vhTFCU66eyirwNc8blZ2wfIEKCKDJvfCFqcr0XQG94dpsyjnWekbm6ysrwHJ1bf0 xQKJv/UmSJU/iP8rCbeqk2v4tfJcO7NDg+M9SFsnVCDglPhEZTcKR9ySt8N67w5k nKeXmLveWv6M5CiYdij6xiK3o4bNhxVoSuGEi9uyq6ZI7puF7FQuWSuGxZ1EY7y+ 7Ytjq24WhQp8q000uFHzpL3lh9cEMZ0M9W6IZUiF95ZRT/L3sLdmYEdLwbyHrMxI 4CpvZyS9fRZYMiibmSadxyHX17LNUd5Sn8tAunt982h3138zit2uN1PNSxiABn6e xZf50ieYQJ3O5SoCt0dCJQ/fRbnE7GV9pzT58zcmFlfYW+01bdQ= =3d2A -----END PGP SIGNATURE----- --qKHZgLamHEWZsy09--