From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Parameterized packages Date: Fri, 17 Jan 2020 17:41:15 +0100 Message-ID: <877e1q11ec.fsf@ambrevar.xyz> References: <8736ldq74z.fsf@netris.org> <20190719202906.lbanx5puk7t6q4cr@cf0> <87a7753boq.fsf@ambrevar.xyz> <87h813wah0.fsf@gnu.org> <87v9piut40.fsf@ambrevar.xyz> <87o8v5ukgb.fsf@ambrevar.xyz> <87d0blhr9s.fsf@ambrevar.xyz> <20200116190644.uytvzvypuvdwh2iq@n0> <875zhbvzfz.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47233) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isUgU-0002HI-Jn for guix-devel@gnu.org; Fri, 17 Jan 2020 11:41:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isUgR-0006o0-0p for guix-devel@gnu.org; Fri, 17 Jan 2020 11:41:22 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:37893) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isUgQ-0006mS-RG for guix-devel@gnu.org; Fri, 17 Jan 2020 11:41:18 -0500 In-Reply-To: <875zhbvzfz.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> 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-mx.org@gnu.org Sender: "Guix-devel" To: =?utf-8?Q?Nicol=C3=B2?= Balzarotti , ison , zimoun Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Nicol=C3=B2, Yes, you are exactly right. I didn't know Nix had it, that's great to hear! Would you happen to know where those USE flags are implemented? > Taking handbrake[1] recipe as an example: there's the useGtk flag that > can be passed to the package definition, and that affects build > options. Since in guix dependencies build inputs are specified inside > the package definition, propagating those flags should be easy. If we > standardize on flags names (don't have "-X", "noX", "disable-x"...), it > should be easy to incrementally add flags support to all package > dependencies. I imagine (with an invalid syntax probably) something > like: > > (inputs > `(,(unless (member build-flags 'no-x) ("libx11" libx11)) > ; this package always need x, don't pass flags > ("input" ,input "out" (filter (lambda (x) (not (eq? x 'no-x))) build-fl= ags)) > ("other-input" ,input))) ; flags are passed implicitly here? Some questions arise though: =2D What about passing parameters to implicit dependencies, e.g. those of the build system? =2D Consider the following case: With package A depending on B depending on C, to get parameter X on A we need to enable X on C. I guess the workaround is to include "C with parameter X" as an explicit input of A. Hmm... =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl4h46sACgkQm9z0l6S7 zH+iHQf/eOSm5UZIBDcD6XyrjfG2v1NhFHw84dF24UkJSw/DHSbsOoMvj/K73Idc +hCGA0vgPUR36ox4N4KVyKcesyFHZo1fz6SEzecfxW+NRR3wS/KWseKoLvpKG+SA s6z7PYVpMWVYNJ3BgABKDXNHkVA9ges2alkTZIuIWpfeBj9a3qqIgCSB0mV8JBjs XEbkdzE6WjIiR/0mx72LVCg/jPbOsq2Ts6JaqfUYofhG72gsmK6bDv3DThdvZv1l ezVLMbIYyUOrix9L+DVKIfM8ZxOkkOXYlJCqciQBlXdQ5Gy/53+YV6Fq9fpR7p9n zrn3Q9/hCL9PVwBYULUV4JTiwbYXeg== =SCfi -----END PGP SIGNATURE----- --=-=-=--