From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [go-build-system] How to access properties or keys of a package on the build side? Date: Fri, 1 Sep 2017 13:15:57 -0400 Message-ID: <20170901171557.GA24977@jasmine.lan> References: <20170828185144.GA24652@jasmine.lan> <87d17fh5b6.fsf@elephly.net> <87bmmzh1qu.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnpY4-0002s3-Er for guix-devel@gnu.org; Fri, 01 Sep 2017 13:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnpXz-0004kv-LI for guix-devel@gnu.org; Fri, 01 Sep 2017 13:16:04 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:46527) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnpXz-0004k9-Dj for guix-devel@gnu.org; Fri, 01 Sep 2017 13:15:59 -0400 Content-Disposition: inline In-Reply-To: <87bmmzh1qu.fsf@elephly.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 28, 2017 at 10:32:41PM +0200, Ricardo Wurmus wrote: >=20 > Ricardo Wurmus writes: >=20 > > You could also access the arguments of another package with > > =E2=80=9Cpackage-arguments=E2=80=9D. Using the =E2=80=9Cproperties=E2= =80=9D field isn=E2=80=99t pretty because > > it is a free form alist. > > > > You can use =E2=80=9Cfind-tail=E2=80=9D to jump to the keyword in =E2= =80=9Carguments=E2=80=9D and then > > pick the following value. >=20 > Here an example: >=20 > --8<---------------cut here---------------start------------->8--- > (define (assoc-args-ref pkg key) > "Return the value associated with KEY in the arguments of package PKG, > or #F if there is no such key." > (let ((ref (find-tail (cut eq? <> key) > (package-arguments pkg)))) > (and=3D> ref second))) >=20 > (assoc-args-ref golang-github-com-audriusbutkevicius-go-nat-pmp > #:import-path) >=20 > =3D> "github.com/AudriusButkevicius/go-nat-pmp" > --8<---------------cut here---------------end--------------->8--- I didn't get very far in this direction before deciding to try another technique. But wouldn't this not work on the build side, since (guix packages) is not available there? I considered building an alist of store items and "import paths" and passing that into the build from the host side, but it started to feel like the wrong approach. Instead my latest approach [0] is to "record" the packages' import paths via their store items' filesystem layouts. [0] https://lists.gnu.org/archive/html/guix-devel/2017-08/msg00323.html --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlmplcoACgkQJkb6MLrK fwjAShAAldBgxZFzWUtJxRs//WUuYLziRu83Q6kSvBjZJ9gi9l4U94Pl2AVUS295 fAXAnjxCBYbo+tjtL61S/yJwqBV+k+iekEwFLXj0XyYylgQymLp6WI/0QgpsFoxr Hclm3l+qB/JagmCZETAfvqUEhiPC+qrjPPw6MIONF7ViF4Atb/BtvcXje5P1XEdr oQeEPfVh3y0te9+AqgAyeUUGhYjKL9SfwaxTIA8qZLN2peldVxYrYdwRt78vvnjM YVjXUIToAH8g18GFpmfR9QOUgTcxp3wLktnCDOZpaTEw0jX6WO70f2wu3us9eIek XUmRI+afG8Lqxgz55AsBUKylh2aek2E9hwHITkCP96e9ztOYecdAnwfdqZ8kUbCN uR+awXXxJC5dH5/SEyXRt+e4inkeHLDjI/pzz+7JqCbglD7GhITzihZj4UBFKPD1 Iwe8VR+zVgWH2EvdUY7OLi+MY/O07DB56NXIHm4tHojQOqq58jU9iQBZNn6XaHDI 0nwcfA2PCo8EDXb/xs/YUw0VF4dXU5akFQ5UdjNz+fsc/Ee2DRIbIOqow+LkjTeM rs4p8owYRBhp+5VIjRQ0l5AuJXpzuhxIxNwkbzcMuHrUCCd93PgxqUDvFOQwEgiX 4l2kvJEjikYCYYICMZSHFVUXgcDLKkiZlYOGuL3adHEKbJ2QhYI= =47sX -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--