From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 05 15:39:39 2017 Received: (at submit) by debbugs.gnu.org; 5 Nov 2017 20:39:39 +0000 Received: from localhost ([127.0.0.1]:52658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBRhj-00004v-BC for submit@debbugs.gnu.org; Sun, 05 Nov 2017 15:39:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBRhh-0008WM-Pz for submit@debbugs.gnu.org; Sun, 05 Nov 2017 15:39:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBRhb-0002B4-FL for submit@debbugs.gnu.org; Sun, 05 Nov 2017 15:39:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34388) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBRhb-0002B0-BX for submit@debbugs.gnu.org; Sun, 05 Nov 2017 15:39:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBRhZ-0005VU-MO for guix-patches@gnu.org; Sun, 05 Nov 2017 15:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBRhY-0002A7-7Y for guix-patches@gnu.org; Sun, 05 Nov 2017 15:39:29 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:43012) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eBRhU-00028c-CN; Sun, 05 Nov 2017 15:39:24 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B2388E878; Sun, 5 Nov 2017 21:39:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1YmuNUEoEfqk; Sun, 5 Nov 2017 21:39:20 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5A580D66D; Sun, 5 Nov 2017 21:39:20 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: guix-patches@gnu.org Subject: [PATCH core-updates] build-system/gnu: Add 'install-license-files' phase. X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 Brumaire an 226 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 05 Nov 2017 21:39:18 +0100 Message-ID: <87ineoo3yh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Marius Bakke , Dave Love , Leo Famulari X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Guix, This patch adds an =E2=80=98install-license-files=E2=80=99 phase to =E2=80= =98gnu-build-system=E2=80=99 and to all the build systems that inherit from it. It is a followup to the discussion with Dave Love: https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00097.html It=E2=80=99s an improvement over what we have now, although it=E2=80=99s ru= dimentary: it copies to share/doc/PACKAGE-VERSION any file from the top-level source directory that matches a regexp. Thoughts? Ideally we could apply it in this =E2=80=98core-updates=E2=80=99 cycle if t= hat=E2=80=99s fine with you. Thanks in advance, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-build-system-gnu-Add-install-license-files-phase.patch >From bcdfb1a89b82c9c10e80f1a5d6aadc0620e81156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 5 Nov 2017 21:32:02 +0100 Subject: [PATCH] build-system/gnu: Add 'install-license-files' phase. Suggested by Dave Love . * guix/build-system/gnu.scm (%license-file-regexp): New variable. (gnu-build): Add #:license-file-regexp and use it. (gnu-cross-build): Likewise. * guix/build/gnu-build-system.scm (%license-file-regexp): New variable. (install-license-files): New procedure. (%standard-phases): Add it. --- guix/build-system/gnu.scm | 8 ++++++++ guix/build/gnu-build-system.scm | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm index 047ace7e6..f54afe167 100644 --- a/guix/build-system/gnu.scm +++ b/guix/build-system/gnu.scm @@ -273,6 +273,10 @@ standard packages used as implicit inputs of the GNU build system." (build (if target gnu-cross-build gnu-build)) (arguments (strip-keyword-arguments private-keywords arguments)))) +(define %license-file-regexp + ;; Regexp matching license files. + "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$") + (define* (gnu-build store name input-drvs #:key (guile #f) (outputs '("out")) @@ -291,6 +295,7 @@ standard packages used as implicit inputs of the GNU build system." (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (validate-runpath? #t) + (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "en_US.utf8") (system (%current-system)) @@ -358,6 +363,7 @@ packages that must not be referenced." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:validate-runpath? ,validate-runpath? + #:license-file-regexp ,license-file-regexp #:strip-flags ,strip-flags #:strip-directories ,strip-directories))) @@ -432,6 +438,7 @@ is one of `host' or `target'." (strip-directories ''("lib" "lib64" "libexec" "bin" "sbin")) (validate-runpath? #t) + (license-file-regexp %license-file-regexp) (phases '%standard-phases) (locale "en_US.utf8") (system (%current-system)) @@ -509,6 +516,7 @@ platform." #:patch-shebangs? ,patch-shebangs? #:strip-binaries? ,strip-binaries? #:validate-runpath? ,validate-runpath? + #:license-file-regexp ,license-file-regexp #:strip-flags ,strip-flags #:strip-directories ,strip-directories)))) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e37b75140..eb247ae0c 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-26) #:use-module (rnrs io ports) #:export (%standard-phases + %license-file-regexp gnu-build)) ;; Commentary: @@ -641,6 +642,29 @@ which cannot be found~%" outputs) #t) +(define %license-file-regexp + ;; Regexp matching license files. + "^(COPYING.*|LICEN[CS]E.*|[Ll]icen[cs]e.*|Copy[Rr]ight(\\.(txt|md))?)$") + +(define* (install-license-files #:key outputs + (license-file-regexp %license-file-regexp) + #:allow-other-keys) + "Install license files matching LICENSE-FILE-REGEXP to 'share/doc'." + (let* ((regexp (make-regexp license-file-regexp)) + (out (or (assoc-ref outputs "out") + (car (first outputs)))) + (package (strip-store-file-name out)) + (directory (string-append out "/share/doc/" package)) + (files (scandir "." (lambda (file) + (regexp-exec regexp file))))) + (format #t "installing ~a license files~%" (length files)) + (for-each (lambda (file) + (if (file-is-directory? file) + (copy-recursively file directory) + (install-file file directory))) + files) + #t)) + (define %standard-phases ;; Standard build phases, as a list of symbol/procedure pairs. (let-syntax ((phases (syntax-rules () @@ -654,6 +678,7 @@ which cannot be found~%" validate-documentation-location delete-info-dir-file patch-dot-desktop-files + install-license-files reset-gzip-timestamps compress-documentation))) -- 2.14.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 08 16:46:49 2017 Received: (at 29161-done) by debbugs.gnu.org; 8 Nov 2017 21:46:49 +0000 Received: from localhost ([127.0.0.1]:59025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCYBN-0000CK-1F for submit@debbugs.gnu.org; Wed, 08 Nov 2017 16:46:49 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:43379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCYBL-0000CB-Al for 29161-done@debbugs.gnu.org; Wed, 08 Nov 2017 16:46:48 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C8ED0F4AA; Wed, 8 Nov 2017 22:46:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 45Pp2s_5YpI3; Wed, 8 Nov 2017 22:46:47 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 4066BF432; Wed, 8 Nov 2017 22:46:46 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 29161-done@debbugs.gnu.org Subject: Re: [bug#29161] [PATCH core-updates] build-system/gnu: Add 'install-license-files' phase. References: <87ineoo3yh.fsf@gnu.org> Date: Wed, 08 Nov 2017 22:46:43 +0100 In-Reply-To: <87ineoo3yh.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 05 Nov 2017 21:39:18 +0100") Message-ID: <87375osat8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 29161-done Cc: Marius Bakke , Dave Love , Leo Famulari X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hey, ludo@gnu.org (Ludovic Court=C3=A8s) skribis: >>>From bcdfb1a89b82c9c10e80f1a5d6aadc0620e81156 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D > Date: Sun, 5 Nov 2017 21:32:02 +0100 > Subject: [PATCH] build-system/gnu: Add 'install-license-files' phase. > > Suggested by Dave Love . > > * guix/build-system/gnu.scm (%license-file-regexp): New variable. > (gnu-build): Add #:license-file-regexp and use it. > (gnu-cross-build): Likewise. > * guix/build/gnu-build-system.scm (%license-file-regexp): New variable. > (install-license-files): New procedure. > (%standard-phases): Add it. I went ahead and pushed this with a tiny fix that Ricardo suggested on IRC. Ludo=E2=80=99. From unknown Fri Aug 15 17:22:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 07 Dec 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator