unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433.
@ 2024-01-06 13:59 Tomas Volf
  2024-01-06 14:27 ` Tomas Volf
  2024-01-07 18:26 ` bug#68287: " Mathieu Othacehe
  0 siblings, 2 replies; 3+ messages in thread
From: Tomas Volf @ 2024-01-06 13:59 UTC (permalink / raw)
  To: 68287; +Cc: Tomas Volf

The 1.2.3 release is more than 4 years old, is buggy (for example caching is
broken).  Both the upstream itself and git.kernel.org seems to be running a
newer custom version built from the git.

Therefore this commit replaces the old release with a build from the git tree.

* gnu/packages/version-control.scm (cgit): Update to
793c420897e18eb3474c751d54cf4e0983f85433.
[inputs]: Update git to 2.43.0.

Change-Id: I3441e9e2837d22ae208f5cccc53d815cc3e0f042
---
 gnu/packages/version-control.scm | 211 ++++++++++++++++---------------
 1 file changed, 107 insertions(+), 104 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 40d7a00dae..4d5d1a9720 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1072,115 +1072,118 @@ (define-public git-remote-gcrypt
    (license license:gpl3+)))
 
 (define-public cgit
-  (package
-    (name "cgit")
-    ;; Update the ‘git-source’ input as well.
-    (version "1.2.3")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://git.zx2c4.com/cgit/snapshot/cgit-"
-                    version ".tar.xz"))
-              (sha256
-               (base32
-                "193d990ym10qlslk0p8mjwp2j6rhqa7fq0y1iff65lvbyv914pss"))))
-    (build-system gnu-build-system)
-    (arguments
-     (list
-      #:tests? #f ; XXX: fail to build the in-source git.
-      #:test-target "test"
-      #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
-                           "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")))
+  (let ((commit "793c420897e18eb3474c751d54cf4e0983f85433")
+        (rev "1"))
+    (package
+      (name "cgit")
+      ;; Update the ‘git-source’ input as well.
+      (version (git-version "1.2.3" rev commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.zx2c4.com/cgit")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "1mhrm14wpqvralf9j33ih5ai6naiq3g2jg2z91gnw9dhh8f9ilwz"))
+                (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f                    ; XXX: fail to build the in-source git.
+        #:test-target "test"
+        #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                             "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/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/txt2html"
+                  (("sed") (which "sed")))
 
-              (substitute* "filters/html-converters/man2html"
-                (("groff") (which "groff")))
+                (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))
-    (inputs
-     `(;; Building cgit requires a Git source tree.
-       ("git-source"
-        ,(origin
-           (method url-fetch)
-           ;; cgit is tightly bound to git.  Use GIT_VER from the Makefile,
-           ;; which may not match the current (package-version git).
-           (uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
-           (sha256
-            (base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
-       ("bash-minimal" ,bash-minimal)
-       ("openssl" ,openssl)
-       ("python" ,python)
-       ("python-docutils" ,python-docutils)
-       ("python-markdown" ,python-markdown)
-       ("python-pygments" ,python-pygments)
-       ("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
-     "CGit is an attempt to create a fast web interface for the Git SCM, using
+                (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))
+      (inputs
+       `( ;; Building cgit requires a Git source tree.
+         ("git-source"
+          ,(origin
+             (method url-fetch)
+             ;; cgit is tightly bound to git.  Use GIT_VER from the Makefile,
+             ;; which may not match the current (package-version git).
+             (uri "mirror://kernel.org/software/scm/git/git-2.43.0.tar.xz")
+             (sha256
+              (base32 "1v3nkfm3gw8wr7595qy86qla8xyjvi85fmly4lfph4frfcz60ijl"))))
+         ("bash-minimal" ,bash-minimal)
+         ("openssl" ,openssl)
+         ("python" ,python)
+         ("python-docutils" ,python-docutils)
+         ("python-markdown" ,python-markdown)
+         ("python-pygments" ,python-pygments)
+         ("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
+       "CGit is an attempt to create a fast web interface for the Git SCM, using
 a built-in cache to decrease server I/O pressure.")
-    (license license:gpl2)))
+      (license license:gpl2))))
 
 (define-public cgit-pink
   (package

base-commit: c0e21e523d93081153a2ffc91e5a9f06afe62b91
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433.
  2024-01-06 13:59 [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433 Tomas Volf
@ 2024-01-06 14:27 ` Tomas Volf
  2024-01-07 18:26 ` bug#68287: " Mathieu Othacehe
  1 sibling, 0 replies; 3+ messages in thread
From: Tomas Volf @ 2024-01-06 14:27 UTC (permalink / raw)
  To: 68287

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

I tested the package (it is actually running at git.wolfsden.cz) and it seems to
work fine.  No changes in configuration need to be done.

Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#68287: [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433.
  2024-01-06 13:59 [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433 Tomas Volf
  2024-01-06 14:27 ` Tomas Volf
@ 2024-01-07 18:26 ` Mathieu Othacehe
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Othacehe @ 2024-01-07 18:26 UTC (permalink / raw)
  To: Tomas Volf; +Cc: 68287-done


> * gnu/packages/version-control.scm (cgit): Update to
> 793c420897e18eb3474c751d54cf4e0983f85433.
> [inputs]: Update git to 2.43.0.

Applied, thanks,

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-07 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-06 13:59 [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433 Tomas Volf
2024-01-06 14:27 ` Tomas Volf
2024-01-07 18:26 ` bug#68287: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).