From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sGO+KMxNMWWAEgEA9RJhRA:P1 (envelope-from ) for ; Thu, 19 Oct 2023 17:39:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sGO+KMxNMWWAEgEA9RJhRA (envelope-from ) for ; Thu, 19 Oct 2023 17:39:56 +0200 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 288AD4525F for ; Thu, 19 Oct 2023 17:39:56 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697729996; a=rsa-sha256; cv=none; b=uycOshUYTn7awqN/6mN/GIFLRqpLeDeECNJZYKxbzWAVEM5a4TmBtZJ8hkw5YWBT4BvSzS pz36i4jcRPsDYKyLB8okS6MnPiESg7LYS7Kp0J9G+iAJabVbMc4X0SDHbB7Hack/YBFLdK mbSaTC6cE+75Jyo/wYPS+25X9b1l+J+GDaz5PTXq3KeLYWUL+9WUATnSmNQ7nrWV88oqwd oOWzeFurte2HgVwUX0Bn0etaldmmHn9VPREVTd6I5kHDznkJ4/4W8FI6rjxQbYNzAGtWpe ttfZ9fU35oBEzpBOYP/UjEBxijH70mdVfMq7QRUAMtJ+l7j69wNrMWLNdjd1Vg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697729996; 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; bh=L3pYmpG3vKDM9m2YmangFkh9ajiFeXCyxmcctSnBhAc=; b=FppL2NSZHj6TSTD0+QDnTXmI84z8R1fuma+8QB2BMVogPDoGgIUlHrqJgrQrKotG1wpoRy PZrQMTErqmt6z6OiGezFFxc0lxPrtoNsgD3PJ6HNfJUEHTaB3BOBPDGILij9yYSTNcMa+b n+N79bYB9HNrKMIaCmsPqJ736LItPlYlsi/U9AJbYmEX+gKwJiQLO6YivbuQwWp+4lt+W5 s5vSY0GqddpMZ6s5eJ5yxvPXQjZARyNKOdRARbRMFzmkDGMo9mQdM5GFeNOztlERV62Ac4 kbR6olXiFG6BAK/mV0nKejFjZ54HA3nuPPkhBTTKhDPwflXMEeT1aX5MYs6iTQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtV7b-0001AT-GO; Thu, 19 Oct 2023 11:39:39 -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 1qtV7X-0001A5-PO for guix-patches@gnu.org; Thu, 19 Oct 2023 11:39:35 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtV7X-0001Ie-0C for guix-patches@gnu.org; Thu, 19 Oct 2023 11:39:35 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtV7x-0005nJ-KJ for guix-patches@gnu.org; Thu, 19 Oct 2023 11:40:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66500] [PATCH core-updates v2 1/3] build: copy-build-system: Allow specifying different output labels. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Oct 2023 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66500 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66500@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 66500-submit@debbugs.gnu.org id=B66500.169772994322191 (code B ref 66500); Thu, 19 Oct 2023 15:40:01 +0000 Received: (at 66500) by debbugs.gnu.org; 19 Oct 2023 15:39:03 +0000 Received: from localhost ([127.0.0.1]:37520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtV71-0005lq-0s for submit@debbugs.gnu.org; Thu, 19 Oct 2023 11:39:03 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:50406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtV6v-0005l2-Lp for 66500@debbugs.gnu.org; Thu, 19 Oct 2023 11:38:58 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 4B21F20C0F for <66500@debbugs.gnu.org>; Thu, 19 Oct 2023 17:38:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id AB39980092; Thu, 19 Oct 2023 17:38:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yZ_avWB8pKeX; Thu, 19 Oct 2023 17:38:26 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 156D38005B; Thu, 19 Oct 2023 17:38:26 +0200 (CEST) From: Bruno Victal Date: Thu, 19 Oct 2023 16:38:18 +0100 Message-ID: <776246775170b3e26211c28d52dffadc4c076ffc.1697729341.git.mirai@makinata.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -5.16 X-Spam-Score: -5.16 X-Migadu-Queue-Id: 288AD4525F X-TUID: ObZ/AQCyGjRV * guix/build/copy-build-system.scm: Introduce '#:output' parameter to specify which output label to use for a given rule. * doc/guix.texi (Build Systems): Document it. --- doc/guix.texi | 6 ++++++ guix/build/copy-build-system.scm | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4afe1af6c0..4f6c4ce67a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9460,6 +9460,9 @@ Build Systems If both inclusions and exclusions are specified, the exclusions are done on top of the inclusions. @end itemize +@item When a package has multiple outputs, the @code{#:output} argument +can be used to specify which output label the files should be installed +to. @end itemize In all cases, the paths relative to @var{source} are preserved within @var{target}. @@ -9476,6 +9479,9 @@ Build Systems @file{share/my-app/sub/file}. @item @code{("foo/sub" "share/my-app" #:include ("file"))}: Install @file{foo/sub/file} to @file{share/my-app/file}. +@item @code{("foo/doc" "share/my-app/doc" #:output "doc")}: Install +@file{"foo/doc"} to @file{"share/my-app/doc"} within the @code{"doc"} +output. @end itemize @end defvar diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm index fb2d1db056..25d3f4c57a 100644 --- a/guix/build/copy-build-system.scm +++ b/guix/build/copy-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019 Julien Lepiller ;;; Copyright © 2020 Pierre Neidhardt ;;; Copyright © 2021 Efraim Flashner +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -40,9 +41,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys) An install plan is a list of plans in the form: - (SOURCE TARGET [FILTERS]) + (SOURCE TARGET [FILTERS] [#:output OUTPUT]) -In the above, FILTERS are optional. +In the above, FILTERS and OUTPUT are optional. - When SOURCE matches a file or directory without trailing slash, install it to TARGET. @@ -63,6 +64,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys) If both `#:include*` and `#:exclude*` are specified, the exclusion is done on the inclusion list. +- When a package has multiple outputs, the `#:output` argument can be used +to specify which output label the files should be installed to. + Examples: - `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-app/bar\". @@ -72,7 +76,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys) - `(\"foo/\" \"share/my-app\" #:include (\"sub/file\"))`: Install only \"foo/sub/file\" to \"share/my-app/sub/file\". - `(\"foo/sub\" \"share/my-app\" #:include (\"file\"))`: Install \"foo/sub/file\" to -\"share/my-app/file\"." +\"share/my-app/file\". +- `(\"foo/doc\" \"share/my-app/doc\" #:output \"doc\")`: Install \"foo/doc\" to +\"share/my-app/doc\" within the \"doc\" output." (define (install-simple source target) "Install SOURCE to TARGET. TARGET must point to a store location. @@ -133,8 +139,10 @@ (define* (install #:key install-plan outputs #:allow-other-keys) (string-append target "/"))) file-list)))) - (define* (install source target #:key include exclude include-regexp exclude-regexp) - (let ((final-target (string-append (assoc-ref outputs "out") "/" target)) + (define* (install source target + #:key include exclude include-regexp exclude-regexp + (output "out")) + (let ((final-target (string-append (assoc-ref outputs output) "/" target)) (filters? (or include exclude include-regexp exclude-regexp))) (when (and (not (file-is-directory? source)) filters?) -- 2.41.0