diff mbox series

[bug#65351] gnu: Add cgit-pink.

Message ID d141cbf5ee2c7433be18f811bcc2a8ecc8aaa381.1692280182.git.arunisaac@systemreboot.net
State New
Headers show
Series [bug#65351] gnu: Add cgit-pink. | expand

Commit Message

Arun Isaac Aug. 17, 2023, 1:51 p.m. UTC
* 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(-)


base-commit: 1b2d43fe016848ea2ec16ff18cbc14340944fc4e

Comments

Liliana Marie Prikler Aug. 17, 2023, 7 p.m. UTC | #1
Hi Arun,

Am Donnerstag, dem 17.08.2023 um 14:51 +0100 schrieb Arun Isaac:
> * 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.
> +          ;; 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?

> +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
\( Aug. 17, 2023, 7:16 p.m. UTC | #2
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?  :)

  -- (
Liliana Marie Prikler Aug. 17, 2023, 8:20 p.m. UTC | #3
Am Donnerstag, dem 17.08.2023 um 20:16 +0100 schrieb (:
> 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...
\( Aug. 17, 2023, 8:53 p.m. UTC | #4
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
> 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.

  -- (
Arun Isaac Aug. 18, 2023, 9 a.m. UTC | #5
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.

>> +          (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.

I was trying to avoid having to use the old assocation-list style inputs
with input names. But, I have changed it now.

>> +          ;; 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.

>> +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
diff mbox series

Patch

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")