GNU bug report logs - #31277
[PATCH] cgit changes

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Thu, 26 Apr 2018 21:15:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31277 in the body.
You can then email your comments to 31277 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Thu, 26 Apr 2018 21:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 26 Apr 2018 21:15:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] cgit changes
Date: Thu, 26 Apr 2018 22:13:55 +0100
[Message part 1 (text/plain, inline)]
I recently managed to succesfully use the cgit service with the Gitolite
service that is available here [1]. I had to make some changes to the
Gitolite service, so that needs updating, but I also made some changes
to the cgit package and service to make some of the scripts included in
the cgit package work on GuixSD and make porting over the cgit service
configuation I was using on Debian a little easier.

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30809

Christopher Baines (3):
  gnu: cgit: Fix included scripts.
  services: cgit: Improve handling of extra-options.
  services: cgit: Make project-list permit a string.

 gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
 gnu/services/cgit.scm            | 18 +++++++++++++++---
 2 files changed, 46 insertions(+), 4 deletions(-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Thu, 26 Apr 2018 21:24:02 GMT) Full text and rfc822 format available.

Message #8 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 2/3] services: cgit: Improve handling of extra-options.
Date: Thu, 26 Apr 2018 22:23:08 +0100
* gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options,
one per line, before the scan-path, as this makes it possible to use the
extra-options to affect the global behaviour for repositories.
---
 gnu/services/cgit.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 8ef12cd5a..bacd6ca16 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -642,13 +642,19 @@ for cgit to allow access to that repository.")
     (not (memq (configuration-field-name field)
                '(project-list
                  repository-directory
-                 repositories))))
+                 repositories
+                 extra-options))))
   #~(string-append
      #$(let ((rest (filter rest? cgit-configuration-fields)))
          (serialize-configuration config rest))
      #$(serialize-project-list
         'project-list
         (cgit-configuration-project-list config))
+     #$(string-join
+        (append
+         (cgit-configuration-extra-options config)
+         '(""))
+        "\n")
      #$(serialize-repository-directory
         'repository-directory
         (cgit-configuration-repository-directory config))
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Thu, 26 Apr 2018 21:24:02 GMT) Full text and rfc822 format available.

Message #11 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 3/3] services: cgit: Make project-list permit a string.
Date: Thu, 26 Apr 2018 22:23:09 +0100
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.

* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle string values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and strings.
---
 gnu/services/cgit.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bacd6ca16..240d4d8d9 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -115,6 +115,10 @@
 (define (serialize-file-object field-name val)
   (serialize-string field-name val))
 
+(define (project-list? val)
+  (or (list? val)
+      (string? val)))
+
 
 ;;;
 ;;; Serialize <nginx-server-configuration>
@@ -167,7 +171,9 @@
   (if (null? val) ""
       (serialize-field
        'project-list
-       (plain-file "project-list" (string-join val "\n")))))
+       (if (string? val)
+           val
+           (plain-file "project-list" (string-join val "\n"))))))
 
 (define repository-directory? string?)
 
