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 ms9.migadu.com with LMTPS id 8HkoIm8RKGVM6wAA9RJhRA:P1 (envelope-from ) for ; Thu, 12 Oct 2023 17:31:59 +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 8HkoIm8RKGVM6wAA9RJhRA (envelope-from ) for ; Thu, 12 Oct 2023 17:31:59 +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 F39523D382 for ; Thu, 12 Oct 2023 17:31:58 +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=1697124719; a=rsa-sha256; cv=none; b=Y/7lkVHa9RO9P94awIbEpVjnqIBi5HX0HgFsl8eDnjVEY16pRwsYDu783xQRxBdi75Y9ML deJp+mB3qCmTA0bCgGJpHmR0Td4hbbK83X78/O5biO734NZMXC/m2z1gseFcg3sAm3Zvju 1GrsKHsFH4Q/Fg6iH324/fq903Y4+83DhUW+eZMh7OtszG0QTattoi0LWBtEnSRKD7icOu DbDZY4K6lw+7p+iGGUCeOJStJzdIBmQvV/g2CElaImzWeHvDFOmbEJEf4j603M5x2fNE7O +eE5HwIy5cITuJCGkDyxOSMoU5QLuBmKpoXS80zPetW+LxHjeHs0KbG7EEOz8A== 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=1697124719; 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=D8nmm9bkKApB58su/apywuHJJLhz5QgfvHV+9XSlY0Y=; b=ZFxDL/PG0MTNMjVyW2SxRMRe/3vPKVpPIu5PF6sr2H5bJmheQgDX3MIv9wyIyqbb402t0z mabs/bfO1LfC+wORta66ebgE0lUfMj+AyQxknEhxDasQ8dy6CTCQMOCcjjjGMNDY9WO3da /BE1Kwvhqi5Y1gOvC40EueOFVsyevNOvJaLnSdaUjUaNYSqEf5Dkcmh9cWJ0p7aDHqPKL0 s33UI4taLlMXxE7ScBT2C7QYLA6XlVsfNdDNv1OTC4x0Y+O+klvWN1xPqxH3H6oCSxV1Ui dHvGjUiqzpOc3T2gmzWBLKTNeEiLYVNJjal1YlY6kjMK7MuSZgM+iollxJdu4w== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxf7-00058z-4I; Thu, 12 Oct 2023 11:31:45 -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 1qqxf2-00058S-10 for guix-patches@gnu.org; Thu, 12 Oct 2023 11:31:40 -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 1qqxf1-00078T-PM for guix-patches@gnu.org; Thu, 12 Oct 2023 11:31:39 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qqxfO-0006sH-6e for guix-patches@gnu.org; Thu, 12 Oct 2023 11:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66500] [PATCH core-updates 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, 12 Oct 2023 15:32:02 +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.169712466826335 (code B ref 66500); Thu, 12 Oct 2023 15:32:02 +0000 Received: (at 66500) by debbugs.gnu.org; 12 Oct 2023 15:31:08 +0000 Received: from localhost ([127.0.0.1]:44134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqxeW-0006qh-1i for submit@debbugs.gnu.org; Thu, 12 Oct 2023 11:31:08 -0400 Received: from smtpmciv5.myservices.hosting ([185.26.107.241]:50060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqxeT-0006qW-5V for 66500@debbugs.gnu.org; Thu, 12 Oct 2023 11:31:06 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv5.myservices.hosting (Postfix) with ESMTP id 4709320D94 for <66500@debbugs.gnu.org>; Thu, 12 Oct 2023 17:30:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 37D5980098; Thu, 12 Oct 2023 17:30:15 +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 Zpz2PRl1g6Q6; Thu, 12 Oct 2023 17:30:14 +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 943D980060; Thu, 12 Oct 2023 17:30:14 +0200 (CEST) From: Bruno Victal Date: Thu, 12 Oct 2023 16:30:00 +0100 Message-ID: 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.21 X-Spam-Score: -5.21 X-Migadu-Queue-Id: F39523D382 X-TUID: bumGL56gtdjf * 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..8e627912a0 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"} for output labelled +@code{"doc"}. @end itemize @end defvar diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm index fb2d1db056..152cf88224 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\" for output labelled \"doc\"." (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