From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id /NsuDXNtQ2GrewAAgWs5BA (envelope-from ) for ; Thu, 16 Sep 2021 18:14:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oFZWCHNtQ2H2BAAA1q6Kng (envelope-from ) for ; Thu, 16 Sep 2021 16:14:43 +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 58B091738 for ; Thu, 16 Sep 2021 18:14:42 +0200 (CEST) Received: from localhost ([::1]:57892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQu25-0000sx-Au for larch@yhetil.org; Thu, 16 Sep 2021 12:14:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQti6-0002YV-Kf for guix-patches@gnu.org; Thu, 16 Sep 2021 11:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQti6-00050Z-C3 for guix-patches@gnu.org; Thu, 16 Sep 2021 11:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQti6-0006Lv-7s for guix-patches@gnu.org; Thu, 16 Sep 2021 11:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50620] [PATCH 1/2] guix: packages: Document 'computed-origin-method'. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Sep 2021 15:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun , 50620@debbugs.gnu.org Received: via spool by 50620-submit@debbugs.gnu.org id=B50620.163180762024373 (code B ref 50620); Thu, 16 Sep 2021 15:54:02 +0000 Received: (at 50620) by debbugs.gnu.org; 16 Sep 2021 15:53:40 +0000 Received: from localhost ([127.0.0.1]:56285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQthj-0006L3-Jw for submit@debbugs.gnu.org; Thu, 16 Sep 2021 11:53:40 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQthe-0006Kj-UC for 50620@debbugs.gnu.org; Thu, 16 Sep 2021 11:53:38 -0400 Received: by mail-wm1-f66.google.com with SMTP id 70so2242728wme.5 for <50620@debbugs.gnu.org>; Thu, 16 Sep 2021 08:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=vY1Of2b2Rph2qBPgIbgurnbrBvLf2E/MS4GQOpN37zs=; b=kukFGj4jAkp79g79rOWazimPpVsCfK6N+4BGMfJxmDOCJyynJZPsLkadQYspX8FatR k7ndbmq1u9Sor95gZx3dkP7TEKbWiu1UhxV6y4qj3VjIP2BMw4sANcMeRjq2GqKHyDqH qgIIWsfLtSVgKVkSKpQ5WK9s9b45Dgih1HOLj6hfnWogYEJQq1XDDM61uNeIKYBtRZXw fvtvs58TV1wixQ9zhLm8ctm/4zNvcikc8YW1SSgDXP+IEDFqb6370LDKjm/pX7Nti/Wo yXB6YriPD0VNbJCzqPBjCi7U9HKeqNc6eRB4NG786XzPj6yRIpuHOt80aeYbK3YDGUIi XWsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=vY1Of2b2Rph2qBPgIbgurnbrBvLf2E/MS4GQOpN37zs=; b=Bag4yn0zrMBts7J8DHjEB2Ed03ARFW6rAE1LkE7lVkSN9u9S8E8vyO6WXw6t1Ba+LX 6u/y20RPQ9HhgGbPPrg1W+UBdMgr1RWcYh0mlcYeJGB+ypTp485pERH28AxRxnxYLIGx gGtxQwfxb99AitH+Iq0I8wmGWZ2aLGEL0+bNIpbUK+P/BtiBKG+MwSkdKaV2ffgHa74q ix8nzaMd/kt7gIoUFOFitcrUvpw4fDmq3PhTUGJTk6iSn4qNCCGunXow9EwMIRkAmjyL VLLRzK6DFMqJ2Uq9EVOfqt7wpoP07HFyP5R38Sw7OhBhB++oqweOwGZ47F/1oZZPHU/D 4lkg== X-Gm-Message-State: AOAM5323dGJN4abX8B1Ui77aWmyHWrd6irHYvf848JCOs9hr6m77Bdfc pFiHLKsGPHEJbNyYiVqo47k= X-Google-Smtp-Source: ABdhPJx4NfjDmjiJkXn2QtCqKkgwh89uXOZi+xvYgyn1i2pmwWiaEXhiXqc4u9J+UCZZNi8vyEX1tA== X-Received: by 2002:a05:600c:20c:: with SMTP id 12mr5704328wmi.90.1631807608731; Thu, 16 Sep 2021 08:53:28 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id o17sm3941304wrj.96.2021.09.16.08.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 08:53:27 -0700 (PDT) Message-ID: <9b6ee27ff10e1042a5d61d0f93d957cf760e9ecb.camel@gmail.com> From: Liliana Marie Prikler Date: Thu, 16 Sep 2021 17:53:26 +0200 In-Reply-To: <20210916114734.2686426-1-zimon.toutoune@gmail.com> References: <20210916114734.2686426-1-zimon.toutoune@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631808882; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=vY1Of2b2Rph2qBPgIbgurnbrBvLf2E/MS4GQOpN37zs=; b=o9LCYgneADH6URPdBqeeDKsygnfh8LH0ZRHhQJgItvVobBEQPVCCZDG+XkntqYAlK/3ZLw 1OzRAviEUW6jBr74Aly+F/udgj9Lk3zHr6I8xv5Atzcsk4Mtm8FfC2iJdaMJYuDpNzo/et Qjlrfyduyikn3aK8LN9ziN6m9y7WYZ3smAIckE5Tq8tsknmNi5n87I4875boYwQhNwevgG v9w7HqxeV+oQRJ3/28Bx9puex3/p3hm7ptZ6rvUqLjxpMrk/6t47C96bUfEsn28rpe9fL1 3dzhSODnybMe5zdRYayOwEULrBrOk7GNweNZcglc4ljYzdz9pVcw57dK/8D6jw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631808882; a=rsa-sha256; cv=none; b=cK0J4XAVKx1+DsITCtXsrMxT8VF2aIg7jA8k2dGbJv9GTqvxwBsBMOFjidl4zEAwO3oS4t 7VX3qXc7MvbF5gflw94tNKA9uFCvNcdc9pLunDSqvHXwqXmWsCJVZWQsJeDM6AYau2O1qQ bMq2GZHaG3eTTRcbI1UUEEIyc8ZuKLz2rLV8d2NuvChaLiSevUZNYxdEZ3y9eUwkZ45BXv fEm0NJTPd+7lDTNlUiajP9C4NYQ1FwRWSc0G3oSciFo8TeivaAJUnr04UYZ1WgCHFifPT9 gqrfDYswZ791XIVSm6ycWA4GNMnyoqCswdwaHOgwnGFiH9AHP7Mici4ggaGjzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kukFGj4j; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 0.20 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kukFGj4j; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 58B091738 X-Spam-Score: 0.20 X-Migadu-Scanner: scn0.migadu.com X-TUID: ayKsj726bQaO Hi, Am Donnerstag, den 16.09.2021, 13:47 +0200 schrieb zimoun: > The 'computed-origin-method' had been introduced as a workaround > limitations in the 'snippet' mechanism. The procedure is duplicated > which makes hard to automatically detects packages using it. > > * guix/packages.scm (computed-origin-method): Move procedure from... > * gnu/packages/gnuzilla.scm: ...here and... > * gnu/packages/gnuzilla.scm: ...there. > --- > gnu/packages/gnuzilla.scm | 14 ++------------ > gnu/packages/linux.scm | 14 ++------------ > guix/packages.scm | 23 ++++++++++++++++++++++- > 3 files changed, 26 insertions(+), 25 deletions(-) > > diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm > index 431b487fd0..9f6e1f24e1 100644 > --- a/gnu/packages/gnuzilla.scm > +++ b/gnu/packages/gnuzilla.scm > @@ -682,18 +682,8 @@ in C/C++.") > ("1j6l66v1xw27z8w78mpsnmqgv8m277mf4r0hgqcrb4zx7xc2vqyy" > "527e5e090608" "zh-CN") > ("1frwx35klpyz3sdwrkz7945ivb2dwaawhhyfnz4092h9hn7rc4ky" > "6cd366ad2947" "zh-TW"))) > > -(define* (computed-origin-method gexp-promise hash-algo hash > - #:optional (name "source") > - #:key (system (%current-system)) > - (guile (default-guile))) > - "Return a derivation that executes the G-expression that results > -from forcing GEXP-PROMISE." > - (mlet %store-monad ((guile (package->derivation guile system))) > - (gexp->derivation (or name "computed-origin") > - (force gexp-promise) > - #:graft? #f ;nothing to graft > - #:system system > - #:guile-for-build guile))) > +;; XXXX: Workaround 'snippet' limitations. > +(define computed-origin-method (@@ (guix packages) computed-origin- > method)) > > (define %icecat-version "78.14.0-guix0-preview1") > (define %icecat-build-id "20210907000000") ;must be of the form > YYYYMMDDhhmmss > diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm > index 285eb132f4..eb792be9a3 100644 > --- a/gnu/packages/linux.scm > +++ b/gnu/packages/linux.scm > @@ -216,18 +216,8 @@ defconfig. Return the appropriate make target > if applicable, otherwise return > (file-name (string-append "linux-libre-deblob-check-" > version "-" gnu-revision)) > (sha256 deblob-check-hash)))) > > -(define* (computed-origin-method gexp-promise hash-algo hash > - #:optional (name "source") > - #:key (system (%current-system)) > - (guile (default-guile))) > - "Return a derivation that executes the G-expression that results > -from forcing GEXP-PROMISE." > - (mlet %store-monad ((guile (package->derivation guile system))) > - (gexp->derivation (or name "computed-origin") > - (force gexp-promise) > - #:graft? #f ;nothing to graft > - #:system system > - #:guile-for-build guile))) > +;; XXXX: Workaround 'snippet' limitations > +(define computed-origin-method (@@ (guix packages) computed-origin- > method)) > > (define (make-linux-libre-source version > upstream-source > diff --git a/guix/packages.scm b/guix/packages.scm > index ad7937b4fb..8c3a0b0b7b 100644 > --- a/guix/packages.scm > +++ b/guix/packages.scm > @@ -1,6 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, > 2020, 2021 Ludovic Courtès > -;;; Copyright © 2014, 2015, 2017, 2018 Mark H Weaver > > +;;; Copyright © 2014, 2015, 2017, 2018, 2019 Mark H Weaver < > mhw@netris.org> > ;;; Copyright © 2015 Eric Bavier > ;;; Copyright © 2016 Alex Kost > ;;; Copyright © 2017, 2019, 2020 Efraim Flashner < > efraim@flashner.co.il> > @@ -344,6 +344,27 @@ name of its URI." > ;; git, svn, cvs, etc. reference > #f)))) > > +;; Work around limitations in the 'snippet' mechanism. It is not > possible for > +;; a 'snippet' to produce a tarball with a different base name than > the > +;; original downloaded source. Moreover, cherry picking dozens of > upsteam > +;; patches and applying them suddenly is often impractical; > especially when a > +;; comprehensive code reformatting is done upstream. Mainly > designed for > +;; Linux and IceCat packages. > +;; XXXX: do not make part of public API (export) such radical > capability > +;; before a detailed review process. > +(define* (computed-origin-method gexp-promise hash-algo hash > + #:optional (name "source") > + #:key (system (%current-system)) > + (guile (default-guile))) > + "Return a derivation that executes the G-expression that results > +from forcing GEXP-PROMISE." > + (mlet %store-monad ((guile (package->derivation guile system))) > + (gexp->derivation (or name "computed-origin") > + (force gexp-promise) > + #:graft? #f ;nothing to graft > + #:system system > + #:guile-for-build guile))) > + > > (define %supported-systems > ;; This is the list of system types that are supported. By > default, we I think that rather than putting this into (guix packages) itself, we might want to put it into its own file like (guix computed-origins) and choose a method name that is actually a verb, similar to git-fetch or svn-fetch. Perhaps simply call it compute-origin? If done this way, there'd be the benefit that modules with packages using this thing would have to explicitly request the presence of the symbol through their use-modules clauses. WDYT?