From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mBtrMaLjzWbVQAAA62LTzQ:P1 (envelope-from ) for ; Tue, 27 Aug 2024 14:33:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mBtrMaLjzWbVQAAA62LTzQ (envelope-from ) for ; Tue, 27 Aug 2024 16:33:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lKFyfPsU; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1724769186; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=KOXqx/syuS2znpzQ+70xrehfpZmUk38h7IGCccrvbn4=; b=IR2EkZOCx9KKhU6gf6n9vX/Ez9pdLLUP1BF7dSD5ZHr4NRehjszZVfysxLMGsKn6nlittx n9ENcmUV00Zs+pwfbUThEFl8HHcaQFFUFSQbk61NVB0AOWW0762BiRU7itWTmncNyWYn0H 2V3QSaBttW7I7e+OvZCI5v0Ss0fq0T+FZCVme7Q3CxopyJr2BCRn5R1O4n311wzbYJX3GE vaTZ89EWNrz4sstVgO7kXU/7JUA/tRafLmrMqWtP1shYs0P0GX211RxsU2kACRx4iFDDem 8D2OZUI1J9lfyD8WPR84KlcPPzPGPhAr6HdnzS9GkOU65bhrg2D59vUz78M01Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lKFyfPsU; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724769186; a=rsa-sha256; cv=none; b=J889XtYrg4vyVGkpfO6Gp4O0YC5T4+esO13VswXX7K0js/I6NO6vok5iutL3cOImmaqsUK Nhg3l8mhSSoLrVWfljxRfnZh31pjPrzSKavwQHdFrsidbgQXt1mDz6h8CTqOdORyBfCMrt 7qhPLXYcTVB9jDB24SXrJhORaFwolK1fjbcj4Nz4ZEeVYZo9SeVeZ/vba6ZCAWHhlEUSyl 2npV689AFWczWiY6PxEEsouF4UyQsRK/o6lfuQnizYTlaqfBgVmx9BZz/LwOSYWD08LTlU IgBixshjM7rjxQ4yZCDnt3JTcQ6K89a8OI25Cju6Q1kpceNV/Kaz6AsdUofYpg== 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 66A7E6D445 for ; Tue, 27 Aug 2024 16:33:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sixFI-0003Zn-Bg; Tue, 27 Aug 2024 10:32:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sixFH-0003ZS-6b for help-guix@gnu.org; Tue, 27 Aug 2024 10:32:31 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sixFF-0004sC-7q for help-guix@gnu.org; Tue, 27 Aug 2024 10:32:30 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42817f1eb1fso49593175e9.1 for ; Tue, 27 Aug 2024 07:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724769147; x=1725373947; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KOXqx/syuS2znpzQ+70xrehfpZmUk38h7IGCccrvbn4=; b=lKFyfPsUKAiyJ/gP3Z4i7ddilGEtN3ozcS1/QgXJl5dbMkan5maP3WjkAVBJ+d0ooP TRUFbRQF8ml50JeTUYrU9hNKbNDUz2XDYBdFSSOdiBGbT/fyMg8QGlVfuZp7EiDyQTmD WbUC+RwW6MfXGrwbZxKuL/0apeAQ3ag0kwd218fUEPvJA/9rnS6A1hTeT3zcCSNT3LkT i+PyroVuKl+9LuC9U+ItpKAIkKZcd7RUWfOEI1AeUVXQv/E/eXvSTs3bSMiYg/NTm/jm sCfrfzzOT2jeLKbLAivvsOTA2CKERstAzMQQZabKB9toODzj6quqgCH/yilrRUUZP3mV Pd+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724769147; x=1725373947; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KOXqx/syuS2znpzQ+70xrehfpZmUk38h7IGCccrvbn4=; b=s53kHNd/VHPn+pFEo/qaHyM/0RqssLPiSWy9uS6mBkkdDX0GriTjbBlTinMFpSHdI2 w2KLgRdXwsAK1+N1MMrvn/tJkZtY1qKduSRcfox6lwK2su+DfrOhHJXb9UsJ9Zm0Z17K tN66ePMPOmj0NJ/EFY1cOChv+Gr6Iku21Oy/32AkmIFM0c3vfC5g8eknMhpGEL7PwlxM cA/ZiF0wHllZZ9bMAPvGa6xwniOpBJVIoQsHt2YmeDqkdMzJY31w/14it2HO3h3NEeEy BdYaFMNCy+j3yYFL2qoo3SeN8G0D+SBf108UDh6g/ZEp7gfq78fsL387oUwHDWR8AxIa O80Q== X-Gm-Message-State: AOJu0YxiPqfLN6OUuNck7G037hUplAO9wI7nDlLBUziPAqPX0ONgt+YL 26Tq/zhmFehL+E6RbR0VyUu6bMfgkcQ1sDmG1p580k5TSvO53mCZFJfDVw== X-Google-Smtp-Source: AGHT+IGnvOamk4mxvjGC5yAFSxaWsWFEfJT9Uc55EA/lLaBrcdA5tKq5JM4GiIG184V3uTgj/7qUNw== X-Received: by 2002:a05:600c:1f87:b0:421:7bed:5274 with SMTP id 5b1f17b1804b1-42acc8ddcdcmr110356905e9.10.1724769147117; Tue, 27 Aug 2024 07:32:27 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:33a5:6ba2:89d2:54ee]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42b9e7b7f87sm15876735e9.1.2024.08.27.07.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 07:32:26 -0700 (PDT) From: Simon Tournier To: Christoph Buck , Ian Eure Cc: help-guix@gnu.org Subject: Re: Apply a patch to a given package definition In-Reply-To: <87ed6jy2pj.fsf@icepic.de> References: <87sev0sz4k.fsf@icepic.de> <87ikvw3y2u.fsf@meson> <87ed6jy2pj.fsf@icepic.de> Date: Tue, 27 Aug 2024 16:19:53 +0200 Message-ID: <87a5gy82uu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.80 X-Migadu-Queue-Id: 66A7E6D445 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.80 X-TUID: LO96FG7/SyiX Hi, On Tue, 20 Aug 2024 at 11:15, Christoph Buck wrote: > By chance, do you know if a transformation would also work and if so, > how? Yes. Roughly and quickly, =E2=80=99inherit=E2=80=99 is only a macro that c= opies all the record fields. Other said, (package (inherit foo) =E2=80=A6) creates a new =E2=80=99package=E2=80=99 record where all the fields of =E2= =80=99foo=E2=80=99 are copied expect the ones defined by =E2=80=99=E2=80=A6=E2=80=99. Therefore, that de= fines a package and this package can be manipulated as any other packages. At the command-line, the derivations of one package and the same with a transformation. --8<---------------cut here---------------start------------->8--- $ guix build -d hello /gnu/store/qr00sgbh3vwwqswmgjjymg6wkys9r4i2-hello-2.12.1.drv $ guix build -d hello --without-tests=3Dhello /gnu/store/rfxhb9z4vrdp1hhhq96qh13wyfkrmapf-hello-2.12.1.drv --8<---------------cut here---------------end--------------->8--- Using the REPL, let start with the case where all the fields are copied without any modification. --8<---------------cut here---------------start------------->8--- $ guix repl GNU Guile 3.0.9 Copyright (C) 1995-2023 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guix-user)> ,use(gnu packages base) scheme@(guix-user)> ,use(guix packages) scheme@(guix-user)> (define hey (package (inherit hello))) scheme@(guix-user)> hey $1 =3D # --8<---------------cut here---------------end--------------->8--- As you can see, the variable =E2=80=99hey=E2=80=99 is just a =E2=80=99packa= ge=E2=80=99. And since all the record fields are the same as the ones of =E2=80=99hello=E2=80=99, the = both derivations are exactly the same. --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,lower hey $2 =3D # /gnu/store/6fbh8phmp3izay6c0dpggpxhcjn4xlm5-hello-2.12.1 7ee6f93= cd050> scheme@(guix-user)> ,lower hello $3 =3D # /gnu/store/6fbh8phmp3izay6c0dpggpxhcjn4xlm5-hello-2.12.1 7ee6f93= cd050> --8<---------------cut here---------------end--------------->8--- So far so good! Now, let apply some transformation as described in the manual by =E2=80=9C(guix) Defining Package Variants=E2=80=9D [1]. --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> ,use(guix transformations) scheme@(guix-user)> (define (transform p) ((options->transformation `((with= out-tests . ,(package-name p)))) p)) scheme@(guix-user)> (package-arguments (transform hey)) $4 =3D (#:tests? #f) --8<---------------cut here---------------end--------------->8--- And the derivation reads: --8<---------------cut here---------------start------------->8--- scheme@(guix-user)> (transform hey) $5 =3D # scheme@(guix-user)> ,lower $5 $6 =3D # /gnu/store/w6003221bya21djwrbp9adqyykhsljii-hello-2.12.1 7ee6f89= 21550> --8<---------------cut here---------------end--------------->8--- Which is the same as above. Hope that helps, simon 1: https://guix.gnu.org/manual/devel/en/guix.html#Defining-Package-Variants