From patchwork Sat Mar 30 20:48:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: chris X-Patchwork-Id: 62378 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 5CACE27BBEA; Sat, 30 Mar 2024 20:51:34 +0000 (GMT) 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,T_PDS_PRO_TLD, 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 6D94927BBE2 for ; Sat, 30 Mar 2024 20:51:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqffP-0005pB-BP; Sat, 30 Mar 2024 16:51:07 -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 1rqffI-0005ot-GL for guix-patches@gnu.org; Sat, 30 Mar 2024 16:51:00 -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 1rqffH-0003TM-Ut for guix-patches@gnu.org; Sat, 30 Mar 2024 16:51:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqffJ-00068K-K1 for guix-patches@gnu.org; Sat, 30 Mar 2024 16:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70047] [PATCH] gnu: highlight: Update to 4.11. References: <2e0f9a03e955cc28f5b67e7edcc8680eed5bc587.1711617879.git.chris@bumblehead.com> In-Reply-To: <2e0f9a03e955cc28f5b67e7edcc8680eed5bc587.1711617879.git.chris@bumblehead.com> Resent-From: chris Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Mar 2024 20:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70047 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70047@debbugs.gnu.org Cc: chris Received: via spool by 70047-submit@debbugs.gnu.org id=B70047.171183181623406 (code B ref 70047); Sat, 30 Mar 2024 20:51:01 +0000 Received: (at 70047) by debbugs.gnu.org; 30 Mar 2024 20:50:16 +0000 Received: from localhost ([127.0.0.1]:46246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqfeZ-00065S-MB for submit@debbugs.gnu.org; Sat, 30 Mar 2024 16:50:16 -0400 Received: from mx.kolabnow.com ([212.103.80.154]:42380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqfeU-00064w-U8 for 70047@debbugs.gnu.org; Sat, 30 Mar 2024 16:50:14 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id A7B0D2095C2D for <70047@debbugs.gnu.org>; Sat, 30 Mar 2024 21:50:02 +0100 (CET) Authentication-Results: ext-mx-out011.mykolab.com (amavis); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=kolabnow.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1711831799; x=1713646200; bh=bGeQjeCf/RKxRdjNRoqaiayBCdylc5fbsl5r/6c3iXI=; b=tgvRc/kXk/D+ sAMTailZA2E7wFLRY8lRJG+cq2SGlqA8F43FNlXXi4XJ18uN5/DWITHixQGX4dAD bwB+c9Vq/Dk4zVfNRjxGdh9AqqBhUthruQNDKYKQYyz5N9RUVLHMx/FAOwQKqIze D6xxUPA8z1gn2XfDjpDefYFsqOmR3G19LYE6A+eGWBhz9UudMjzZQicnBzbhSNAN FdovbMDDi+VI5jDOAFiZ+EgVRZ21WocxqDTNWqdj0XcFqA89PRhT6PSJcbtpV15q OvqzFYrJqp+Irm47Mw1B9DYWdPAgd4Zc5AjRAWA1gJLMYFcfVhjwnjN8vMmh3AGu MdqPV5+oyT3IOXb2807n/MjlMUr6AKqDnVAJMHRxhjiUgBBq1BYyJbMKMe/i4w/Y uy27TTWOR1rLO4840cN0FSnjlIjaSXpB2QQ8yP0m3BrspF+TTDM1LdAFdaCAgYav eo8YX/6IYQfgcirwNEtaXODBk1nQQsZ2qcXSShM8EMlli6YpXu0ISfq0rX5TEhgl H7AD7GgmZvvaI6lV4Up0WvAQT2tmzsmWsEOZ5o6waO9IMlvBJrrdcNSwc6ei34r4 jg2O8vW+VgfCiuQTT7XjDYuZycfxLbpcX9Hcj9FPx5mnQme8KqTKpSgLFAhFUeU0 sfeAHBoyVtzHP1RqoUwPmAPsKafyTcw= X-Virus-Scanned: amavis at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out011.mykolab.com [127.0.0.1]) (amavis, port 10024) with ESMTP id VtI_ZsVOBrl7 for <70047@debbugs.gnu.org>; Sat, 30 Mar 2024 21:49:59 +0100 (CET) Received: from int-mx009.mykolab.com (unknown [10.9.13.9]) by mx.kolabnow.com (Postfix) with ESMTPS id 82BBF2095C26 for <70047@debbugs.gnu.org>; Sat, 30 Mar 2024 21:49:58 +0100 (CET) Received: from ext-subm010.mykolab.com (unknown [10.9.6.10]) by int-mx009.mykolab.com (Postfix) with ESMTPS id C352020D9DC4 for <70047@debbugs.gnu.org>; Sat, 30 Mar 2024 21:49:58 +0100 (CET) From: chris Date: Sat, 30 Mar 2024 13:48:23 -0700 Message-ID: <8dd88efaf01a7d83823ae7d9723142bc15821a7d.1711831703.git.chris@bumblehead.com> 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 * (highlight): Update to 4.11. Other changes include the following, * linting is applied to the package definition. This moves the "arguments" nesting and adds some noise to the diff, * the package source is changed from url-fetch andre-simon.de/zip/download.html to git-fetch gitlab.com/saalen/highlight/-/releases, * the homepage url is changed; the previous url serves a not found error, * per review, "#$output" replaces "%output", * per review, `(this-package-input "lua")` replaces `lua` to support different user-specified version lua * per review, `(this-package-input "perl")` replaces `perl` to support different user-specified version perl Change-Id: I0c402fcea5708c4882b52309b3e072301f0a5614 --- gnu/packages/pretty-print.scm | 165 +++++++++++++++++----------------- 1 file changed, 83 insertions(+), 82 deletions(-) base-commit: c2c1098585b10f42bed7647f2130a2727c0488f8 diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm index b95f56729a..fa46061303 100644 --- a/gnu/packages/pretty-print.scm +++ b/gnu/packages/pretty-print.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2022 Zhu Zihao ;;; Copyright © 2022, 2023 Maxim Cournoyer ;;; Copyright © 2023 gemmaro +;;; Copyright © 2024 chris ;;; ;;; This file is part of GNU Guix. ;;; @@ -352,93 +353,93 @@ (define-public source-highlight (define-public highlight (package (name "highlight") - (version "4.8") + (version "4.11") (outputs (list "out" "gui")) - (source (origin - (method url-fetch) - (uri (string-append "http://www.andre-simon.de/zip/highlight-" - version ".tar.bz2")) - (sha256 - (base32 - "1iggdw4c8pfz1z1c51fyd6x79y1mnc82b6lfkg3vbb44739m5cjs")) - (patches (search-patches "highlight-gui-data-dir.patch")))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/saalen/highlight") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0xb9jm7249qnbain4l94nakgxsmia4w4x246dagr669fkmffcdmg")) + (patches (search-patches "highlight-gui-data-dir.patch")))) (build-system gnu-build-system) (arguments - (list #:tests? #f ;no tests - #:make-flags #~(let ((confdir (string-append %output - "/share/highlight/config/"))) - (list (string-append "PREFIX=" %output) - (string-append "HL_CONFIG_DIR=" confdir) - (string-append "conf_dir=" confdir))) - #:phases #~(modify-phases %standard-phases - (delete 'configure) ;no configure script - (add-after 'unpack 'fix-search-for-lua - (lambda _ - (let ((ver #$(version-major+minor (package-version - lua)))) - (substitute* "src/makefile" - (("(LUA_PKG_NAME=).*" _ assignment) - (string-append assignment "lua-" ver "\n"))) - (substitute* "src/gui-qt/highlight.pro" - (("(PKGCONFIG \\+= lua)" _ assignment) - (string-append assignment "-" ver))) - (substitute* "extras/swig/makefile" - (("lua") - (string-append "lua-" ver)))))) - (add-after 'build 'build-gui - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (data (string-append out - "/share/highlight/")) - (conf (string-append out "/etc/highlight/")) - (doc (string-append out - "/share/doc/highlight/")) - (gui (assoc-ref outputs "gui")) - (gui-data (string-append gui - "/share/highlight/"))) - ;; modified version of gui task in makefile - (invoke "make" - "-C" - "./src" - "-f" - "./makefile" - (string-append "HL_DATA_DIR=" data) - (string-append "HL_CONFIG_DIR=" conf) - (string-append "HL_DOC_DIR=" doc) - (string-append "GUI_DATA_DIR=" gui-data) - "gui-qt")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "make" "install" - (string-append "PREFIX=" out))))) - (add-after 'install 'install-perl-bindings - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (data (string-append out - "/share/highlight/")) - (conf (string-append out "/etc/highlight/")) - (perldir (string-append out - "/lib/perl5/site_perl/" - #$(package-version perl))) - (autodir (string-append perldir - "/auto/highlight"))) - (with-directory-excursion "extras/swig" - (invoke "make" "perl" - (string-append "hl_data_dir=" data) - (string-append "hl_conf_dir=" conf)) - (invoke "perl" "-I" "." "testmod.pl") - (install-file "highlight.pm" perldir) - (install-file "highlight.so" autodir))))) - (add-after 'install 'install-gui - (lambda* (#:key outputs #:allow-other-keys) - (let ((gui (assoc-ref outputs "gui"))) - (mkdir-p (string-append gui "/bin")) - (invoke "make" "install-gui" - (string-append "PREFIX=" gui)))))))) + (list + #:tests? #f ;no tests + #:make-flags #~(let ((confdir (string-append #$output + "/share/highlight/config/"))) + (list (string-append "PREFIX=" #$output) + (string-append "HL_CONFIG_DIR=" confdir) + (string-append "conf_dir=" confdir))) + #:phases #~(modify-phases %standard-phases + (delete 'configure) ;no configure script + (add-after 'unpack 'fix-search-for-lua + (lambda _ + (let ((ver #$(version-major+minor + (package-version (this-package-input "lua"))))) + (substitute* "src/makefile" + (("(LUA_PKG_NAME=).*" _ assignment) + (string-append assignment "lua-" ver "\n"))) + (substitute* "src/gui-qt/highlight.pro" + (("(PKGCONFIG \\+= lua)" _ assignment) + (string-append assignment "-" ver))) + (substitute* "extras/swig/makefile" + (("lua") + (string-append "lua-" ver)))))) + (add-after 'build 'build-gui + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (data (string-append out "/share/highlight/")) + (conf (string-append out "/etc/highlight/")) + (doc (string-append out "/share/doc/highlight/")) + (gui (assoc-ref outputs "gui")) + (gui-data (string-append gui "/share/highlight/"))) + ;; modified version of gui task in makefile + (invoke "make" + "-C" + "./src" + "-f" + "./makefile" + (string-append "HL_DATA_DIR=" data) + (string-append "HL_CONFIG_DIR=" conf) + (string-append "HL_DOC_DIR=" doc) + (string-append "GUI_DATA_DIR=" gui-data) + "gui-qt")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "make" "install" + (string-append "PREFIX=" out))))) + (add-after 'install 'install-perl-bindings + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (data (string-append out "/share/highlight/")) + (conf (string-append out "/etc/highlight/")) + (perldir (string-append out + "/lib/perl5/site_perl/" + #$(package-version + (this-package-input "perl")))) + (autodir (string-append perldir + "/auto/highlight"))) + (with-directory-excursion "extras/swig" + (invoke "make" "perl" + (string-append "hl_data_dir=" data) + (string-append "hl_conf_dir=" conf)) + (invoke "perl" "-I" "." "testmod.pl") + (install-file "highlight.pm" perldir) + (install-file "highlight.so" autodir))))) + (add-after 'install 'install-gui + (lambda* (#:key outputs #:allow-other-keys) + (let ((gui (assoc-ref outputs "gui"))) + (mkdir-p (string-append gui "/bin")) + (invoke "make" "install-gui" + (string-append "PREFIX=" gui)))))))) (inputs (list lua boost perl qtbase-5)) (native-inputs (list pkg-config swig)) - (home-page "http://www.andre-simon.de/doku/highlight/en/highlight.php") + (home-page "http://www.andre-simon.de/doku/highlight/en/highlight.html") (synopsis "Convert code to documents with syntax highlighting") (description "Highlight converts source code to HTML, XHTML, RTF, LaTeX,