[PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433.

  • Done
  • quality assurance status badge
Details
2 participants
  • Mathieu Othacehe
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 1 years ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
f41023e6c2e798bc60379667cfb23e22f91ce6df.1704549583.git.~@wolfsden.cz
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(-)

Toggle diff (231 lines)
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
Tomas Volf wrote 1 years ago
(address . 68287@debbugs.gnu.org)
ZZljWZKbfvRjhuCc@ws
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.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWZY1kACgkQL7/ufbZ/
waku2Q/9HW4nFYKHPxJEKmoNeFpc4dCUhOQGYI6q8Laf9k7POnVyHVfrTGogsURr
zhPnmyF+B0D8RnG61HRHjW8rp8E6PaZe6zwMpyji+e3b7oxYsNhnW74BmzLKNjxN
UISLyL/T19a+cVkLgLD6G4DVIKn+HkfkpRo6Z5DHB2pUC8Ze1jZ/+aqnuoZJllKB
UmMk1V694/XKTqwTjkT7zQAwzoVZExFK8PO3RTyXUC6z3kT3PvfGfFkkPuNTcX8u
e8PC+AEKmUhWOZotRulz13xwl7W1IcJt4+VtBBwSroRDGmI60OtT0eYsGU90occR
kKuKViRkl/spO+YnOk5Ql3EIJAtvVIWnjEe5w5tZpC+NbV4UquXyNNRycqC7250a
9Bq5yrYakWmiTQuSGwtpnrSxNTPI5whX2N3RLc2IE3P0oGbKkOIW8wBiFFqEmhw0
EQTjqpLJGdFocm7cs2afutt3OU9yMgbx3q7P9WeLALfNe8GmvDPFNNje/DKbVPhc
INp9eoSIe169orkeEQqb+aM0tTmzJnzzgv7FoduNmV2EtbX+4+3/eRGiQVNt8ZV4
aS1Y50+dOHE2/GaWYxtluG2P6A0GkiYdLtBgklsPkYS3aofJccdjNlG08TrmACq8
ze9UphpOEVNH2h22QOXDzJq7XNhXMaJ1jteLUegjygp3PrE5dE0=
=1iEO
-----END PGP SIGNATURE-----


Mathieu Othacehe wrote 1 years ago
Re: [bug#68287] [PATCH] gnu: cgit: Update to 793c420897e18eb3474c751d54cf4e0983f85433.
(name . Tomas Volf)(address . ~@wolfsden.cz)(address . 68287-done@debbugs.gnu.org)
87h6jprodj.fsf@gnu.org
Toggle quote (4 lines)
> * gnu/packages/version-control.scm (cgit): Update to
> 793c420897e18eb3474c751d54cf4e0983f85433.
> [inputs]: Update git to 2.43.0.

Applied, thanks,

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68287@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68287
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help