@@ -543,7 +549,7 @@ disabled.")
    "Flag which, when set to @samp{#t}, will make cgit omit the standard
 header on all pages.")
   (project-list
-   (list '())
+   (project-list '())
    "A list of subdirectories inside of @code{repository-directory}, relative
 to it, that should loaded as Git repositories.  An empty list means that all
 subdirectories will be loaded.")
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Thu, 26 Apr 2018 21:24:03 GMT) Full text and rfc822 format available.

Message #14 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Thu, 26 Apr 2018 22:23:07 +0100
Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.

* gnu/packages/version-control.scm (cgit)[arguments]: Include
about-formatting.sh and the html-converters in the patch-absolute-file-names
phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
the md2html converter.
[inputs]: Add groff, python, python-docutils, python-markdown and
python-pygments.
---
 gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index b82abaf9e..f75900d28 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -551,6 +551,21 @@ collaboration using typical untrusted file hosts or services.")
                 (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
@@ -569,7 +584,17 @@ collaboration using typical untrusted file hosts or services.")
                     ;; to get it stripped.
                     (rename-file (string-append out "/share/cgit/cgit.cgi")
                                  (string-append out "/lib/cgit/cgit.cgi"))
-                    #t)))))))
+                    #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)
+                  `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
+              '("syntax-highlighting.py"
+                "html-converters/md2html"))
+             #t)))))
     (native-inputs
      ;; For building manpage.
      `(("asciidoc" ,asciidoc)
@@ -588,6 +613,11 @@ collaboration using typical untrusted file hosts or services.")
             (base32
              "1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
        ("openssl" ,openssl)
+       ("groff" ,groff)
+       ("python" ,python)
+       ("python-docutils" ,python-docutils)
+       ("python-markdown" ,python-markdown)
+       ("python-pygments" ,python-pygments)
        ("zlib" ,zlib)))
     (home-page "https://git.zx2c4.com/cgit/")
     (synopsis "Web frontend for git repositories")
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Sat, 28 Apr 2018 10:58:01 GMT) Full text and rfc822 format available.

Message #17 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit
 a string.
Date: Sat, 28 Apr 2018 12:57:16 +0200
Christopher Baines <mail <at> cbaines.net> writes:

> Instead of having the service manage the list, it's useful to be able to point
> this at an existing file, for example, when using cgit together with gitolite.
>
> * gnu/services/cgit.scm (project-list?): New procedure.
> (serialize-project-list): Handle string values.
> (<cgit-configuration>): Change the predicate for project-list to allow lists
> and strings.

Hi Christopher,

Good idea!  But could you replace 'string?' with 'file-object?', so that
the file can be in the store?

And could you update the documentation?  There is a helper
(generate-cgit-documentation) that might help you do it.

Otherwise it looks good to me.  Thank you!
Clément




Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Sat, 28 Apr 2018 11:20:02 GMT) Full text and rfc822 format available.

Message #20 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of
 extra-options.
Date: Sat, 28 Apr 2018 13:19:04 +0200
Christopher Baines <mail <at> cbaines.net> writes:

> * gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options,
> one per line, before the scan-path, as this makes it possible to use the
> extra-options to affect the global behaviour for repositories.
> ---
>  gnu/services/cgit.scm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
> index 8ef12cd5a..bacd6ca16 100644
> --- a/gnu/services/cgit.scm
> +++ b/gnu/services/cgit.scm
> @@ -642,13 +642,19 @@ for cgit to allow access to that repository.")
>      (not (memq (configuration-field-name field)
>                 '(project-list
>                   repository-directory
> -                 repositories))))
> +                 repositories
> +                 extra-options))))

                      ---^
Very small nitpick: could you put extra-options between project-list and
repository-directory there?  So that the order is the same with what
comes below.

>    #~(string-append
>       #$(let ((rest (filter rest? cgit-configuration-fields)))
>           (serialize-configuration config rest))
>       #$(serialize-project-list
>          'project-list
>          (cgit-configuration-project-list config))
> +     #$(string-join
> +        (append
> +         (cgit-configuration-extra-options config)
> +         '(""))
> +        "\n")

Could you put the serialization code in a dedicated function?
(e.g. SERIALIZE-EXTRA-OPTION)  So that SERIALIZE-CGIT-CONFIGURATION is
only responsible for the field ordering.

Also, I don't understand why you append '("").  If it's just to make
cgitrc look prettier, I'm not sure it's a good idea.  But maybe I missed
something?

Otherwise LGTM :-)

Clément




Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Sat, 28 Apr 2018 11:32:00 GMT) Full text and rfc822 format available.

Message #23 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Sat, 28 Apr 2018 13:30:55 +0200
Christopher Baines <mail <at> cbaines.net> writes:

> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>
> * gnu/packages/version-control.scm (cgit)[arguments]: Include
> about-formatting.sh and the html-converters in the patch-absolute-file-names
> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
> the md2html converter.
> [inputs]: Add groff, python, python-docutils, python-markdown and
> python-pygments.
> ---
>  gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
> index b82abaf9e..f75900d28 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -551,6 +551,21 @@ collaboration using typical untrusted file hosts or services.")
>                  (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
> @@ -569,7 +584,17 @@ collaboration using typical untrusted file hosts or services.")
>                      ;; to get it stripped.
>                      (rename-file (string-append out "/share/cgit/cgit.cgi")
>                                   (string-append out "/lib/cgit/cgit.cgi"))
> -                    #t)))))))
> +                    #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)
> +                  `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
> +              '("syntax-highlighting.py"
> +                "html-converters/md2html"))
> +             #t)))))
>      (native-inputs
>       ;; For building manpage.
>       `(("asciidoc" ,asciidoc)
> @@ -588,6 +613,11 @@ collaboration using typical untrusted file hosts or services.")
>              (base32
>               "1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
>         ("openssl" ,openssl)
> +       ("groff" ,groff)
> +       ("python" ,python)
> +       ("python-docutils" ,python-docutils)
> +       ("python-markdown" ,python-markdown)
> +       ("python-pygments" ,python-pygments)
>         ("zlib" ,zlib)))
>      (home-page "https://git.zx2c4.com/cgit/")
>      (synopsis "Web frontend for git repositories")

Great!  LGTM :-)

Clément




Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Sat, 28 Apr 2018 11:40:01 GMT) Full text and rfc822 format available.

Message #26 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH] cgit changes
Date: Sat, 28 Apr 2018 13:39:29 +0200
Oh, and please could you add copyright lines?

Thanks!
Clément




Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:24:01 GMT) Full text and rfc822 format available.

Message #29 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 3/3] services: cgit: Make project-list permit a file-object.
Date: Fri, 18 May 2018 11:23:39 +0100
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.

* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle file-object values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and file-objects.
---
 doc/guix.texi         |  2 +-
 gnu/services/cgit.scm | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 005c0597a..81ad4f48f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19241,7 +19241,7 @@ Defaults to @samp{#f}.
 
 @end deftypevr
 
-@deftypevr {@code{cgit-configuration} parameter} list project-list
+@deftypevr {@code{cgit-configuration} parameter} project-list project-list
 A list of subdirectories inside of @code{repository-directory}, relative
 to it, that should loaded as Git repositories.  An empty list means that
 all subdirectories will be loaded.
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 3183535d4..3289d3733 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -116,6 +116,10 @@
 (define (serialize-file-object field-name val)
   (serialize-string field-name val))
 
+(define (project-list? val)
+  (or (list? val)
+      (file-object? val)))
+
 
 ;;;
 ;;; Serialize <nginx-server-configuration>
@@ -168,7 +172,9 @@
   (if (null? val) ""
       (serialize-field
        'project-list
-       (plain-file "project-list" (string-join val "\n")))))
+       (if (file-object? val)
+           val
+           (plain-file "project-list" (string-join val "\n"))))))
 
 (define (serialize-extra-options extra-options)
   (string-join extra-options "\n" 'suffix))
@@ -547,7 +553,7 @@ disabled.")
    "Flag which, when set to @samp{#t}, will make cgit omit the standard
 header on all pages.")
   (project-list
-   (list '())
+   (project-list '())
    "A list of subdirectories inside of @code{repository-directory}, relative
 to it, that should loaded as Git repositories.  An empty list means that all
 subdirectories will be loaded.")
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:24:02 GMT) Full text and rfc822 format available.

Message #32 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 2/3] services: cgit: Improve handling of extra-options.
Date: Fri, 18 May 2018 11:23:38 +0100
* gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options,
one per line, before the scan-path, as this makes it possible to use the
extra-options to affect the global behaviour for repositories.
(serialize-extra-options): New procedure.
---
 gnu/services/cgit.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 8ef12cd5a..3183535d4 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
+;;; Copyright © 2018 Christopher Baines <mail <at> cbaines.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -169,6 +170,9 @@
        'project-list
        (plain-file "project-list" (string-join val "\n")))))
 
+(define (serialize-extra-options extra-options)
+  (string-join extra-options "\n" 'suffix))
+
 (define repository-directory? string?)
 
 (define (serialize-repository-directory _ val)
@@ -641,6 +645,7 @@ for cgit to allow access to that repository.")
   (define (rest? field)
     (not (memq (configuration-field-name field)
                '(project-list
+                 extra-options
                  repository-directory
                  repositories))))
   #~(string-append
@@ -649,6 +654,8 @@ for cgit to allow access to that repository.")
      #$(serialize-project-list
         'project-list
         (cgit-configuration-project-list config))
+     #$(serialize-extra-options
+        (cgit-configuration-extra-options config))
      #$(serialize-repository-directory
         'repository-directory
         (cgit-configuration-repository-directory config))
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:24:02 GMT) Full text and rfc822 format available.

Message #35 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 31277 <at> debbugs.gnu.org
Subject: [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Fri, 18 May 2018 11:23:37 +0100
Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.

* gnu/packages/version-control.scm (cgit)[arguments]: Include
about-formatting.sh and the html-converters in the patch-absolute-file-names
phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
the md2html converter.
[inputs]: Add groff, python, python-docutils, python-markdown and
python-pygments.
---
 gnu/packages/version-control.scm | 33 +++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index b41529d4f..f53d0f4fa 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2017 Stefan Reichör <stefan <at> xsteve.at>
 ;;; Copyright © 2017 Oleg Pykhalov <go.wigust <at> gmail.com>
 ;;; Copyright © 2018 Sou Bunnbu <iyzsong <at> member.fsf.org>
+;;; Copyright © 2018 Christopher Baines <mail <at> cbaines.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -551,6 +552,21 @@ collaboration using typical untrusted file hosts or services.")
                 (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
@@ -569,7 +585,17 @@ collaboration using typical untrusted file hosts or services.")
                     ;; to get it stripped.
                     (rename-file (string-append out "/share/cgit/cgit.cgi")
                                  (string-append out "/lib/cgit/cgit.cgi"))
-                    #t)))))))
+                    #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)
+                  `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
+              '("syntax-highlighting.py"
+                "html-converters/md2html"))
+             #t)))))
     (native-inputs
      ;; For building manpage.
      `(("asciidoc" ,asciidoc)
@@ -588,6 +614,11 @@ collaboration using typical untrusted file hosts or services.")
             (base32
              "1r2aa19gnrvm2y4fqcvpw1g9l72n48axqmpgv18s6d0y2p72vhzj"))))
        ("openssl" ,openssl)
+       ("groff" ,groff)
+       ("python" ,python)
+       ("python-docutils" ,python-docutils)
+       ("python-markdown" ,python-markdown)
+       ("python-pygments" ,python-pygments)
        ("zlib" ,zlib)))
     (home-page "https://git.zx2c4.com/cgit/")
     (synopsis "Web frontend for git repositories")
-- 
2.17.0





Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:56:01 GMT) Full text and rfc822 format available.

Message #38 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Fri, 18 May 2018 11:55:49 +0100
[Message part 1 (text/plain, inline)]
Clément Lassieur <clement <at> lassieur.org> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>
>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>> the md2html converter.
>> [inputs]: Add groff, python, python-docutils, python-markdown and
>> python-pygments.
>> ---
>>  gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>>  1 file changed, 31 insertions(+), 1 deletion(-)
>>

...

> Great!  LGTM :-)
>
> Clément

Thanks for taking a look Clément, I've now sent another set of patches
with some changes.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:57:02 GMT) Full text and rfc822 format available.

Message #41 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of
 extra-options.
Date: Fri, 18 May 2018 11:56:44 +0100
[Message part 1 (text/plain, inline)]
Clément Lassieur <clement <at> lassieur.org> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> * gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra options,
>> one per line, before the scan-path, as this makes it possible to use the
>> extra-options to affect the global behaviour for repositories.
>> ---
>>  gnu/services/cgit.scm | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
>> index 8ef12cd5a..bacd6ca16 100644
>> --- a/gnu/services/cgit.scm
>> +++ b/gnu/services/cgit.scm
>> @@ -642,13 +642,19 @@ for cgit to allow access to that repository.")
>>      (not (memq (configuration-field-name field)
>>                 '(project-list
>>                   repository-directory
>> -                 repositories))))
>> +                 repositories
>> +                 extra-options))))
>
>                       ---^
> Very small nitpick: could you put extra-options between project-list and
> repository-directory there?  So that the order is the same with what
> comes below.

Sure, this should be fixed now.

