From patchwork Mon Sep 4 09:02:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 53423 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 E848827BBE9; Mon, 4 Sep 2023 10:03:56 +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 A4BC327BBE2 for ; Mon, 4 Sep 2023 10:03:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qd5UT-000788-LT; Mon, 04 Sep 2023 05:03:25 -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 1qd5U8-0006yx-PY for guix-patches@gnu.org; Mon, 04 Sep 2023 05:03:08 -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 1qd5U8-0002hs-HS for guix-patches@gnu.org; Mon, 04 Sep 2023 05:03:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qd5U8-00067s-8I; Mon, 04 Sep 2023 05:03:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65351] [PATCH v2 4/7] gnu: cgit: Use G-expressions. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: arunisaac@systemreboot.net, liliana.prikler@gmail.com, , guix-patches@gnu.org Resent-Date: Mon, 04 Sep 2023 09:03:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65351 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65351@debbugs.gnu.org Cc: Arun Isaac , Arun Isaac , Liliana Marie Prikler , ( X-Debbugs-Original-Xcc: Arun Isaac , Liliana Marie Prikler , ( Received: via spool by 65351-submit@debbugs.gnu.org id=B65351.169381817623472 (code B ref 65351); Mon, 04 Sep 2023 09:03:04 +0000 Received: (at 65351) by debbugs.gnu.org; 4 Sep 2023 09:02:56 +0000 Received: from localhost ([127.0.0.1]:48624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5Tz-00066W-JL for submit@debbugs.gnu.org; Mon, 04 Sep 2023 05:02:56 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:50170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5Tx-00066G-Q0 for 65351@debbugs.gnu.org; Mon, 04 Sep 2023 05:02:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oGz1lTQFuc7EY9ARCELu50V5OwdnqfM/7XkRPnC4Kks=; b=SyKsZ9EJXmCTgcgvNGqS57Fv1v 6nqJJBBs4t9q5fTYGY2/4ZpqquPvu5uphWIjGtvybPZbo8bqOMCEvWOru8W/caA69QjsbqoNMhNZm 6rTtsomLEYwswdxAwynTyABV0GJDv5qm7TOO02Vix3jCQsvyre+KFkswyQ4Ywni/uhro1TxoEX2NL Icd/z8Pv9i3sPFfX6e45UCC0U26aU7EyMBRD9Aynj1RaJC/frWH6dnqUygglCQZGaW0m/AIYnvUtL 0gERnI/V3BZXbZENKYJA1IQN93/URByBL857lOoxnxnjFUqTJTifY5VH0iR3L8+Ho797k9j3KyGLC j9OCOXkg==; Received: from [192.168.2.1] (port=36862 helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qd5Tu-001498-2W; Mon, 04 Sep 2023 10:02:51 +0100 From: Arun Isaac Date: Mon, 4 Sep 2023 10:02:05 +0100 Message-ID: <9d236785c3e66570380bec84f861dc04c73a98e1.1693746463.git.arunisaac@systemreboot.net> 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/version-control.scm (cgit)[arguments]: Rewrite using G-expressions. --- gnu/packages/version-control.scm | 121 ++++++++++++++++--------------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 450e74bde1..a275d4e197 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1039,66 +1039,67 @@ (define-public cgit "193d990ym10qlslk0p8mjwp2j6rhqa7fq0y1iff65lvbyv914pss")))) (build-system gnu-build-system) (arguments - '(#:tests? #f ; XXX: fail to build the in-source git. - #:test-target "test" - #:make-flags '("CC=gcc" "SHELL_PATH=sh") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'unpack-git - (lambda* (#:key inputs #:allow-other-keys) - ;; Unpack the source of git into the 'git' directory. - (invoke "tar" "--strip-components=1" "-C" "git" "-xf" - (assoc-ref inputs "git-source")))) - (add-after 'unpack 'patch-absolute-file-names - (lambda* (#:key inputs #:allow-other-keys) - (define (quoted-file-name input path) - (string-append "\"" input path "\"")) - (substitute* "ui-snapshot.c" - (("\"gzip\"") - (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip")) - (("\"bzip2\"") - (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2")) - (("\"xz\"") - (quoted-file-name (assoc-ref inputs "xz") "/bin/xz"))) - - (substitute* "filters/about-formatting.sh" - (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out") - "/lib/cgit/filters")) - (("\\| tr") (string-append "| " (which "tr")))) - - (substitute* "filters/html-converters/txt2html" - (("sed") (which "sed"))) - - (substitute* "filters/html-converters/man2html" - (("groff") (which "groff"))) - - (substitute* "filters/html-converters/rst2html" - (("rst2html\\.py") (which "rst2html.py"))))) - (delete 'configure) ; no configure script - (add-after 'build 'build-man - (lambda* (#:key make-flags #:allow-other-keys) - (apply invoke "make" "doc-man" make-flags))) - (replace 'install - (lambda* (#:key make-flags outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (apply invoke - "make" "install" "install-man" - (string-append "prefix=" out) - (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit") - make-flags) - ;; Move the platform-dependent 'cgit.cgi' into lib to get it - ;; stripped. - (rename-file (string-append out "/share/cgit/cgit.cgi") - (string-append out "/lib/cgit/cgit.cgi"))))) - (add-after 'install 'wrap-python-scripts - (lambda* (#:key outputs #:allow-other-keys) - (for-each - (lambda (file) - (wrap-program (string-append (assoc-ref outputs "out") - "/lib/cgit/filters/" file) - `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))) - '("syntax-highlighting.py" - "html-converters/md2html"))))))) + (list + #:tests? #f ; XXX: fail to build the in-source git. + #:test-target "test" + #:make-flags '("CC=gcc" "SHELL_PATH=sh") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-git + (lambda* (#:key inputs #:allow-other-keys) + ;; Unpack the source of git into the 'git' directory. + (invoke "tar" "--strip-components=1" "-C" "git" "-xf" + (assoc-ref inputs "git-source")))) + (add-after 'unpack 'patch-absolute-file-names + (lambda* (#:key inputs #:allow-other-keys) + (define (quoted-file-name input path) + (string-append "\"" input path "\"")) + (substitute* "ui-snapshot.c" + (("\"gzip\"") + (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip")) + (("\"bzip2\"") + (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2")) + (("\"xz\"") + (quoted-file-name (assoc-ref inputs "xz") "/bin/xz"))) + + (substitute* "filters/about-formatting.sh" + (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out") + "/lib/cgit/filters")) + (("\\| tr") (string-append "| " (which "tr")))) + + (substitute* "filters/html-converters/txt2html" + (("sed") (which "sed"))) + + (substitute* "filters/html-converters/man2html" + (("groff") (which "groff"))) + + (substitute* "filters/html-converters/rst2html" + (("rst2html\\.py") (which "rst2html.py"))))) + (delete 'configure) ; no configure script + (add-after 'build 'build-man + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "doc-man" make-flags))) + (replace 'install + (lambda* (#:key make-flags outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (apply invoke + "make" "install" "install-man" + (string-append "prefix=" out) + (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit") + make-flags) + ;; Move the platform-dependent 'cgit.cgi' into lib to get it + ;; stripped. + (rename-file (string-append out "/share/cgit/cgit.cgi") + (string-append out "/lib/cgit/cgit.cgi"))))) + (add-after 'install 'wrap-python-scripts + (lambda* (#:key outputs #:allow-other-keys) + (for-each + (lambda (file) + (wrap-program (string-append (assoc-ref outputs "out") + "/lib/cgit/filters/" file) + `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))) + '("syntax-highlighting.py" + "html-converters/md2html"))))))) (native-inputs `(;; Building cgit requires a Git source tree. ("git-source"