From patchwork Mon Sep 19 06:57:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kiasoc5 X-Patchwork-Id: 42739 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 B43C227BBEA; Mon, 19 Sep 2022 08:01:41 +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.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 DDE8427BBE9 for ; Mon, 19 Sep 2022 08:01:40 +0100 (BST) Received: from localhost ([::1]:42550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaAmi-00065D-1y for patchwork@mira.cbaines.net; Mon, 19 Sep 2022 03:01:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaAl8-00060Y-Cb for guix-patches@gnu.org; Mon, 19 Sep 2022 03:00:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaAl8-0004WP-29 for guix-patches@gnu.org; Mon, 19 Sep 2022 03:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaAl7-0003qg-Tk for guix-patches@gnu.org; Mon, 19 Sep 2022 03:00:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57927] [PATCH] gnu: source-highlight: Fix lesspipe file name and use gexps. Resent-From: kiasoc5 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Sep 2022 07:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57927 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57927@debbugs.gnu.org Cc: kiasoc5 X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166357077014720 (code B ref -1); Mon, 19 Sep 2022 07:00:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Sep 2022 06:59:30 +0000 Received: from localhost ([127.0.0.1]:52054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaAkb-0003pL-PV for submit@debbugs.gnu.org; Mon, 19 Sep 2022 02:59:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:52344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaAkY-0003pC-Cx for submit@debbugs.gnu.org; Mon, 19 Sep 2022 02:59:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaAkX-0005Q6-QE for guix-patches@gnu.org; Mon, 19 Sep 2022 02:59:26 -0400 Received: from knopi.disroot.org ([178.21.23.139]:47310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaAkV-0004Qt-De for guix-patches@gnu.org; Mon, 19 Sep 2022 02:59:25 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id ACFAD4A02B; Mon, 19 Sep 2022 08:59:20 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3nbAY-jnISs8; Mon, 19 Sep 2022 08:59:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1663570757; bh=+ZzwRxgB/86xLfWBjHHJp8lvnrVtvI4DQbf9gccBEgM=; h=From:To:Cc:Subject:Date; b=Bi1pO5/FRriWvcwR1q23o0I5qnvmvqLahuhNM+OuXGHT1aKpPMv+S9QTEk4F5AscI IVOgwQPjpAo9pIY9rDiPGDoEpcRkB5EkyGnRof+UJ5QJ4pSwLvPd3oh4WfIoJZeDGj A/3EFzY8TZXQZuhbxFt2U5DloJxVW9KOEQXJaqNSOSTCkVKLwu0lseVszbbQAQJqkr ptShsj0cM5dL6SCHt72NhmFFzfOq8mByJ9ja0+zrQt3o+b7+O3jhrfALiYYZlPTTzQ 8JbA1ZY9BSrkuwmfGnXEKeqrEufkyPaR2O1IeH38uSYhJLU1ARhlzHPW8Mao/cp++x muLish0gAUpsQ== Date: Mon, 19 Sep 2022 02:57:30 -0400 Message-Id: <29d55f693128126558e2e3e0a030194453312187.1663570649.git.kiasoc5@disroot.org> Mime-Version: 1.0 Received-SPF: pass client-ip=178.21.23.139; envelope-from=kiasoc5@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Reply-to: kiasoc5 X-ACL-Warn: , kiasoc5 via Guix-patches X-Patchwork-Original-From: kiasoc5 via Guix-patches via From: kiasoc5 X-getmail-retrieved-from-mailbox: Patches This fixes src-hilite-lesspipe.sh so that lesspipe.sh is called instead of lesspipe. * gnu/packages/pretty-print.scm (source-highlight): [arguments]: Use gexps, remove trailing #ts. [phases]: Add phase to make src-highlight-lesspipe.sh work. --- gnu/packages/pretty-print.scm | 70 ++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 34 deletions(-) base-commit: 25adb336bcb0188a92ecbe6b9c1d9d3e3a8b59e4 diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm index 9745a9ba10..13108fe7db 100644 --- a/gnu/packages/pretty-print.scm +++ b/gnu/packages/pretty-print.scm @@ -32,6 +32,7 @@ (define-module (gnu packages pretty-print) #:use-module (guix download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix gexp) #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages bison) @@ -276,40 +277,41 @@ (define-public source-highlight (list boost)) (native-inputs (list bison flex)) - (arguments - `(#:configure-flags - (list (string-append "--with-boost=" - (assoc-ref %build-inputs "boost"))) - #:parallel-tests? #f ;There appear to be race conditions - #:phases - (modify-phases %standard-phases - ,@(if (%current-target-system) - ;; 'doc/Makefile.am' tries to run stuff even when - ;; cross-compiling. Explicitly skip it. - ;; XXX: Inline this on next rebuild cycle. - `((add-before 'build 'skip-doc-directory - (lambda _ - (substitute* "Makefile" - (("^SUBDIRS = (.*) doc(.*)$" _ before after) - (string-append "SUBDIRS = " before - " " after "\n"))) - #t))) - '()) - (add-before 'check 'patch-test-files - (lambda _ - ;; Unpatch shebangs in test input so that source-highlight - ;; is still able to infer input language - (substitute* '("tests/test.sh" - "tests/test2.sh" - "tests/test.tcl") - (((string-append "#! *" (which "sh"))) "#!/bin/sh")) - ;; Initial patching unrecoverably removes whitespace, so - ;; remove it also in the comparison output. - (substitute* '("tests/test.sh.html" - "tests/test2.sh.html" - "tests/test.tcl.html") - (("#! */bin/sh") "#!/bin/sh")) - #t))))) + (arguments + (list #:configure-flags + #~(list (string-append "--with-boost=" (assoc-ref %build-inputs "boost"))) + #:parallel-tests? #f ;There appear to be race conditions + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'rename-lesspipe-to-lesspipe.sh.in + (lambda _ + (substitute* "src/src-hilite-lesspipe.sh.in" + (("lesspipe") "lesspipe.sh")))) + #$@(if (%current-target-system) + ;; 'doc/Makefile.am' tries to run stuff even when + ;; cross-compiling. Explicitly skip it. + ;; XXX: Inline this on next rebuild cycle. + #~((add-before 'build 'skip-doc-directory + (lambda _ + (substitute* "Makefile" + (("^SUBDIRS = (.*) doc(.*)$" _ before after) + (string-append "SUBDIRS = " before + " " after "\n")))))) + '()) + (add-before 'check 'patch-test-files + (lambda _ + ;; Unpatch shebangs in test input so that source-highlight + ;; is still able to infer input language + (substitute* '("tests/test.sh" + "tests/test2.sh" + "tests/test.tcl") + (((string-append "#! *" (which "sh"))) "#!/bin/sh")) + ;; Initial patching unrecoverably removes whitespace, so + ;; remove it also in the comparison output. + (substitute* '("tests/test.sh.html" + "tests/test2.sh.html" + "tests/test.tcl.html") + (("#! */bin/sh") "#!/bin/sh"))))))) (home-page "https://www.gnu.org/software/src-highlite/") (synopsis "Produce a document with syntax highlighting from a source file") (description