>>    #~(string-append
>>       #$(let ((rest (filter rest? cgit-configuration-fields)))
>>           (serialize-configuration config rest))
>>       #$(serialize-project-list
>>          'project-list
>>          (cgit-configuration-project-list config))
>> +     #$(string-join
>> +        (append
>> +         (cgit-configuration-extra-options config)
>> +         '(""))
>> +        "\n")
>
> Could you put the serialization code in a dedicated function?
> (e.g. SERIALIZE-EXTRA-OPTION)  So that SERIALIZE-CGIT-CONFIGURATION is
> only responsible for the field ordering.

Done.

> Also, I don't understand why you append '("").  If it's just to make
> cgitrc look prettier, I'm not sure it's a good idea.  But maybe I missed
> something?

The '("") was to add an extra newline effectively. I've replaced this by
using the 'suffix option of string-join in the updated patch.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 10:58:02 GMT) Full text and rfc822 format available.

Message #44 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 3/3] services: cgit: Make project-list permit
 a string.
Date: Fri, 18 May 2018 11:57:06 +0100
[Message part 1 (text/plain, inline)]
Clément Lassieur <clement <at> lassieur.org> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Instead of having the service manage the list, it's useful to be able to point
>> this at an existing file, for example, when using cgit together with gitolite.
>>
>> * gnu/services/cgit.scm (project-list?): New procedure.
>> (serialize-project-list): Handle string values.
>> (<cgit-configuration>): Change the predicate for project-list to allow lists
>> and strings.
>
> Hi Christopher,
>
> Good idea!  But could you replace 'string?' with 'file-object?', so that
> the file can be in the store?
>
> And could you update the documentation?  There is a helper
> (generate-cgit-documentation) that might help you do it.

Both should be done now :)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#31277; Package guix-patches. (Fri, 18 May 2018 15:50:01 GMT) Full text and rfc822 format available.

Message #47 received at 31277 <at> debbugs.gnu.org (full text, mbox):

From: Clément Lassieur <clement <at> lassieur.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 31277 <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Fri, 18 May 2018 17:49:50 +0200
Christopher Baines <mail <at> cbaines.net> writes:

> Clément Lassieur <clement <at> lassieur.org> writes:
>
>> Christopher Baines <mail <at> cbaines.net> writes:
>>
>>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>>
>>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>>> the md2html converter.
>>> [inputs]: Add groff, python, python-docutils, python-markdown and
>>> python-pygments.
>>> ---
>>>  gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>>>  1 file changed, 31 insertions(+), 1 deletion(-)
>>>
>
> ...
>
>> Great!  LGTM :-)
>>
>> Clément
>
> Thanks for taking a look Clément, I've now sent another set of patches
> with some changes.

Ok, thank you!  LGTM then :-)




Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Fri, 18 May 2018 18:14:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Fri, 18 May 2018 18:14:02 GMT) Full text and rfc822 format available.

Message #52 received at 31277-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Clément Lassieur <clement <at> lassieur.org>
Cc: 31277-done <at> debbugs.gnu.org
Subject: Re: [bug#31277] [PATCH 1/3] gnu: cgit: Fix included scripts.
Date: Fri, 18 May 2018 19:13:08 +0100
[Message part 1 (text/plain, inline)]
Clément Lassieur <clement <at> lassieur.org> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Clément Lassieur <clement <at> lassieur.org> writes:
>>
>>> Christopher Baines <mail <at> cbaines.net> writes:
>>>
>>>> Fix the about-formatting.sh, syntax-highlighting.py and html-converters files.
>>>>
>>>> * gnu/packages/version-control.scm (cgit)[arguments]: Include
>>>> about-formatting.sh and the html-converters in the patch-absolute-file-names
>>>> phase and add a wrap-python-scripts phase to wrap syntax-highlighting.py and
>>>> the md2html converter.
>>>> [inputs]: Add groff, python, python-docutils, python-markdown and
>>>> python-pygments.
>>>> ---
>>>>  gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
>>>>  1 file changed, 31 insertions(+), 1 deletion(-)
>>>>
>>
>> ...
>>
>>> Great!  LGTM :-)
>>>
>>> Clément
>>
>> Thanks for taking a look Clément, I've now sent another set of patches
>> with some changes.
>
> Ok, thank you!  LGTM then :-)

Great, I've pushed these patches now :)
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 16 Jun 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.