From patchwork Tue Oct 24 15:15:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 55304 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1440A27BBEC; Tue, 24 Oct 2023 16:18:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AA2B227BBE2 for ; Tue, 24 Oct 2023 16:18:58 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvJAd-0007mc-R7; Tue, 24 Oct 2023 11:18:15 -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 1qvJA2-0007Pr-Ef for guix-patches@gnu.org; Tue, 24 Oct 2023 11:17:39 -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 1qvJA2-00027P-5S for guix-patches@gnu.org; Tue, 24 Oct 2023 11:17:38 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvJAV-0003Lr-PT for guix-patches@gnu.org; Tue, 24 Oct 2023 11:18:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64486] [PATCH v2 22/22] gnu: licensecheck: Use G-Expressions. Refactor phases. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Oct 2023 15:18:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64486 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64486@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 64486-submit@debbugs.gnu.org id=B64486.169816064012656 (code B ref 64486); Tue, 24 Oct 2023 15:18:07 +0000 Received: (at 64486) by debbugs.gnu.org; 24 Oct 2023 15:17:20 +0000 Received: from localhost ([127.0.0.1]:56219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvJ9k-0003Hy-5J for submit@debbugs.gnu.org; Tue, 24 Oct 2023 11:17:20 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:38720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvJ9f-0003Gg-4d for 64486@debbugs.gnu.org; Tue, 24 Oct 2023 11:17:15 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 67CA52081A for <64486@debbugs.gnu.org>; Tue, 24 Oct 2023 17:16:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id DC36980098; Tue, 24 Oct 2023 17:16:39 +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 9HishwXb3LkL; Tue, 24 Oct 2023 17:16:39 +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 53D2A800B0; Tue, 24 Oct 2023 17:16:37 +0200 (CEST) From: Bruno Victal Date: Tue, 24 Oct 2023 16:15:42 +0100 Message-ID: <73824f6d84e96e2f3c92cb94e3583ad4ce5f5f92.1698160401.git.mirai@makinata.eu> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/license.scm (licensecheck)[arguments]: Use G-Expressions. Drop trailing #t. <#:phases>: Rename 'wrap-program to 'wrap-licensecheck. Add 'check-wrap. --- gnu/packages/license.scm | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/gnu/packages/license.scm b/gnu/packages/license.scm index 025e1aa3bb..0760b6d7d2 100644 --- a/gnu/packages/license.scm +++ b/gnu/packages/license.scm @@ -35,6 +35,7 @@ (define-module (gnu packages license) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix licenses) #:use-module (guix packages)) @@ -181,17 +182,23 @@ (define-public licensecheck perl-string-escape perl-string-license)) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'install 'wrap-program - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (perllib (string-append out "/lib/perl5/site_perl/" - ,(package-version perl)))) - (wrap-program (string-append out "/bin/licensecheck") - `("PERL5LIB" ":" - prefix (,(string-append perllib ":" (getenv "PERL5LIB"))))) - #t)))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'wrap 'wrap-licensecheck + (lambda _ + (let ((licensecheck (string-append #$output "/bin/licensecheck")) + (perl5lib (string-append #$output "/lib/perl5/site_perl/" + #$(package-version perl)))) + (wrap-program licensecheck + `("PERL5LIB" ":" prefix + ,(list perl5lib (getenv "PERL5LIB"))))))) + (add-after 'wrap-program 'check-wrap + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (unsetenv "PERL5LIB") + (invoke/quiet (string-append #$output "/bin/licensecheck") + "--version"))))))) (home-page "https://metacpan.org/release/App-Licensecheck") (synopsis "License checker for source files") (description "Licensecheck attempts to determine the license that applies