[PATCH] gnu: Add cgit-pink.

  • Done
  • quality assurance status badge
Details
4 participants
  • Arun Isaac
  • Liliana Marie Prikler
  • Ludovic Courtès
  • (
Owner
unassigned
Submitted by
Arun Isaac
Severity
normal
A
A
Arun Isaac wrote on 17 Aug 2023 15:51
(address . guix-patches@gnu.org)
d141cbf5ee2c7433be18f811bcc2a8ecc8aaa381.1692280182.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (git-2.36.1-source, cgit-pink): New
variable.
---
gnu/packages/version-control.scm | 70 +++++++++++++++++++++++++++++++-
1 file changed, 69 insertions(+), 1 deletion(-)

Toggle diff (92 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 699a091642..20b2c80792 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -21,7 +21,7 @@
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
-;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2018, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
@@ -1130,6 +1130,74 @@ (define-public cgit
a built-in cache to decrease server I/O pressure.")
(license license:gpl2)))
+(define git-2.36.1-source
+ (origin
+ (method url-fetch)
+ (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
+ (sha256
+ (base32
+ "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))
+
+(define-public cgit-pink
+ (package
+ (name "cgit-pink")
+ (version "1.4.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.causal.agency/cgit-pink")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:test-target "test"
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PERL_PATH="
+ (search-input-file %build-inputs "/bin/perl"))
+ (string-append "SHELL_PATH="
+ (search-input-file %build-inputs "/bin/bash"))
+ ;; Set install paths so that cgit-pink is a drop-in
+ ;; replacement for cgit.
+ (string-append "prefix="
+ (assoc-ref %outputs "out"))
+ (string-append "CGIT_SCRIPT_PATH="
+ (assoc-ref %outputs "out") "/lib/cgit")
+ (string-append "CGIT_DATA_PATH="
+ (assoc-ref %outputs "out") "/share/cgit"))
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; cgit-pink depends on the source code of a specific version
+ ;; (mentioned in the GIT_VER variable in its Makefile) of
+ ;; git. Extract it.
+ (add-after 'unpack 'unpack-git-source
+ (lambda _
+ (invoke "tar"
+ "-C" "git"
+ "--strip-components" "1"
+ "-xvf" #$git-2.36.1-source)))
+ ;; Install man pages.
+ (add-after 'install 'install-man-pages
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (apply invoke "make" "install-man" make-flags)))
+ (delete 'configure))))
+ (inputs
+ (list openssl zlib))
+ (native-inputs
+ (list asciidoc gnu-gettext perl))
+ (home-page "https://git.causal.agency/cgit-pink/about/")
+ (synopsis "Web fronted for git repositories")
+ (description "cgit-pink is a fast web interface for the Git SCM, using a
+built-in cache to decrease server I/O pressure. cgit-pink is a fork of cgit.
+Upstream cgit has long been stagnant, with the vast majority of patches sent
+to the mailing list going silently ignored, despite their obvious merit in
+many cases. This fork aims to incorporate a number of existing patches as
+well as to provide a friendlier place to send new patches.")
+ (license license:gpl2)))
+
(define-public python-git-multimail
(package
(name "python-git-multimail")

base-commit: 1b2d43fe016848ea2ec16ff18cbc14340944fc4e
--
2.39.2
L
L
Liliana Marie Prikler wrote on 17 Aug 2023 21:00
(name . jgart)(address . jgart@dismail.de)
acb26116aa8680880732d8e23f2dea7bbe02f91c.camel@gmail.com
Hi Arun,

Am Donnerstag, dem 17.08.2023 um 14:51 +0100 schrieb Arun Isaac:
Toggle quote (82 lines)
> * gnu/packages/version-control.scm (git-2.36.1-source, cgit-pink):
> New variable.
> ---
>  gnu/packages/version-control.scm | 70
> +++++++++++++++++++++++++++++++-
>  1 file changed, 69 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-
> control.scm
> index 699a091642..20b2c80792 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -21,7 +21,7 @@
>  ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
>  ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
>  ;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
> -;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
> +;;; Copyright © 2018, 2023 Arun Isaac <arunisaac@systemreboot.net>
>  ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
>  ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
>  ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
> @@ -1130,6 +1130,74 @@ (define-public cgit
>  a built-in cache to decrease server I/O pressure.")
>      (license license:gpl2)))
>  
> +(define git-2.36.1-source
> +  (origin
> +    (method url-fetch)
> +    (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
> +    (sha256
> +     (base32
> +      "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))
> +
> +(define-public cgit-pink
> +  (package
> +    (name "cgit-pink")
> +    (version "1.4.1")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://git.causal.agency/cgit-pink")
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     (list
> +      #:test-target "test"
> +      #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
> +                           (string-append "PERL_PATH="
> +                                          (search-input-file %build-
> inputs "/bin/perl"))
> +                           (string-append "SHELL_PATH="
> +                                          (search-input-file %build-
> inputs "/bin/bash"))
> +                           ;; Set install paths so that cgit-pink is
> a drop-in
> +                           ;; replacement for cgit.
> +                           (string-append "prefix="
> +                                          (assoc-ref %outputs
> "out"))
> +                           (string-append "CGIT_SCRIPT_PATH="
> +                                          (assoc-ref %outputs "out")
> "/lib/cgit")
> +                           (string-append "CGIT_DATA_PATH="
> +                                          (assoc-ref %outputs "out")
> "/share/cgit"))
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          ;; cgit-pink depends on the source code of a specific
> version
> +          ;; (mentioned in the GIT_VER variable in its Makefile) of
> +          ;; git. Extract it.
> +          (add-after 'unpack 'unpack-git-source
> +            (lambda _
> +              (invoke "tar"
> +                      "-C" "git"
> +                      "--strip-components" "1"
> +                      "-xvf" #$git-2.36.1-source)))
You should probably be using an input for the git source rather than
inlining it here.
Toggle quote (15 lines)
> +          ;; Install man pages.
> +          (add-after 'install 'install-man-pages
> +            (lambda* (#:key make-flags #:allow-other-keys)
> +              (apply invoke "make" "install-man" make-flags)))
> +          (delete 'configure))))
> +    (inputs
> +     (list openssl zlib))
> +    (native-inputs
> +     (list asciidoc gnu-gettext perl))
> +    (home-page "https://git.causal.agency/cgit-pink/about/")
> +    (synopsis "Web fronted for git repositories")
> +    (description "cgit-pink is a fast web interface for the Git SCM,
> using a
> +built-in cache to decrease server I/O pressure.  cgit-pink is a fork
> of cgit.
You can probably inherit some of these fields from cgit. Also, what
happened to all the python stuff?

Toggle quote (7 lines)
> +Upstream cgit has long been stagnant, with the vast majority of
> patches sent
> +to the mailing list going silently ignored, despite their obvious
> merit in
> +many cases.  This fork aims to incorporate a number of existing
> patches as
> +well as to provide a friendlier place to send new patches.")
Sheesh. Less marketing speech would be greatly appreciated.

Cheers
(
Re: [bug#65351] [PATCH] gnu: Add cgit-pink.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87zg2p8omi.fsf@disroot.org
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
Toggle quote (3 lines)
> You should probably be using an input for the git source rather than
> inlining it here.

Surely a native-input? :)

-- (
L
L
Liliana Marie Prikler wrote on 17 Aug 2023 22:20
(name . ()(address . paren@disroot.org)
27964fd692479a6350687a2249db8ab6726da246.camel@gmail.com
Am Donnerstag, dem 17.08.2023 um 20:16 +0100 schrieb (:
Toggle quote (5 lines)
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> > You should probably be using an input for the git source rather
> > than inlining it here.
>
> Surely a native-input?  :)
You sure about that? cgit has its git source as a regular input...
(
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87v8dd8k08.fsf@disroot.org
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
Toggle quote (2 lines)
> You sure about that? cgit has its git source as a regular input...

I mean, I suppose it doesn't really matter, especially not here, but I
think it saves the user re-downloading the source file if they first
compile normally and then cross-compile...? Because the derivation will
specify the host system, not the target system.

As I said, it's probably not a huge deal with cgit-pink, but I think
it's good to use best practices everywhere, even when it's not strictly
necessary, so that anyone reading the source who spots such a usage will
know to put their secondary <ORIGIN> object in NATIVE-INPUTS in both
cases where the package is rarely cross-compiled and cases where it's
fairly common.

-- (
A
A
Arun Isaac wrote on 18 Aug 2023 11:00
Re: [PATCH] gnu: Add cgit-pink.
(name . jgart)(address . jgart@dismail.de)
87r0o0lo84.fsf@systemreboot.net
Hi Liliana and (,
Thanks for the review! An updated patchset follows. My changes are quite
extensive. I have also improved the cgit package itself and moved inputs
that were misclassified as inputs/native-inputs.
Toggle quote (6 lines)
>> +          (add-after 'unpack 'unpack-git-source
>> +            (lambda _
>> +              (invoke "tar"
>> +                      "-C" "git"
>> +                      "--strip-components" "1"
>> +                      "-xvf" #$git-2.36.1-source)))
Toggle quote (2 lines)
> You should probably be using an input for the git source rather than
> inlining it here.
I was trying to avoid having to use the old assocation-list style inputs
with input names. But, I have changed it now.
Toggle quote (17 lines)
>> +          ;; Install man pages.
>> +          (add-after 'install 'install-man-pages
>> +            (lambda* (#:key make-flags #:allow-other-keys)
>> +              (apply invoke "make" "install-man" make-flags)))
>> +          (delete 'configure))))
>> +    (inputs
>> +     (list openssl zlib))
>> +    (native-inputs
>> +     (list asciidoc gnu-gettext perl))
>> +    (home-page "https://git.causal.agency/cgit-pink/about/")
>> +    (synopsis "Web fronted for git repositories")
>> +    (description "cgit-pink is a fast web interface for the Git SCM,
>> using a
>> +built-in cache to decrease server I/O pressure.  cgit-pink is a fork
>> of cgit.
> You can probably inherit some of these fields from cgit. Also, what
> happened to all the python stuff?
Oops, sorry! It somehow never occurred to check and compare with the
cgit package. Thanks for catching this! I am now inheriting most of cgit
into cgit-pink.
Toggle quote (8 lines)
>> +Upstream cgit has long been stagnant, with the vast majority of
>> patches sent
>> +to the mailing list going silently ignored, despite their obvious
>> merit in
>> +many cases.  This fork aims to incorporate a number of existing
>> patches as
>> +well as to provide a friendlier place to send new patches.")
> Sheesh. Less marketing speech would be greatly appreciated.
Deleted.
Regards,
Arun
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 2/7] gnu: cgit: Make bzip2, gzip and xz inputs.
05b4638f854ba9d1659ff7fbcabf50f186c51594.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[native-inputs]: Move bzip2, gzip and
xz to ...
[inputs]: ... here.
---
gnu/packages/version-control.scm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 7475de8fc1..754019a5cf 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1114,14 +1114,11 @@ (define-public cgit
(sha256
(base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
;; For building manpage.
- ("asciidoc" ,asciidoc)
- ("gzip" ,gzip)
- ("bzip2" ,bzip2)
- ("xz" ,xz)))
+ ("asciidoc" ,asciidoc)))
(inputs
- (list openssl groff
+ (list bzip2 openssl groff gzip
python python-docutils python-markdown python-pygments
- zlib))
+ xz zlib))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
(description
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 1/7] gnu: cgit: Make git-source a native input.
441ad3b27b278d465e9e3fb92f7bcaf9f6e45256.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[inputs]: Move git-source to ...
[native-inputs]: ... here.
---
gnu/packages/version-control.scm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

Toggle diff (50 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 699a091642..7475de8fc1 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -21,7 +21,7 @@
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
-;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2018, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
@@ -1104,9 +1104,6 @@ (define-public cgit
"html-converters/md2html"))
#t)))))
(native-inputs
- ;; For building manpage.
- (list asciidoc gzip bzip2 xz))
- (inputs
`(;; Building cgit requires a Git source tree.
("git-source"
,(origin
@@ -1116,13 +1113,15 @@ (define-public cgit
(uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
(sha256
(base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
- ("openssl" ,openssl)
- ("groff" ,groff)
- ("python" ,python)
- ("python-docutils" ,python-docutils)
- ("python-markdown" ,python-markdown)
- ("python-pygments" ,python-pygments)
- ("zlib" ,zlib)))
+ ;; For building manpage.
+ ("asciidoc" ,asciidoc)
+ ("gzip" ,gzip)
+ ("bzip2" ,bzip2)
+ ("xz" ,xz)))
+ (inputs
+ (list openssl groff
+ python python-docutils python-markdown python-pygments
+ zlib))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
(description

base-commit: 1b2d43fe016848ea2ec16ff18cbc14340944fc4e
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 3/7] gnu: cgit: Do not return #t from custom phases.
4ff202db0479e9bf07eec575518827c4a5b0ea0a.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Do not return #t from
custom phases.
---
gnu/packages/version-control.scm | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 754019a5cf..73c4d8f2df 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1073,9 +1073,7 @@ (define-public cgit
(("groff") (which "groff")))
(substitute* "filters/html-converters/rst2html"
- (("rst2html\\.py") (which "rst2html.py")))
-
- #t))
+ (("rst2html\\.py") (which "rst2html.py")))))
(delete 'configure) ; no configure script
(add-after 'build 'build-man
(lambda* (#:key make-flags #:allow-other-keys)
@@ -1091,8 +1089,7 @@ (define-public cgit
;; 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"))
- #t)))
+ (string-append out "/lib/cgit/cgit.cgi")))))
(add-after 'install 'wrap-python-scripts
(lambda* (#:key outputs #:allow-other-keys)
(for-each
@@ -1101,8 +1098,7 @@ (define-public cgit
"/lib/cgit/filters/" file)
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))))
'("syntax-highlighting.py"
- "html-converters/md2html"))
- #t)))))
+ "html-converters/md2html")))))))
(native-inputs
`(;; Building cgit requires a Git source tree.
("git-source"
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 4/7] gnu: cgit: Use G-expressions.
fe494363a504e03759722317eaa6ab15f58fb625.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Rewrite using
G-expressions.
---
gnu/packages/version-control.scm | 120 +++++++++++++++----------------
1 file changed, 60 insertions(+), 60 deletions(-)

Toggle diff (133 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 73c4d8f2df..e2afd92286 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1039,66 +1039,66 @@ (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 #~(list "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"
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 5/7] gnu: cgit: Use cc-for-target.
c4cc0b074103a36d8fc2b478bad4e4df9f38eec3.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Use cc-for-target.
---
gnu/packages/version-control.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index e2afd92286..398194252e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1041,7 +1041,8 @@ (define-public cgit
(arguments
(list #:tests? #f ; XXX: fail to build the in-source git.
#:test-target "test"
- #:make-flags #~(list "CC=gcc" "SHELL_PATH=sh")
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ "SHELL_PATH=sh")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unpack-git
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 6/7] gnu: cgit: Add bash-minimal to inputs.
fdc66c4f25378a5fe66e01f78657eca94fb6f556.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[inputs]: Add bash-minimal.
---
gnu/packages/version-control.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 398194252e..bc2b06c0d5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1113,7 +1113,7 @@ (define-public cgit
;; For building manpage.
("asciidoc" ,asciidoc)))
(inputs
- (list bzip2 openssl groff gzip
+ (list bash-minimal bzip2 openssl groff gzip
python python-docutils python-markdown python-pygments
xz zlib))
(home-page "https://git.zx2c4.com/cgit/")
--
2.39.2
A
A
Arun Isaac wrote on 18 Aug 2023 11:03
[PATCH 7/7] gnu: Add cgit-pink.
2f479e801734ba8be42d771ace533863de085041.1692348727.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit-pink): New variable.
---
gnu/packages/version-control.scm | 43 ++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index bc2b06c0d5..00b2f66f5a 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1123,6 +1123,49 @@ (define-public cgit
a built-in cache to decrease server I/O pressure.")
(license license:gpl2)))
+(define-public cgit-pink
+ (package
+ (inherit cgit)
+ (name "cgit-pink")
+ (version "1.4.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.causal.agency/cgit-pink")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments cgit)
+ ((#:tests? _ #f)
+ (not (%current-target-system)))
+ ((#:make-flags make-flags '())
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PERL_PATH="
+ (search-input-file %build-inputs "/bin/perl"))
+ ;; It is important to set an absolute path in SHELL_PATH
+ ;; because it is used as the shebang of generated scripts.
+ (string-append "SHELL_PATH="
+ (search-input-file %build-inputs "/bin/sh"))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs cgit)
+ (replace "git-source"
+ ;; cgit-pink is tightly bound to git. Use GIT_VER from the Makefile,
+ ;; which may not match the current (package-version git).
+ (origin
+ (method url-fetch)
+ (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
+ (sha256
+ (base32
+ "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))
+ (append gnu-gettext perl)))
+ (home-page "https://git.causal.agency/cgit-pink/about/")
+ (description "cgit-pink is a fast web interface for the Git SCM, using a
+built-in cache to decrease server I/O pressure. cgit-pink is a fork of
+cgit.")))
+
(define-public python-git-multimail
(package
(name "python-git-multimail")
--
2.39.2
L
L
Liliana Marie Prikler wrote on 18 Aug 2023 19:03
Re: [PATCH 1/7] gnu: cgit: Make git-source a native input.
772dc9e46a3bb79def1c74256f5e4041f254fe07.camel@gmail.com
Am Freitag, dem 18.08.2023 um 10:03 +0100 schrieb Arun Isaac:
Toggle quote (4 lines)
> * gnu/packages/version-control.scm (cgit)[inputs]: Move git-source to
> ...
> [native-inputs]: ... here.
> ---
I'm still questioning as to why this is necessary and/or a good idea.
Anyone here to give me an official answer?
L
L
Liliana Marie Prikler wrote on 18 Aug 2023 19:04
Re: [PATCH 4/7] gnu: cgit: Use G-expressions.
6b311cff4bb124b1a9db1a70f8ae4dac9f9ad2e9.camel@gmail.com
Am Freitag, dem 18.08.2023 um 10:03 +0100 schrieb Arun Isaac:
Toggle quote (90 lines)
> * gnu/packages/version-control.scm (cgit)[arguments]: Rewrite using
> G-expressions.
> ---
>  gnu/packages/version-control.scm | 120 +++++++++++++++--------------
> --
>  1 file changed, 60 insertions(+), 60 deletions(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-
> control.scm
> index 73c4d8f2df..e2afd92286 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -1039,66 +1039,66 @@ (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.
You probably want a line break after list, because you're tending to
the column limit pretty hard.
Toggle quote (77 lines)
> +           #:test-target "test"
> +           #:make-flags #~(list "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"
Cheers
L
L
Liliana Marie Prikler wrote on 18 Aug 2023 19:06
65585caf90ad314e38f276b38dbf12dfbce7b302.camel@gmail.com
Am Freitag, dem 18.08.2023 um 10:03 +0100 schrieb Arun Isaac:
Toggle quote (7 lines)
> +               (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"))))
You can probably use (dirname (search-input-file inputs "git.c")) to
locate the git input :)
A
A
Arun Isaac wrote on 21 Aug 2023 16:22
Re: [PATCH 1/7] gnu: cgit: Make git-source a native input.
87il988og1.fsf@systemreboot.net
Toggle quote (7 lines)
>> * gnu/packages/version-control.scm (cgit)[inputs]: Move git-source to
>> ...
>> [native-inputs]: ... here.
>> ---
> I'm still questioning as to why this is necessary and/or a good idea.
> Anyone here to give me an official answer?

My understanding is that git-source is an input that is only needed at
compile-time. Hence, it is a native input.
A
A
Arun Isaac wrote on 21 Aug 2023 16:26
Re: [PATCH 4/7] gnu: cgit: Use G-expressions.
87fs4c8oa3.fsf@systemreboot.net
Toggle quote (4 lines)
>> +                           (assoc-ref inputs "git-source"))))
> You can probably use (dirname (search-input-file inputs "git.c")) to
> locate the git input :)

Sure, but that sounds very hacky. Unless there is a plan to deprecate
association-list style inputs altogether, I think it's ok to use them
when explicit names are required.
A
A
Arun Isaac wrote on 21 Aug 2023 16:27
87cyzg8o8p.fsf@systemreboot.net
Toggle quote (4 lines)
>> +     (list #:tests? #f ; XXX: fail to build the in-source git.
> You probably want a line break after list, because you're tending to
> the column limit pretty hard.

Ok, will do in the next patchset (or before pushing) once other issues
are resolved.
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 19:07
2f8304c4591412ed801270e423a380ddd782d515.camel@gmail.com
Am Montag, dem 21.08.2023 um 15:26 +0100 schrieb Arun Isaac:
Toggle quote (2 lines)
> [Unless] there is a plan to deprecate association-list style inputs
> altogether [...]
While not yet a plan, it is an overall goal and we can avoid this
pattern quite easily.

Cheers
(
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
87sf8c71y1.fsf@disroot.org
Arun Isaac <arunisaac@systemreboot.net> writes:
Toggle quote (4 lines)
> Sure, but that sounds very hacky. Unless there is a plan to deprecate
> association-list style inputs altogether, I think it's ok to use them
> when explicit names are required.

You could also replace the ASSOC-REF with an ungexped
THIS-PACKAGE-INPUT.
A
A
Arun Isaac wrote on 24 Aug 2023 12:59
(name . ()(address . paren@disroot.org)
87v8d4670a.fsf@systemreboot.net
Toggle quote (3 lines)
> You could also replace the ASSOC-REF with an ungexped
> THIS-PACKAGE-INPUT.

Ah, good one! I didn't know about this-package-input. I'll send an
updated patchset once we agree on other changes.

WDYT? Are there any blocking issues?
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 0/7] Add cgit-pink
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
cover.1693746463.git.arunisaac@systemreboot.net
Here is an updated patchset. I have replaced assoc-ref with
#$(this-package-input ...) and #$output. In the arguments field of the cgit
package, I have avoided tending close to the line limit by putting `list` on
its own line. Please let me know if there are any other blocking issues, and
if I may push.

Thanks!

Arun Isaac (7):
gnu: cgit: Make git-source a native input.
gnu: cgit: Make bzip2, gzip and xz inputs.
gnu: cgit: Do not return #t from custom phases.
gnu: cgit: Use G-expressions.
gnu: cgit: Add bash-minimal to inputs.
gnu: cgit: Use cc-for-target.
gnu: Add cgit-pink.

gnu/packages/version-control.scm | 187 ++++++++++++++++++-------------
1 file changed, 112 insertions(+), 75 deletions(-)


base-commit: 4818ad5ba204e094fd8995c90c16ee1940e76210
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 2/7] gnu: cgit: Make bzip2, gzip and xz inputs.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
2118b0829093de0dab600d0e8bbe1bbbbae5d13a.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[native-inputs]: Move bzip2, gzip and
xz to ...
[inputs]: ... here.
---
gnu/packages/version-control.scm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index c977da468d..22fd9371ff 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1114,14 +1114,11 @@ (define-public cgit
(sha256
(base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
;; For building manpage.
- ("asciidoc" ,asciidoc)
- ("gzip" ,gzip)
- ("bzip2" ,bzip2)
- ("xz" ,xz)))
+ ("asciidoc" ,asciidoc)))
(inputs
- (list openssl groff
+ (list bzip2 openssl groff gzip
python python-docutils python-markdown python-pygments
- zlib))
+ xz zlib))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
(description
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 1/7] gnu: cgit: Make git-source a native input.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
4a837cf5e2a54fae057bb983fb60b0bc9c997602.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[inputs]: Move git-source to ...
[native-inputs]: ... here.
---
gnu/packages/version-control.scm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 86dcea908c..c977da468d 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -21,7 +21,7 @@
;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
-;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2018, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
@@ -1104,9 +1104,6 @@ (define-public cgit
"html-converters/md2html"))
#t)))))
(native-inputs
- ;; For building manpage.
- (list asciidoc gzip bzip2 xz))
- (inputs
`(;; Building cgit requires a Git source tree.
("git-source"
,(origin
@@ -1116,13 +1113,15 @@ (define-public cgit
(uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
(sha256
(base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
- ("openssl" ,openssl)
- ("groff" ,groff)
- ("python" ,python)
- ("python-docutils" ,python-docutils)
- ("python-markdown" ,python-markdown)
- ("python-pygments" ,python-pygments)
- ("zlib" ,zlib)))
+ ;; For building manpage.
+ ("asciidoc" ,asciidoc)
+ ("gzip" ,gzip)
+ ("bzip2" ,bzip2)
+ ("xz" ,xz)))
+ (inputs
+ (list openssl groff
+ python python-docutils python-markdown python-pygments
+ zlib))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
(description
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 3/7] gnu: cgit: Do not return #t from custom phases.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
59a9aca56706d6d57ce20117df9e79943892a65e.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Do not return #t from
custom phases.
---
gnu/packages/version-control.scm | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

Toggle diff (37 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 22fd9371ff..450e74bde1 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1073,9 +1073,7 @@ (define-public cgit
(("groff") (which "groff")))
(substitute* "filters/html-converters/rst2html"
- (("rst2html\\.py") (which "rst2html.py")))
-
- #t))
+ (("rst2html\\.py") (which "rst2html.py")))))
(delete 'configure) ; no configure script
(add-after 'build 'build-man
(lambda* (#:key make-flags #:allow-other-keys)
@@ -1091,8 +1089,7 @@ (define-public cgit
;; 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"))
- #t)))
+ (string-append out "/lib/cgit/cgit.cgi")))))
(add-after 'install 'wrap-python-scripts
(lambda* (#:key outputs #:allow-other-keys)
(for-each
@@ -1101,8 +1098,7 @@ (define-public cgit
"/lib/cgit/filters/" file)
`("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))))
'("syntax-highlighting.py"
- "html-converters/md2html"))
- #t)))))
+ "html-converters/md2html")))))))
(native-inputs
`(;; Building cgit requires a Git source tree.
("git-source"
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 4/7] gnu: cgit: Use G-expressions.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
9d236785c3e66570380bec84f861dc04c73a98e1.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Rewrite using
G-expressions.
---
gnu/packages/version-control.scm | 121 ++++++++++++++++---------------
1 file changed, 61 insertions(+), 60 deletions(-)

Toggle diff (134 lines)
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"
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 5/7] gnu: cgit: Add bash-minimal to inputs.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
a3d9e63709561f75829ec2bb55b270c5a0b8f85e.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[inputs]: Add bash-minimal.
---
gnu/packages/version-control.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index a275d4e197..e963328564 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1113,7 +1113,7 @@ (define-public cgit
;; For building manpage.
("asciidoc" ,asciidoc)))
(inputs
- (list bzip2 openssl groff gzip
+ (list bash-minimal bzip2 openssl groff gzip
python python-docutils python-markdown python-pygments
xz zlib))
(home-page "https://git.zx2c4.com/cgit/")
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 6/7] gnu: cgit: Use cc-for-target.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
3de455562aaa4dbbc3116aa6c35b0de19d3ddaab.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Use cc-for-target.
---
gnu/packages/version-control.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index e963328564..f911460492 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1042,7 +1042,8 @@ (define-public cgit
(list
#:tests? #f ; XXX: fail to build the in-source git.
#:test-target "test"
- #:make-flags '("CC=gcc" "SHELL_PATH=sh")
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ "SHELL_PATH=sh")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unpack-git
--
2.39.2
A
A
Arun Isaac wrote on 4 Sep 2023 11:02
[PATCH v2 7/7] gnu: Add cgit-pink.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
029eaf77aeade7a10211dff78c6976856702343f.1693746463.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit-pink): New variable.
---
gnu/packages/version-control.scm | 43 ++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index f911460492..15a51ff151 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1124,6 +1124,49 @@ (define-public cgit
a built-in cache to decrease server I/O pressure.")
(license license:gpl2)))
+(define-public cgit-pink
+ (package
+ (inherit cgit)
+ (name "cgit-pink")
+ (version "1.4.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.causal.agency/cgit-pink")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments cgit)
+ ((#:tests? _ #f)
+ (not (%current-target-system)))
+ ((#:make-flags make-flags '())
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PERL_PATH="
+ (search-input-file %build-inputs "/bin/perl"))
+ ;; It is important to set an absolute path in SHELL_PATH
+ ;; because it is used as the shebang of generated scripts.
+ (string-append "SHELL_PATH="
+ (search-input-file %build-inputs "/bin/sh"))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs cgit)
+ (replace "git-source"
+ ;; cgit-pink is tightly bound to git. Use GIT_VER from the Makefile,
+ ;; which may not match the current (package-version git).
+ (origin
+ (method url-fetch)
+ (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
+ (sha256
+ (base32
+ "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))
+ (append gnu-gettext perl)))
+ (home-page "https://git.causal.agency/cgit-pink/about/")
+ (description "cgit-pink is a fast web interface for the Git SCM, using a
+built-in cache to decrease server I/O pressure. cgit-pink is a fork of
+cgit.")))
+
(define-public python-git-multimail
(package
(name "python-git-multimail")
--
2.39.2
L
L
Liliana Marie Prikler wrote on 4 Sep 2023 19:09
Re: [bug#65351] [PATCH v2 1/7] gnu: cgit: Make git-source a native input.
8e6112265e2dbd774d5dc0b8c666aa7649ed3137.camel@gmail.com
Am Montag, dem 04.09.2023 um 10:02 +0100 schrieb Arun Isaac:
Toggle quote (53 lines)
> * gnu/packages/version-control.scm (cgit)[inputs]: Move git-source to
> ...
> [native-inputs]: ... here.
> ---
>  gnu/packages/version-control.scm | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-
> control.scm
> index 86dcea908c..c977da468d 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -21,7 +21,7 @@
>  ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
>  ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
>  ;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
> -;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
> +;;; Copyright © 2018, 2023 Arun Isaac <arunisaac@systemreboot.net>
>  ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
>  ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
>  ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
> @@ -1104,9 +1104,6 @@ (define-public cgit
>                  "html-converters/md2html"))
>               #t)))))
>      (native-inputs
> -     ;; For building manpage.
> -     (list asciidoc gzip bzip2 xz))
> -    (inputs
>       `(;; Building cgit requires a Git source tree.
>         ("git-source"
>          ,(origin
> @@ -1116,13 +1113,15 @@ (define-public cgit
>             (uri "mirror://kernel.org/software/scm/git/git-
> 2.25.4.tar.xz")
>             (sha256
>              (base32
> "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
> -       ("openssl" ,openssl)
> -       ("groff" ,groff)
> -       ("python" ,python)
> -       ("python-docutils" ,python-docutils)
> -       ("python-markdown" ,python-markdown)
> -       ("python-pygments" ,python-pygments)
> -       ("zlib" ,zlib)))
> +       ;; For building manpage.
> +       ("asciidoc" ,asciidoc)
> +       ("gzip" ,gzip)
> +       ("bzip2" ,bzip2)
> +       ("xz" ,xz)))
> +    (inputs
> +     (list openssl groff
> +           python python-docutils python-markdown python-pygments
> +           zlib))
This patch is broken and it doesn't appear to get fixed in 4/7. If you
want git-source to be in native-inputs, you need to use (or native-
inputs inputs).

Most of these patches are not really atomic, depending on each other to
make sense. I'd instead possibly do the following:
3
[1, 2, 4, 5] squashed into a single commit
6
7

In 7, you might want to use /bin/sh if the compatibility is meant for
stuff that actually lands in the store.

Cheers
A
A
Arun Isaac wrote on 28 Sep 2023 09:12
(name . ()(address . paren@disroot.org)
87il7u4vpk.fsf@systemreboot.net
Hi Liliana,

Sorry for the long delay! Life got in the way.

Toggle quote (4 lines)
> This patch is broken and it doesn't appear to get fixed in 4/7. If you
> want git-source to be in native-inputs, you need to use (or native-
> inputs inputs).

I'm not sure what you mean. I am able to build both cgit and cgit-pink
on my machine. The QA system also agrees with

Toggle quote (7 lines)
> Most of these patches are not really atomic, depending on each other to
> make sense. I'd instead possibly do the following:
> 3
> [1, 2, 4, 5] squashed into a single commit
> 6
> 7

I disagree. I do think these commits are atomic. Each one of these
commits fixes a single independent problem with cgit that has no
relevance to cgit-pink. Finally, the last commit adds cgit-pink. Note
that there are already many commits in guix along similar lines. So,
there is precedent.

* gnu: cgit: Make git-source a native input.
* gnu: cgit: Make bzip2, gzip and xz inputs.
* gnu: cgit: Do not return #t from custom phases.
* gnu: cgit: Use G-expressions.
* gnu: cgit: Add bash-minimal to inputs.
* gnu: cgit: Use cc-for-target.
* cgit-pink gnu: Add cgit-pink.

Toggle quote (3 lines)
> In 7, you might want to use /bin/sh if the compatibility is meant for
> stuff that actually lands in the store.

/bin/sh doesn't work. I have tried. If I remember correctly, this is to
do with how the SHELL_PATH gets substituted into generated scripts.

Cheers!
L
L
Liliana Marie Prikler wrote on 28 Sep 2023 18:16
(name . ()(address . paren@disroot.org)
32d53de38b947de59749c6c63e4bf091e8bb4abf.camel@gmail.com
Am Donnerstag, dem 28.09.2023 um 08:12 +0100 schrieb Arun Isaac:
Toggle quote (12 lines)
>
> Hi Liliana,
>
> Sorry for the long delay! Life got in the way.
>
> > This patch is broken and it doesn't appear to get fixed in 4/7.  If
> > you want git-source to be in native-inputs, you need to use (or
> > native-inputs inputs).
>
> I'm not sure what you mean. I am able to build both cgit and cgit-
> pink on my machine. The QA system also agrees with
> me. https://qa.guix.gnu.org/issue/65351
CI doesn't do cross-builds, it does simulated native builds, so you
won't see the issue.

Toggle quote (20 lines)
> > Most of these patches are not really atomic, depending on each
> > other to make sense.  I'd instead possibly do the following:
> > 3
> > [1, 2, 4, 5] squashed into a single commit
> > 6
> > 7
>
> I disagree. I do think these commits are atomic. Each one of these
> commits fixes a single independent problem with cgit that has no
> relevance to cgit-pink. Finally, the last commit adds cgit-pink. Note
> that there are already many commits in guix along similar lines. So,
> there is precedent.
>
> * gnu: cgit: Make git-source a native input.
> * gnu: cgit: Make bzip2, gzip and xz inputs.
> * gnu: cgit: Do not return #t from custom phases.
> * gnu: cgit: Use G-expressions.
> * gnu: cgit: Add bash-minimal to inputs.
> * gnu: cgit: Use cc-for-target.
> * cgit-pink gnu: Add cgit-pink.
Indeed, there is precedent. However, when moving stuff around, such as
in 1, you also need to update the dependent stuff, which you haven't
done and which also causes more noise along the line. In this series,
you need three commits to basically get input handling "correct". The
intermediate commits are duds in terms of guix time-machine, which
isn't great.

Toggle quote (6 lines)
> > In 7, you might want to use /bin/sh if the compatibility is meant
> > for stuff that actually lands in the store.
>
> /bin/sh doesn't work. I have tried. If I remember correctly, this is
> to do with how the SHELL_PATH gets substituted into generated
> scripts.
For the record, what kind of generated scripts are we talking here?
Invoked at build time or sent to the store?

Cheers
A
A
Arun Isaac wrote on 4 Oct 2023 01:27
(name . ()(address . paren@disroot.org)
87o7hf1e4a.fsf@systemreboot.net
Hi Liliana,

Toggle quote (10 lines)
>> > This patch is broken and it doesn't appear to get fixed in 4/7.  If
>> > you want git-source to be in native-inputs, you need to use (or
>> > native-inputs inputs).
>>
>> I'm not sure what you mean. I am able to build both cgit and cgit-
>> pink on my machine. The QA system also agrees with
>> me. https://qa.guix.gnu.org/issue/65351
> CI doesn't do cross-builds, it does simulated native builds, so you
> won't see the issue.

Ah, I see what you mean now. I have deleted the patch making git-source a
native input. I guess it's ok to leave it as an input since it doesn't
really matter in this case.

Toggle quote (7 lines)
> Indeed, there is precedent. However, when moving stuff around, such as
> in 1, you also need to update the dependent stuff, which you haven't
> done and which also causes more noise along the line. In this series,
> you need three commits to basically get input handling "correct". The
> intermediate commits are duds in terms of guix time-machine, which
> isn't great.

I have reworked the patchset into only 3 patches now. Let me know if
this is ok.

Toggle quote (9 lines)
>> > In 7, you might want to use /bin/sh if the compatibility is meant
>> > for stuff that actually lands in the store.
>>
>> /bin/sh doesn't work. I have tried. If I remember correctly, this is
>> to do with how the SHELL_PATH gets substituted into generated
>> scripts.
> For the record, what kind of generated scripts are we talking here?
> Invoked at build time or sent to the store?

The cgit Makefiles are tightly coupled with git source code and the git
Makefiles. The generated scripts are wrapper scripts for git binaries
like git-shell, git-upload-archive, git-upload-pack, etc. As far as I
can tell, cgit does not use them at all. They are neither invoked at
build time nor are they sent to the store. They are only invoked at test
time, and that fails if you have SHELL_PATH=sh. This specifically
bothers only cgit-pink and not cgit since cgit does not run the test
suite.

SHELL_PATH is also directly executed as a shell in some parts of the
Makefile. For example,

Toggle snippet (4 lines)
GIT-VERSION-FILE: FORCE
@$(SHELL_PATH) ./GIT-VERSION-GEN

and

Toggle snippet (4 lines)
config-list.h: Documentation/*config.txt Documentation/config/*.txt
$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh >$@

That's why SHELL_PATH=/bin/sh fails since /bin/sh does not exist in the
build environment.

A v3 patchset follows.

Cheers!
A
A
Arun Isaac wrote on 4 Oct 2023 01:59
[PATCH v3 2/3] gnu: cgit: Fix cross compilation.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
d7dda112210ef3e440d19a2dbebed7f07298f6e2.1696375547.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[native-inputs]: Move bzip2, gzip and
xz to ...
[inputs]: ... here. Add bash-minimal.
[arguments]: Use cc-for-target.
---
gnu/packages/version-control.scm | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 53c476d607..f504fe9831 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1043,7 +1043,8 @@ (define-public cgit
(list
#:tests? #f ; XXX: fail to build the in-source git.
#:test-target "test"
- #:make-flags '("CC=gcc" "SHELL_PATH=sh")
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ "SHELL_PATH=sh")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unpack-git
@@ -1103,7 +1104,7 @@ (define-public cgit
"html-converters/md2html")))))))
(native-inputs
;; For building manpage.
- (list asciidoc gzip bzip2 xz))
+ (list asciidoc))
(inputs
`(;; Building cgit requires a Git source tree.
("git-source"
@@ -1114,13 +1115,20 @@ (define-public cgit
(uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
(sha256
(base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
+ ("bash-minimal" ,bash-minimal)
("openssl" ,openssl)
- ("groff" ,groff)
("python" ,python)
("python-docutils" ,python-docutils)
("python-markdown" ,python-markdown)
("python-pygments" ,python-pygments)
- ("zlib" ,zlib)))
+ ("zlib" ,zlib)
+ ;; bzip2, groff, gzip and xz are inputs (not native inputs)
+ ;; since they are actually substituted into cgit source and
+ ;; referenced by the built package output.
+ ("bzip2" ,bzip2)
+ ("groff" ,groff)
+ ("gzip" ,gzip)
+ ("xz" ,xz)))
(home-page "https://git.zx2c4.com/cgit/")
(synopsis "Web frontend for git repositories")
(description
--
2.41.0
A
A
Arun Isaac wrote on 4 Oct 2023 01:59
[PATCH v3 1/3] gnu: cgit: Update package style.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
4ad543017994ac442e12a6943356ec4358938ae9.1696375547.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit)[arguments]: Rewrite using
G-expressions. Do not return #t from custom phases.
---
gnu/packages/version-control.scm | 125 +++++++++++++++----------------
1 file changed, 61 insertions(+), 64 deletions(-)

Toggle diff (140 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 9716a6f27a..53c476d607 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1040,70 +1040,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")))
-
- #t))
- (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"))
- #t)))
- (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"))
- #t)))))
+ (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
;; For building manpage.
(list asciidoc gzip bzip2 xz))

base-commit: 8e6022732ab6c4ba256f99d925f5fd413a87372c
--
2.41.0
A
A
Arun Isaac wrote on 4 Oct 2023 01:59
[PATCH v3 3/3] gnu: Add cgit-pink.
(address . 65351@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
1a43f1b5581301be6f304b39a8d2bb5ce88d3606.1696375547.git.arunisaac@systemreboot.net
* gnu/packages/version-control.scm (cgit-pink): New variable.
---
gnu/packages/version-control.scm | 46 ++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index f504fe9831..d9c53af71c 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1136,6 +1136,52 @@ (define-public cgit
a built-in cache to decrease server I/O pressure.")
(license license:gpl2)))
+(define-public cgit-pink
+ (package
+ (inherit cgit)
+ (name "cgit-pink")
+ (version "1.4.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.causal.agency/cgit-pink")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0yp6rm60pz8pj8wrm1aglix51hhy00al86mm94ag2bifc92q23ar"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments cgit)
+ ((#:tests? _ #f)
+ (not (%current-target-system)))
+ ((#:make-flags _ '())
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PERL_PATH="
+ (search-input-file %build-inputs "/bin/perl"))
+ ;; It is important to set an absolute path in SHELL_PATH
+ ;; because it is used as the shebang of generated scripts that
+ ;; are invoked during the test phase.
+ (string-append "SHELL_PATH="
+ (search-input-file %build-inputs "/bin/sh"))))))
+ (inputs
+ (modify-inputs (package-inputs cgit)
+ (replace "git-source"
+ ;; cgit-pink is tightly bound to git. Use GIT_VER from the Makefile,
+ ;; which may not match the current (package-version git).
+ (origin
+ (method url-fetch)
+ (uri "mirror://kernel.org/software/scm/git/git-2.36.1.tar.xz")
+ (sha256
+ (base32
+ "0w43a35mhc2qf2gjkxjlnkf2lq8g0snf34iy5gqx2678yq7llpa0"))))))
+ (native-inputs
+ (modify-inputs (package-native-inputs cgit)
+ (append gnu-gettext perl)))
+ (home-page "https://git.causal.agency/cgit-pink/about/")
+ (description "cgit-pink is a fast web interface for the Git SCM, using a
+built-in cache to decrease server I/O pressure. cgit-pink is a fork of
+cgit.")))
+
(define-public python-git-multimail
(package
(name "python-git-multimail")
--
2.41.0
L
L
Ludovic Courtès wrote on 5 Oct 2023 14:48
Re: bug#65351: [PATCH] gnu: Add cgit-pink.
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
87sf6p6xqm.fsf_-_@gnu.org
Arun Isaac <arunisaac@systemreboot.net> skribis:

Toggle quote (5 lines)
> * gnu/packages/version-control.scm (cgit)[native-inputs]: Move bzip2, gzip and
> xz to ...
> [inputs]: ... here. Add bash-minimal.
> [arguments]: Use cc-for-target.

[...]

Toggle quote (2 lines)
> * gnu/packages/version-control.scm (cgit-pink): New variable.

LGTM!

Ludo’.
A
A
Arun Isaac wrote on 5 Oct 2023 18:39
(name . Ludovic Courtès)(address . ludo@gnu.org)
871qe9c9c5.fsf@systemreboot.net
Toggle quote (2 lines)
> LGTM!

Pushed, thanks!
Closed
?