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 sOG7JTEvQ2HyewEAgWs5BA (envelope-from ) for ; Thu, 16 Sep 2021 13:49:05 +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 0G6LITEvQ2EnSAAA1q6Kng (envelope-from ) for ; Thu, 16 Sep 2021 11:49:05 +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 1AA912B2DA for ; Thu, 16 Sep 2021 13:49:05 +0200 (CEST) Received: from localhost ([::1]:53460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQpt2-0003k1-47 for larch@yhetil.org; Thu, 16 Sep 2021 07:49:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQps2-0002ru-Sg for guix-patches@gnu.org; Thu, 16 Sep 2021 07:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQps2-0005u5-KQ for guix-patches@gnu.org; Thu, 16 Sep 2021 07:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mQps2-0007PX-JA for guix-patches@gnu.org; Thu, 16 Sep 2021 07:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50620] [PATCH 1/2] guix: packages: Document 'computed-origin-method'. References: <20210916114505.2686370-1-zimon.toutoune@gmail.com> In-Reply-To: <20210916114505.2686370-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Sep 2021 11:48: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: 50620@debbugs.gnu.org Cc: zimoun Received: via spool by 50620-submit@debbugs.gnu.org id=B50620.163179286728450 (code B ref 50620); Thu, 16 Sep 2021 11:48:02 +0000 Received: (at 50620) by debbugs.gnu.org; 16 Sep 2021 11:47:47 +0000 Received: from localhost ([127.0.0.1]:54003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQprm-0007Oo-OX for submit@debbugs.gnu.org; Thu, 16 Sep 2021 07:47:47 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:37816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQpri-0007OI-QE for 50620@debbugs.gnu.org; Thu, 16 Sep 2021 07:47:44 -0400 Received: by mail-wm1-f45.google.com with SMTP id c8-20020a7bc008000000b002e6e462e95fso7155170wmb.2 for <50620@debbugs.gnu.org>; Thu, 16 Sep 2021 04:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4IIHHqUhQKQN7CyJDFPM1+vkRqsNFbDxZrpo08ThJoE=; b=gzVAoT5CiOeWP08FXganZmDXcKbjS49S6I5IuX8ZswUghsPjR3s2fcSl7IZp6savip CQ03CcJnbOFh/Z079rIG+7fBIp2tJWtb76VCvNpfbUy7HsCTLMdNjzPpLKEnrJQEGKWH 9uW4JufNEKWl27seR3N+07NDkCCfppNwZSpaM+/Z/h5RqeIVMw5P8+Hoj67P6+5CtKSX OxB1wj3pN1vFh16MQ6h7Nf1r8QKdmgMNCGHVKBaJpJFUYryecxuJgb/JlFCJKJQJUxoa 9mS6LRfQIFaQbIoyYIAjHzJuAK1OG/As1LP/oXAtKLiQlU9/G5r/51g8hSKKz2baA/Mv Zn1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4IIHHqUhQKQN7CyJDFPM1+vkRqsNFbDxZrpo08ThJoE=; b=MIekmaO2gi76OToJVMAqxXOl8NCi95e16Gw78FfgCkgYjav0M28qw7T5R46uU2JfQ5 Lb8nrCxaxgb0wT4mWYr0+nM4aXVTiZ00tWCMZtVRhULhiFoudKfJKH///XtK1nVx6vTb yBNa8QMTgTHT652DNZBUTaia884P1VyNIgbqWHmRD3BMFEWT19BYSEt6d+5W+XifDiZX x5jRtcB5zDZaCWygafK/td63dhuyaN2xEC+Q7wdZLMp/pIWCS78xwh4C3sS33dTpB4Jj qmlkCjAMlFE4oeJBmqcu9qHJ7om1kIXN3qB9Hy7qflZX5zdsGcSEdU1SpCJqk8DxTrYf NrpA== X-Gm-Message-State: AOAM532OTPhZnpVfSZFNe4fg82IQuD3eNnqGAaKGgwdap45wUAzqSyK+ DNgwD5lwHYDKMtSfhfK2Er2RRfd9cCA= X-Google-Smtp-Source: ABdhPJx3nocB7am6mLjPKs5wMZ5ucb+6XXdGfqI7ejdaqa5BELSOsqukNYpXBF+qJG0yjJclNOuDFQ== X-Received: by 2002:a1c:2b04:: with SMTP id r4mr9535074wmr.89.1631792856995; Thu, 16 Sep 2021 04:47:36 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.117]) by smtp.gmail.com with ESMTPSA id l10sm3472519wrg.50.2021.09.16.04.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Sep 2021 04:47:36 -0700 (PDT) From: zimoun Date: Thu, 16 Sep 2021 13:47:33 +0200 Message-Id: <20210916114734.2686426-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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=1631792945; 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: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=GFkAHd/YFX8kbA3W42jj1gtDi6KBOeWSr97nPN2+wuE=; b=tWr44tr+/AaXBivC4CnLmv52MMW9xQf/bH1GtLVMrWd2/aF39iLCETWcOtZeZvHoB47FRt dohNLbvQIfDUJosdxsWNNTzD72TwNh88mZUK1doELxymaHUyPZQUgLcJpX5rLoDFoToAOK 0PYpsZIYAwJ0P8o9j+u3bNVBahBX/RY3Yh9NQXU5MzAU7KevX37z2VswXS5eLKd+emzbnV dNIWbtw/p4p6GQu1riFjFDWsO279XfbvT/deFwry9IKAyZFxQNyquaONLJZebZkuzpnPRM CpZOgWOXn8nl6mXkxNHBU4fRrN+gZPhyhJGV2qhNWcw1gPbO6r1TgDol8oSkfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631792945; a=rsa-sha256; cv=none; b=WvEAnju7wchAjtN3GLK6GG1R54Co4MkcITha8FejOmDAOiQDt8WxGq/dlzgLkfkv94Z2Zj ldPrJby4q+od5OivxTl2cvD/FQf2hmU3JqfiVMvDBru7Nr2rKyBpvd6FxSnB5yeB3KYI70 mStioC6rrgHs47QS0X0i6zLAS9HmsXZlqj45gpRa4FMFbEC8l28lX+oUDNwmqkkP45xAZe k7nVKgz4UT2U5U8Bx2mOJ4G2UYMAP2WpSb9F0VrcN8QYKEMkWgKofk99QfDQLLRMt2RpJX eIFvDiX2lyMsUmWaO74gfIUt1gK84SokrdfvKHeJ0bkaSbLhGUcofWXWzA+XHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=gzVAoT5C; 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: -1.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=gzVAoT5C; 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: 1AA912B2DA X-Spam-Score: -1.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: fckhr/Rwct7g 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 ;;; Copyright © 2015 Eric Bavier ;;; Copyright © 2016 Alex Kost ;;; Copyright © 2017, 2019, 2020 Efraim Flashner @@ -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 -- 2.32.0