gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / version-control.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
7 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
8 ;;; Copyright © 2014, 2016, 2019, 2021 Eric Bavier <bavier@posteo.net>
9 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2015, 2018, 2020, 2021, 2022 Kyle Meyer <kyle@kyleam.com>
11 ;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
13 ;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is>
14 ;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <me@tobias.gr>
15 ;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
16 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
17 ;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
18 ;;; Copyright © 2017, 2018, 2020, 2022 Marius Bakke <marius@gnu.org>
19 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
20 ;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
21 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
22 ;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
23 ;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
24 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
25 ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
26 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
27 ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
28 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
29 ;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
30 ;;; Copyright © 2020 John D. Boy <jboy@bius.moe>
31 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
32 ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
33 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
34 ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
35 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
36 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
38 ;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
39 ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
40 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
41 ;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
42 ;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
43 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
44 ;;; Copyright © 2021 jgart <jgart@dismail.de>
45 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
46 ;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
47 ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
48 ;;; Copyright © 2022 Dhruvin Gandhi <contact@dhruvin.dev>
49 ;;; Copyright © 2015, 2022 David Thompson <davet@gnu.org>
50 ;;;
51 ;;; This file is part of GNU Guix.
52 ;;;
53 ;;; GNU Guix is free software; you can redistribute it and/or modify it
54 ;;; under the terms of the GNU General Public License as published by
55 ;;; the Free Software Foundation; either version 3 of the License, or (at
56 ;;; your option) any later version.
57 ;;;
58 ;;; GNU Guix is distributed in the hope that it will be useful, but
59 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
60 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61 ;;; GNU General Public License for more details.
62 ;;;
63 ;;; You should have received a copy of the GNU General Public License
64 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
65
66 (define-module (gnu packages version-control)
67 #:use-module ((guix licenses) #:prefix license:)
68 #:use-module (guix utils)
69 #:use-module (guix packages)
70 #:use-module (guix gexp)
71 #:use-module (guix download)
72 #:use-module (guix git-download)
73 #:use-module (guix hg-download)
74 #:use-module (guix build python-build-system)
75 #:use-module (guix build-system cmake)
76 #:use-module (guix build-system copy)
77 #:use-module (guix build-system gnu)
78 #:use-module (guix build-system go)
79 #:use-module (guix build-system perl)
80 #:use-module (guix build-system python)
81 #:use-module (guix build-system trivial)
82 #:use-module (gnu packages apr)
83 #:use-module (gnu packages autotools)
84 #:use-module (gnu packages documentation)
85 #:use-module (gnu packages base)
86 #:use-module (gnu packages bash)
87 #:use-module (gnu packages bison)
88 #:use-module (gnu packages boost)
89 #:use-module (gnu packages check)
90 #:use-module (gnu packages cook)
91 #:use-module (gnu packages curl)
92 #:use-module (gnu packages docbook)
93 #:use-module (gnu packages ed)
94 #:use-module (gnu packages file)
95 #:use-module (gnu packages flex)
96 #:use-module (gnu packages freedesktop)
97 #:use-module (gnu packages gettext)
98 #:use-module (gnu packages gl)
99 #:use-module (gnu packages glib)
100 #:use-module (gnu packages gnome)
101 #:use-module (gnu packages gnupg)
102 #:use-module (gnu packages golang)
103 #:use-module (gnu packages groff)
104 #:use-module (gnu packages guile)
105 #:use-module (gnu packages guile-xyz)
106 #:use-module (gnu packages image)
107 #:use-module (gnu packages linux)
108 #:use-module (gnu packages mail)
109 #:use-module (gnu packages man)
110 #:use-module (gnu packages maths)
111 #:use-module (gnu packages nano)
112 #:use-module (gnu packages ncurses)
113 #:use-module (gnu packages ssh)
114 #:use-module (gnu packages web)
115 #:use-module (gnu packages openstack)
116 #:use-module (gnu packages pcre)
117 #:use-module (gnu packages perl)
118 #:use-module (gnu packages perl-check)
119 #:use-module (gnu packages pkg-config)
120 #:use-module (gnu packages python)
121 #:use-module (gnu packages python-build)
122 #:use-module (gnu packages python-check)
123 #:use-module (gnu packages python-crypto)
124 #:use-module (gnu packages python-web)
125 #:use-module (gnu packages python-xyz)
126 #:use-module (gnu packages readline)
127 #:use-module (gnu packages rsync)
128 #:use-module (gnu packages sqlite)
129 #:use-module (gnu packages texinfo)
130 #:use-module (gnu packages admin)
131 #:use-module (gnu packages xml)
132 #:use-module (gnu packages emacs)
133 #:use-module (gnu packages compression)
134 #:use-module (gnu packages sdl)
135 #:use-module (gnu packages swig)
136 #:use-module (gnu packages sync)
137 #:use-module (gnu packages tcl)
138 #:use-module (gnu packages textutils)
139 #:use-module (gnu packages time)
140 #:use-module (gnu packages tls)
141 #:use-module (gnu packages)
142 #:use-module (ice-9 match)
143 #:use-module (srfi srfi-1)
144 #:export (make-gitolite))
145
146 (define-public breezy
147 (package
148 (name "breezy")
149 (version "3.2.2")
150 (source
151 (origin
152 (method url-fetch)
153 (uri (string-append "https://launchpad.net/brz/"
154 (version-major+minor version) "/" version
155 "/+download/breezy-" version ".tar.gz"))
156 (modules '((guix build utils)))
157 ;; Delete pre-generated Cython C files.
158 (snippet '(for-each delete-file (find-files "." "\\pyx.c$")))
159 (sha256
160 (base32
161 "1md4b6ajawf5h50fqizmjj0g833ihc674dh7fn0mvl4d412nwyhq"))
162 (patches (search-patches "breezy-fix-gio.patch"))))
163 (build-system python-build-system)
164 (arguments
165 (list
166 #:tests? #f ;FIXME: the test suite hangs
167 #:phases
168 #~(modify-phases %standard-phases
169 (add-after 'unpack 'patch-test-shebangs
170 (lambda _
171 (substitute* (append (find-files "breezy/bzr/tests")
172 (find-files "breezy/tests"))
173 (("#!/bin/sh")
174 (format #f "#!~a" (which "sh"))))))
175 (replace 'check
176 (lambda* (#:key tests? #:allow-other-keys)
177 (when tests?
178 ;; The test_read_bundle tests fails with "TypeError: a
179 ;; bytes-like object is required, not '_ResultTuple'" (see:
180 ;; https://bugs.launchpad.net/brz/+bug/1968415/comments/4).
181 (substitute* "breezy/bzr/tests/__init__.py"
182 (("'test_read_bundle'," all)
183 (string-append "# " all)))
184 (setenv "BZR_EDITOR" "nano")
185 (setenv "HOME" "/tmp")
186 (invoke "testr" "init")
187 (invoke "testr" "run")))))))
188 (native-inputs
189 (list nano ;for tests
190 python-cython
191 python-docutils
192 python-subunit
193 python-testrepository))
194 (inputs
195 (list gettext-minimal
196 python-configobj
197 python-dulwich
198 python-fastbencode
199 python-fastimport
200 python-launchpadlib
201 python-paramiko
202 python-patiencediff
203 python-pycryptodome
204 python-pygobject
205 python-pygpgme))
206 (home-page "https://www.breezy-vcs.org/")
207 (synopsis "Decentralized revision control system")
208 (description
209 "Breezy (@command{brz}) is a decentralized revision control system. By
210 default, Breezy provides support for both the
211 @uref{https://bazaar.canonical.com/, Bazaar} and @uref{https://www.git-scm.com,
212 Git} file formats. Breezy is backwabrds compatible with Bazaar's disk format
213 and protocols. One of the key differences with Bazaar is that Breezy runs on
214 Python 3.3 and later, rather than on Python 2.")
215 (license license:gpl2+)))
216
217 (define-public bazaar
218 (deprecated-package "bazaar" breezy))
219
220 (define git-cross-configure-flags
221 '("ac_cv_fread_reads_directories=yes"
222 "ac_cv_snprintf_returns_bogus=no"
223 "ac_cv_iconv_omits_bom=no"))
224
225 (define-public git
226 (package
227 (name "git")
228 (version "2.38.0")
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
232 version ".tar.xz"))
233 (sha256
234 (base32
235 "02ij201lyipv1w2zkcq4ng2bga2xkw58xnkbs1wdw50qdgiasglj"))))
236 (build-system gnu-build-system)
237 (native-inputs
238 `(("native-perl" ,perl)
239 ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
240 ;; see <https://bugs.gnu.org/39513>.
241 ("bash" ,bash-minimal)
242 ("bash-for-tests" ,bash)
243 ("gettext" ,gettext-minimal)
244 ;; To build the man pages from the git sources, we would need a dependency
245 ;; on a full XML tool chain, and building it actually takes ages. So we
246 ;; use this lazy approach and use released tarball.
247 ("git-manpages"
248 ,(origin
249 (method url-fetch)
250 (uri (string-append
251 "mirror://kernel.org/software/scm/git/git-manpages-"
252 version ".tar.xz"))
253 (sha256
254 (base32
255 "1qyn6rhwblshz0hp0kdc8lk22c1fv8avfr44sia0vzlbd82xj828"))))
256 ;; For subtree documentation.
257 ("asciidoc" ,asciidoc)
258 ("docbook-xsl" ,docbook-xsl)
259 ("xmlto" ,xmlto)
260 ("pkg-config" ,pkg-config)))
261 (inputs
262 `(("curl" ,curl)
263 ("expat" ,expat)
264 ("openssl" ,openssl)
265 ("perl" ,perl)
266 ("python" ,python) ; for git-p4
267 ("zlib" ,zlib)
268
269 ;; For PCRE support in git grep (USE_LIBPCRE2).
270 ("pcre" ,pcre2)
271
272 ;; For 'gitweb.cgi'.
273 ("perl-cgi" ,perl-cgi)
274
275 ;; For 'git-svn'.
276 ("subversion" ,subversion)
277 ("perl-term-readkey" ,perl-term-readkey)
278
279 ;; For 'git-send-email'.
280 ("perl-authen-sasl" ,perl-authen-sasl)
281 ("perl-net-smtp-ssl" ,perl-net-smtp-ssl)
282 ("perl-io-socket-ssl" ,perl-io-socket-ssl)
283
284 ;; For 'git gui', 'gitk', and 'git citool'.
285 ("tcl" ,tcl)
286 ("tk" ,tk)
287
288 ;; For 'git-credential-libsecret'
289 ("glib" ,glib)
290 ("libsecret" ,libsecret)))
291 (outputs '("out" ; the core
292 "send-email" ; for git-send-email
293 "svn" ; git-svn
294 "credential-netrc" ; git-credential-netrc
295 "credential-libsecret" ; git-credential-libsecret
296 "subtree" ; git-subtree
297 "gui")) ; gitk, git gui
298 (arguments
299 `(#:make-flags `("V=1" ;more verbose compilation
300
301 ,(string-append "SHELL_PATH="
302 (assoc-ref %build-inputs "bash")
303 "/bin/sh")
304
305 ;; Tests require a bash with completion support.
306 ,(string-append "TEST_SHELL_PATH="
307 (assoc-ref %build-inputs "bash-for-tests")
308 "/bin/bash")
309
310 "USE_LIBPCRE2=yes"
311
312 ;; By default 'make install' creates hard links for
313 ;; things in 'libexec/git-core', which leads to huge
314 ;; nars; see <https://bugs.gnu.org/21949>.
315 "NO_INSTALL_HARDLINKS=indeed")
316
317 ;; Make sure the full bash does not end up in the final closure.
318 #:disallowed-references (,bash)
319
320 #:test-target "test"
321
322 ;; The explicit --with-tcltk forces the build system to hardcode the
323 ;; absolute file name to 'wish'.
324 #:configure-flags (list (string-append "--with-tcltk="
325 (assoc-ref %build-inputs "tk")
326 "/bin/wish8.6") ; XXX
327 ,@(if (%current-target-system)
328 git-cross-configure-flags
329 '()))
330
331 #:modules ((srfi srfi-1)
332 (srfi srfi-26)
333 ((guix build gnu-build-system) #:prefix gnu:)
334 ,@%gnu-build-system-modules)
335 #:phases
336 (modify-phases %standard-phases
337 ,@(if (%current-target-system)
338 ;; The git build system assumes build == host
339 `((add-after 'unpack 'use-host-uname_S
340 (lambda _
341 (substitute* "config.mak.uname"
342 (("uname_S := .*" all)
343 (if (equal? ,(%current-target-system) "i586-pc-gnu")
344 "uname_S := GNU\n"
345 all)))
346 #t)))
347 ;; We do not have bash-for-tests when cross-compiling.
348 `((add-after 'unpack 'modify-PATH
349 (lambda* (#:key inputs #:allow-other-keys)
350 (let ((path (string-split (getenv "PATH") #\:))
351 (bash-full (assoc-ref inputs "bash-for-tests")))
352 ;; Drop the test bash from PATH so that (which "sh") and
353 ;; similar does the right thing.
354 (setenv "PATH" (string-join
355 (remove (cut string-prefix? bash-full <>) path)
356 ":"))
357 #t)))))
358 ;; Add cross curl-config script to PATH when cross-compiling.
359 ,@(if (%current-target-system)
360 '((add-before 'configure 'add-cross-curl-config
361 (lambda* (#:key inputs #:allow-other-keys)
362 (setenv "PATH"
363 (string-append (assoc-ref inputs "curl") "/bin:"
364 (getenv "PATH")))
365 #t)))
366 '())
367 (add-after 'configure 'patch-makefiles
368 (lambda _
369 (substitute* "Makefile"
370 (("/usr/bin/perl") (which "perl"))
371 (("/usr/bin/python") (which "python3")))
372 #t))
373 (add-after 'configure 'add-PM.stamp
374 (lambda _
375 ;; Add the "PM.stamp" to avoid "no rule to make target".
376 (call-with-output-file "perl/PM.stamp" (const #t))
377 #t))
378 (add-after 'build 'build-subtree
379 (lambda* (#:key inputs #:allow-other-keys)
380 (with-directory-excursion "contrib/subtree"
381 (substitute* "Makefile"
382 ;; Apparently `xmlto' does not bother to looks up the stylesheets
383 ;; specified in the XML, unlike the above substitution. Instead it
384 ;; uses a hard-coded URL. Work around it here, but if this is
385 ;; common perhaps we should hardcode this path in xmlto itself.
386 (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
387 (string-append "$(XMLTO) -x "
388 (string-append (assoc-ref inputs "docbook-xsl")
389 "/xml/xsl/docbook-xsl-"
390 ,(package-version docbook-xsl))
391 "/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
392 (invoke "make")
393 (invoke "make" "install")
394 (invoke "make" "install-doc")
395 (substitute* "git-subtree"
396 (("/bin/sh") (which "sh"))))
397 #t))
398 (add-before 'check 'patch-tests
399 (lambda _
400 (let ((store-directory (%store-directory)))
401 ;; These files contain some funny bytes that Guile is unable
402 ;; to decode for shebang patching. Just delete them.
403 (for-each delete-file '("t/t4201-shortlog.sh"
404 "t/t7813-grep-icase-iso.sh"))
405 ;; Many tests contain inline shell scripts (hooks etc).
406 (substitute* (find-files "t" "\\.sh$")
407 (("#!/bin/sh") (string-append "#!" (which "sh"))))
408 ;; Un-do shebang patching here to prevent checksum mismatch.
409 (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
410 (("^#!.*/bin/perl") "#!/usr/bin/perl"))
411 (substitute* "t/t5003-archive-zip.sh"
412 (("cp /bin/sh") (string-append "cp " (which "sh"))))
413 (substitute* "t/t6030-bisect-porcelain.sh"
414 (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
415 ;; FIXME: This test runs `git commit` with a bogus EDITOR
416 ;; and empty commit message, but does not fail the way it's
417 ;; expected to. The test passes when invoked interactively.
418 (substitute* "t/t7508-status.sh"
419 (("\tcommit_template_commented") "\ttrue"))
420 ;; More checksum mismatches due to odd shebangs.
421 (substitute* "t/t9100-git-svn-basic.sh"
422 (((string-append "\"#!" store-directory ".*/bin/sh")) "\"#!/bin/sh") )
423 (substitute* "t/t9300-fast-import.sh"
424 (((string-append "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh")
425 (((string-append "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh"))
426 ;; FIXME: Some hooks fail with "basename: command not found".
427 ;; See 't/trash directory.t9164.../svn-hook.log'.
428 (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
429
430 ;; XXX: These tests fail intermittently for unknown reasons:
431 ;; <https://bugs.gnu.org/29546>.
432 (for-each delete-file
433 '("t/t9128-git-svn-cmd-branch.sh"
434 "t/t9167-git-svn-cmd-branch-subproject.sh"
435 "t/t9141-git-svn-multiple-branches.sh"))
436 #t)))
437 (add-after 'install 'install-shell-completion
438 (lambda* (#:key outputs #:allow-other-keys)
439 (let* ((out (assoc-ref outputs "out"))
440 (completions (string-append out "/etc/bash_completion.d")))
441 ;; TODO: Install the tcsh and zsh completions in the right place.
442 (mkdir-p completions)
443 (copy-file "contrib/completion/git-completion.bash"
444 (string-append completions "/git"))
445 #t)))
446 (add-after 'install 'install-credential-netrc
447 (lambda* (#:key outputs #:allow-other-keys)
448 (let* ((netrc (assoc-ref outputs "credential-netrc")))
449 (install-file "contrib/credential/netrc/git-credential-netrc.perl"
450 (string-append netrc "/bin"))
451 (rename-file (string-append netrc "/bin/git-credential-netrc.perl")
452 (string-append netrc "/bin/git-credential-netrc"))
453 ;; Previously, Git.pm was automatically found by netrc.
454 ;; Perl 5.26 changed how it locates modules so that @INC no
455 ;; longer includes the current working directory (the Perl
456 ;; community calls this "dotless @INC").
457 (wrap-program (string-append netrc "/bin/git-credential-netrc")
458 `("PERL5LIB" ":" prefix
459 (,(string-append (assoc-ref outputs "out") "/share/perl5"))))
460 #t)))
461 (add-after 'install 'install-credential-libsecret
462 (lambda* (#:key outputs #:allow-other-keys)
463 (let* ((libsecret (assoc-ref outputs "credential-libsecret")))
464 (with-directory-excursion "contrib/credential/libsecret"
465 ((assoc-ref gnu:%standard-phases 'build))
466 (install-file "git-credential-libsecret"
467 (string-append libsecret "/bin"))
468 #t))))
469 (add-after 'install 'install-subtree
470 (lambda* (#:key outputs #:allow-other-keys)
471 (let ((subtree (assoc-ref outputs "subtree")))
472 (install-file "contrib/subtree/git-subtree"
473 (string-append subtree "/bin"))
474 (install-file "contrib/subtree/git-subtree.1"
475 (string-append subtree "/share/man/man1"))
476 #t)))
477 (add-after 'install 'restore-sample-hooks-shebang
478 (lambda* (#:key outputs #:allow-other-keys)
479 (let* ((out (assoc-ref outputs "out"))
480 (dir (string-append out "/share/git-core/templates/hooks")))
481 (for-each (lambda (file)
482 (format #t "restoring shebang on `~a'~%" file)
483 (substitute* file
484 (("^#!.*/bin/sh") "#!/bin/sh")))
485 (find-files dir ".*"))
486 #t)))
487 (add-after 'install 'split
488 (lambda* (#:key inputs outputs #:allow-other-keys)
489 ;; Split the binaries to the various outputs.
490 (let* ((out (assoc-ref outputs "out"))
491 (se (assoc-ref outputs "send-email"))
492 (svn (assoc-ref outputs "svn"))
493 (gui (assoc-ref outputs "gui"))
494 (gitk (string-append out "/bin/gitk"))
495 (gitk* (string-append gui "/bin/gitk"))
496 (git-gui (string-append out "/libexec/git-core/git-gui"))
497 (git-gui* (string-append gui "/libexec/git-core/git-gui"))
498 (git-cit (string-append out "/libexec/git-core/git-citool"))
499 (git-cit* (string-append gui "/libexec/git-core/git-citool"))
500 (git-se (string-append out "/libexec/git-core/git-send-email"))
501 (git-se* (string-append se "/libexec/git-core/git-send-email"))
502 (git-svn (string-append out "/libexec/git-core/git-svn"))
503 (git-svn* (string-append svn "/libexec/git-core/git-svn"))
504 (git-sm (string-append out
505 "/libexec/git-core/git-submodule")))
506 (mkdir-p (string-append gui "/bin"))
507 (mkdir-p (string-append gui "/libexec/git-core"))
508 (mkdir-p (string-append se "/libexec/git-core"))
509 (mkdir-p (string-append svn "/libexec/git-core"))
510
511 (for-each (lambda (old new)
512 (copy-file old new)
513 (delete-file old)
514 (chmod new #o555))
515 (list gitk git-gui git-cit git-se git-svn)
516 (list gitk* git-gui* git-cit* git-se* git-svn*))
517
518 ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
519 (wrap-program git-svn*
520 `("PATH" ":" prefix
521 (,(string-append (assoc-ref inputs "subversion")
522 "/bin")))
523 `("PERL5LIB" ":" prefix
524 ,(map (lambda (i) (string-append (assoc-ref inputs i)
525 "/lib/perl5/site_perl"))
526 '("subversion" "perl-term-readkey")))
527
528 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
529 ;; help it find 'libsvn_client-1.so'.
530 `("LD_LIBRARY_PATH" ":" prefix
531 (,(string-append (assoc-ref inputs "subversion")
532 "/lib"))))
533
534 ;; Tell 'git-send-email' where perl modules are.
535 (wrap-program git-se*
536 `("PERL5LIB" ":" prefix
537 ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
538 (list
539 ,@(transitive-input-references
540 'inputs
541 (map (lambda (l)
542 (assoc l (package-inputs this-package)))
543 '("perl-authen-sasl"
544 "perl-net-smtp-ssl"
545 "perl-io-socket-ssl")))))))
546
547 ;; Tell 'gitweb.cgi' where perl modules are.
548 (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
549 `("PERL5LIB" ":" prefix
550 ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
551 (list
552 ,@(transitive-input-references
553 'inputs
554 (map (lambda (l)
555 (assoc l (package-inputs this-package)))
556 '("perl-cgi")))))))
557
558 ;; Tell 'git-submodule' where Perl is.
559 (wrap-program git-sm
560 `("PATH" ":" prefix
561 (,(string-append (assoc-ref inputs "perl")
562 "/bin"))))
563
564 #t)))
565 (add-after 'split 'install-man-pages
566 (lambda* (#:key inputs outputs #:allow-other-keys)
567 (let* ((out (assoc-ref outputs "out"))
568 (man (string-append out "/share/man"))
569 (manpages (assoc-ref inputs "git-manpages")))
570 (mkdir-p man)
571 (with-directory-excursion man
572 (invoke "tar" "xvf" manpages))))))))
573
574 (native-search-paths
575 ;; For HTTPS access, Git needs a single-file certificate bundle, specified
576 ;; with $GIT_SSL_CAINFO.
577 (list (search-path-specification
578 (variable "GIT_SSL_CAINFO")
579 (file-type 'regular)
580 (separator #f) ;single entry
581 (files '("etc/ssl/certs/ca-certificates.crt")))
582 (search-path-specification
583 (variable "GIT_EXEC_PATH")
584 (separator #f) ;single entry
585 (files '("libexec/git-core")))))
586
587 (synopsis "Distributed version control system")
588 (description
589 "Git is a free distributed version control system designed to handle
590 everything from small to very large projects with speed and efficiency.")
591 ;; XXX: Ignore this CVE to work around a name clash with the unrelated
592 ;; "cpe:2.3:a:jenkins:git" package. The proper fix is for (guix cve) to
593 ;; account for "vendor names".
594 (properties '((lint-hidden-cve . ("CVE-2018-1000182"
595 "CVE-2018-1000110"
596 "CVE-2019-1003010"
597 "CVE-2020-2136"
598 "CVE-2021-21684"
599 "CVE-2022-30947"
600 "CVE-2022-30948"
601 "CVE-2022-30949"
602 "CVE-2022-36882"
603 "CVE-2022-36883"
604 "CVE-2022-36884"))))
605 (license license:gpl2)
606 (home-page "https://git-scm.com/")))
607
608 (define-public git-minimal
609 ;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
610 ;; Its test suite runs slightly faster and most importantly it doesn't
611 ;; depend on packages that are expensive to build such as Subversion.
612 (package
613 (inherit git)
614 (name "git-minimal")
615 (arguments
616 (substitute-keyword-arguments (package-arguments git)
617 ((#:phases phases)
618 `(modify-phases ,phases
619 (replace 'patch-makefiles
620 (lambda _
621 (substitute* "Makefile"
622 (("/usr/bin/perl") (which "perl")))
623 #t))
624 (delete 'build-subtree)
625 (delete 'split)
626 (delete 'install-man-pages)
627 (delete 'install-subtree)
628 (delete 'install-credential-netrc)
629 (delete 'install-credential-libsecret)
630 (add-after 'install 'remove-unusable-perl-commands
631 (lambda* (#:key outputs #:allow-other-keys)
632 (let* ((out (assoc-ref outputs "out"))
633 (bin (string-append out "/bin"))
634 (libexec (string-append out "/libexec")))
635 (for-each (lambda (file)
636 (delete-file (string-append libexec
637 "/git-core/" file)))
638 '("git-svn" "git-cvsimport" "git-archimport"
639 "git-cvsserver" "git-request-pull"
640 "git-add--interactive" "git-cvsexportcommit"
641 "git-instaweb" "git-send-email"))
642 (delete-file (string-append bin "/git-cvsserver"))
643
644 ;; These templates typically depend on Perl. Remove them.
645 (delete-file-recursively
646 (string-append out "/share/git-core/templates/hooks"))
647
648 ;; Gitweb depends on Perl as well.
649 (delete-file-recursively
650 (string-append out "/share/gitweb"))
651 #t)))))
652 ((#:make-flags flags)
653 `(delete "USE_LIBPCRE2=yes" ,flags))
654 ((#:configure-flags flags)
655 `(list
656 ,@(if (%current-target-system)
657 git-cross-configure-flags
658 '())))
659 ((#:disallowed-references lst '())
660 `(,perl ,@lst))))
661 (outputs '("out"))
662 (native-inputs
663 `(("bash" ,bash-minimal)
664 ("bash-for-tests" ,bash)
665 ("native-perl" ,perl)
666 ("gettext" ,gettext-minimal)))
667 (inputs
668 (list curl ;for HTTP(S) access
669 expat ;for 'git push' over HTTP(S)
670 openssl
671 perl
672 zlib))))
673
674 (define-public git-minimal/fixed
675 ;; Version that rarely changes, depended on by Graphene/GTK+.
676 (package/inherit git-minimal
677 (version "2.33.1")
678 (source (origin
679 (method url-fetch)
680 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
681 version ".tar.xz"))
682 (sha256
683 (base32
684 "0bqz401dyp8wnjj3k5ahrniwk4dalndysqazzwdvv25hqbkacm70"))))))
685
686 (define-public git2cl
687 (let ((commit "1d74d4c0d933fc69ed5cec838c73502584dead05"))
688 (package
689 (name "git2cl")
690 (version (string-append "20120919." (string-take commit 7)))
691 (source (origin
692 (method git-fetch)
693 (uri (git-reference
694 (url "https://git.savannah.nongnu.org/git/git2cl.git")
695 (commit commit)))
696 (file-name (git-file-name name version))
697 (sha256
698 (base32
699 "0wnnbm2sjvfj0qrksj89jlnl69miwl0vk3wrrvgvpclgys3na2g1"))))
700 (build-system copy-build-system)
701 (inputs
702 (list perl))
703 (arguments
704 `(#:install-plan '(("git2cl" "bin/git2cl"))))
705 (home-page "https://savannah.nongnu.org/projects/git2cl")
706 (synopsis "Convert Git logs to GNU ChangeLog format")
707 (description "@code{git2cl} is a command line tool for converting Git
708 logs to GNU ChangeLog format.")
709 (license license:gpl2+))))
710
711 (define-public gitless
712 (package
713 (name "gitless")
714 (version "0.8.8")
715 (source
716 (origin
717 ;; The PyPI package lacks a test suite. Build directly from git.
718 (method git-fetch)
719 (uri (git-reference
720 (url "https://github.com/gitless-vcs/gitless")
721 (commit (string-append "v" version))))
722 (sha256
723 (base32 "048kl27zjr68hgs70g3l98ci9765wxva6azzrhcdys7nsdd493n6"))
724 (file-name (git-file-name name version))))
725 (build-system python-build-system)
726 (arguments
727 `(#:phases
728 (modify-phases %standard-phases
729 (add-before 'build 'loosen-requirements
730 (lambda _
731 (substitute* "setup.py"
732 ;; Using Guix's python-pygit2 1.1.0 appears to work fine…
733 (("pygit2==") "pygit2>="))
734 #t))
735 (add-before 'check 'prepare-for-tests
736 (lambda _
737 ;; Find the 'gl' command.
738 (rename-file "gl.py" "gl")
739 (setenv "PATH" (string-append (getcwd) ":" (getenv "PATH")))
740
741 ;; The tests try to run git as if it were already set up.
742 (setenv "HOME" (getcwd))
743 (invoke "git" "config" "--global" "user.email" "git@example.com")
744 (invoke "git" "config" "--global" "user.name" "Guix")))
745 (replace 'wrap
746 (lambda* (#:key inputs outputs #:allow-other-keys)
747 (let ((out (assoc-ref outputs "out"))
748 (git (assoc-ref inputs "git")))
749 (wrap-program (string-append out "/bin/gl")
750 `("PATH" ":" prefix (,(string-append git "/bin")))
751 `("GUIX_PYTHONPATH" ":" =
752 (,(string-append out "/lib/python"
753 ,(version-major+minor
754 (package-version python))
755 "/site-packages:")
756 ,(getenv "GUIX_PYTHONPATH"))))
757 #t))))))
758 (native-inputs
759 `(("git-for-tests" ,git-minimal)))
760 (inputs
761 `(("git" ,git-minimal)
762 ("python-clint" ,python-clint)
763 ("python-pygit2" ,python-pygit2)
764 ("python-sh" ,python-sh)))
765 (home-page "https://gitless.com")
766 (synopsis "Simple version control system built on top of Git")
767 (description
768 "Gitless is a Git-compatible version control system that aims to be easy to
769 learn and use. It simplifies the common workflow by committing changes to
770 tracked files by default and saving any uncommitted changes as part of a branch.
771
772 The friendly @command{gl} command-line interface gives feedback and helps you
773 figure out what to do next.
774
775 Gitless is implemented on top of Git and its commits and repositories are
776 indistinguishable from Git's. You (or other contributors) can always fall back
777 on @command{git}, and use any regular Git hosting service.")
778 (license license:expat)))
779
780 (define-public git-cal
781 (package
782 (name "git-cal")
783 (version "0.9.1")
784 (source (origin
785 (method git-fetch)
786 (uri (git-reference
787 (url "https://github.com/k4rthik/git-cal")
788 (commit (string-append "v" version))))
789 (file-name (git-file-name name version))
790 (sha256
791 (base32
792 "08s9sif3qlk5n2dqpzq5yjczggnqlnxldljspjdqgpfydb2dqg3z"))))
793 (build-system perl-build-system)
794 (home-page "https://github.com/k4rthik/git-cal/")
795 (synopsis "GitHub like contributions calendar for terminal")
796 (description "@code{git-cal} is a script to view commits calendar similar
797 to GitHub contributions calendar.")
798 (license license:expat)))
799
800 (define-public libgit2
801 (package
802 (name "libgit2")
803 (version "1.4.3")
804 (source (origin
805 ;; Since v1.1.1, release artifacts are no longer offered (see:
806 ;; https://github.com/libgit2/libgit2/discussions/5932#discussioncomment-1682729).
807 (method git-fetch)
808 (uri (git-reference
809 (url "https://github.com/libgit2/libgit2")
810 (commit (string-append "v" version))))
811 (file-name (git-file-name name version))
812 (sha256
813 (base32
814 "02x1a4zrzpzjd0yxnsi8njh5hgihc1iy1v4r0fnl8m4ckcgp6x2s"))
815 (modules '((guix build utils)))
816 (snippet
817 '(begin
818 (delete-file-recursively "deps")
819
820 ;; The "refs:revparse::date" test is time-dependent: it
821 ;; assumes "HEAD@{10 years ago}" matches a specific commit.
822 ;; See <https://github.com/libgit2/libgit2/pull/6299>.
823 (substitute* "tests/refs/revparse.c"
824 (("test_object.*10 years ago.*" all)
825 (string-append "// " all "\n")))))))
826 (build-system cmake-build-system)
827 (outputs '("out" "debug"))
828 (arguments
829 `(#:configure-flags
830 (list "-DUSE_NTLMCLIENT=OFF" ;TODO: package this
831 "-DREGEX_BACKEND=pcre2"
832 "-DUSE_HTTP_PARSER=system"
833 "-DUSE_SSH=ON" ; cmake fails to find libssh if this is missing
834 ,@(if (%current-target-system)
835 `((string-append
836 "-DPKG_CONFIG_EXECUTABLE="
837 (search-input-file
838 %build-inputs
839 (string-append "/bin/" ,(%current-target-system)
840 "-pkg-config"))))
841 '()))
842 #:phases
843 (modify-phases %standard-phases
844 ;; Run checks more verbosely, unless we are cross-compiling.
845 (replace 'check
846 (lambda* (#:key (tests? #t) #:allow-other-keys)
847 (if tests?
848 (invoke "./libgit2_tests" "-v" "-Q")
849 ;; Tests may be disabled if cross-compiling.
850 (format #t "Test suite not run.~%")))))))
851 (inputs
852 (list libssh2 http-parser))
853 (native-inputs
854 (list pkg-config python))
855 (propagated-inputs
856 ;; These libraries are in 'Requires.private' in libgit2.pc.
857 (list openssl pcre2 zlib))
858 (home-page "https://libgit2.org/")
859 (synopsis "Library providing Git core methods")
860 (description
861 "Libgit2 is a portable, pure C implementation of the Git core methods
862 provided as a re-entrant linkable library with a solid API, allowing you to
863 write native speed custom Git applications in any language with bindings.")
864 ;; GPLv2 with linking exception
865 (license license:gpl2)))
866
867 (define-public libgit2-1.3
868 (package
869 (inherit libgit2)
870 (version "1.3.0")
871 (source (origin
872 (inherit (package-source libgit2))
873 (method git-fetch)
874 (uri (git-reference
875 (url "https://github.com/libgit2/libgit2")
876 (commit (string-append "v" version))))
877 (file-name (git-file-name "libgit2" version))
878 (sha256
879 (base32
880 "0vgpb2175a5dhqiy1iwywwppahgqhi340i8bsvafjpvkw284vazd"))))
881 (arguments
882 (substitute-keyword-arguments (package-arguments libgit2)
883 ((#:phases _ '%standard-phases)
884 `(modify-phases %standard-phases
885 ;; Run checks more verbosely, unless we are cross-compiling.
886 (replace 'check
887 (lambda* (#:key (tests? #t) #:allow-other-keys)
888 (if tests?
889 (invoke "./libgit2_clar" "-v" "-Q")
890 ;; Tests may be disabled if cross-compiling.
891 (format #t "Test suite not run.~%"))))))))))
892
893 (define-public libgit2-1.1
894 (package
895 (inherit libgit2-1.3)
896 (version "1.1.0")
897 (source (origin
898 (inherit (package-source libgit2-1.3))
899 (file-name #f) ;use the default name
900 (method url-fetch)
901 (uri (string-append "https://github.com/libgit2/libgit2/"
902 "releases/download/v" version
903 "/libgit2-" version ".tar.gz"))
904 (sha256
905 (base32
906 "1fjdglkh04qv3b4alg621pxa689i0wlf8m7nf2755zawjr2zhwxd"))
907 (patches (search-patches "libgit2-mtime-0.patch"))))))
908
909 (define-public git-crypt
910 (package
911 (name "git-crypt")
912 (version "0.7.0")
913 (source
914 (origin
915 (method git-fetch)
916 (uri (git-reference
917 (url "https://github.com/AGWA/git-crypt")
918 (commit version)))
919 (file-name (git-file-name name version))
920 (sha256
921 (base32 "0ymk2z0jfyhycia8hg6wbj2g06m163yzqzanfk172cxb13fa8c26"))))
922 (build-system gnu-build-system)
923 (inputs
924 (list git openssl))
925 (native-inputs
926 (list docbook-xsl libxslt))
927 (arguments
928 `(#:tests? #f ; No tests.
929 #:phases
930 (modify-phases %standard-phases
931 (delete 'configure)
932 (add-after 'unpack 'patch-makefile
933 (lambda* (#:key inputs #:allow-other-keys)
934 (substitute* "Makefile"
935 (("http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl")
936 (string-append (assoc-ref inputs "docbook-xsl")
937 "/xml/xsl/docbook-xsl-"
938 ,(package-version docbook-xsl)
939 "/manpages/docbook.xsl")))
940 #t))
941 (replace 'build
942 (lambda _
943 (invoke "make" "ENABLE_MAN=yes")))
944 (replace 'install
945 (lambda* (#:key outputs #:allow-other-keys)
946 (let ((out (assoc-ref outputs "out")))
947 (invoke "make" "install"
948 "ENABLE_MAN=yes"
949 (string-append "PREFIX=" out))))))))
950 (home-page "https://www.agwa.name/projects/git-crypt/")
951 (synopsis "Transparent encryption of files in a git repository")
952 (description "git-crypt enables transparent encryption and decryption of
953 files in a git repository. Files which you choose to protect are encrypted when
954 committed, and decrypted when checked out. git-crypt lets you freely share a
955 repository containing a mix of public and private content. git-crypt gracefully
956 degrades, so developers without the secret key can still clone and commit to a
957 repository with encrypted files. This lets you store your secret material (such
958 as keys or passwords) in the same repository as your code, without requiring you
959 to lock down your entire repository.")
960 (license license:gpl3+)))
961
962 (define-public git-remote-gcrypt
963 (package
964 (name "git-remote-gcrypt")
965 (version "1.5")
966 (source (origin
967 (method git-fetch)
968 (uri (git-reference
969 (url "https://git.spwhitton.name/git-remote-gcrypt")
970 (commit version)))
971 (file-name (git-file-name name version))
972 (sha256
973 (base32
974 "1m1wlbqpqyhh2z0ka3gjs5yabd32nnkzw5hak6czcqrhhkfsqbmv"))))
975 (build-system trivial-build-system)
976 (arguments
977 `(#:modules ((guix build utils))
978 #:builder (begin
979 (use-modules (guix build utils))
980 (let* ((source (assoc-ref %build-inputs "source"))
981 (output (assoc-ref %outputs "out"))
982 (bindir (string-append output "/bin")))
983 (install-file (string-append source "/git-remote-gcrypt")
984 bindir)))))
985 (home-page "https://spwhitton.name/tech/code/git-remote-gcrypt/")
986 (synopsis "Whole remote repository encryption")
987 (description "git-remote-gcrypt is a Git remote helper to push and pull from
988 repositories encrypted with GnuPG. It works with the standard Git transports,
989 including repository hosting services like GitLab.
990
991 Remote helper programs are invoked by Git to handle network transport. This
992 helper handles @code{gcrypt:} URLs that access a remote repository encrypted
993 with GPG, using our custom format.
994
995 Supported locations are local, @code{rsync://} and @code{sftp://}, where the
996 repository is stored as a set of files, or instead any Git URL where gcrypt
997 will store the same representation in a Git repository, bridged over arbitrary
998 Git transport.
999
1000 The aim is to provide confidential, authenticated Git storage and
1001 collaboration using typical untrusted file hosts or services.")
1002 (license license:gpl3+)))
1003
1004 (define-public cgit
1005 (package
1006 (name "cgit")
1007 ;; Update the ‘git-source’ input as well.
1008 (version "1.2.3")
1009 (source (origin
1010 (method url-fetch)
1011 (uri (string-append
1012 "https://git.zx2c4.com/cgit/snapshot/cgit-"
1013 version ".tar.xz"))
1014 (sha256
1015 (base32
1016 "193d990ym10qlslk0p8mjwp2j6rhqa7fq0y1iff65lvbyv914pss"))))
1017 (build-system gnu-build-system)
1018 (arguments
1019 '(#:tests? #f ; XXX: fail to build the in-source git.
1020 #:test-target "test"
1021 #:make-flags '("CC=gcc" "SHELL_PATH=sh")
1022 #:phases
1023 (modify-phases %standard-phases
1024 (add-after 'unpack 'unpack-git
1025 (lambda* (#:key inputs #:allow-other-keys)
1026 ;; Unpack the source of git into the 'git' directory.
1027 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
1028 (assoc-ref inputs "git-source"))))
1029 (add-after 'unpack 'patch-absolute-file-names
1030 (lambda* (#:key inputs #:allow-other-keys)
1031 (define (quoted-file-name input path)
1032 (string-append "\"" input path "\""))
1033 (substitute* "ui-snapshot.c"
1034 (("\"gzip\"")
1035 (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip"))
1036 (("\"bzip2\"")
1037 (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
1038 (("\"xz\"")
1039 (quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
1040
1041 (substitute* "filters/about-formatting.sh"
1042 (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out")
1043 "/lib/cgit/filters"))
1044 (("\\| tr") (string-append "| " (which "tr"))))
1045
1046 (substitute* "filters/html-converters/txt2html"
1047 (("sed") (which "sed")))
1048
1049 (substitute* "filters/html-converters/man2html"
1050 (("groff") (which "groff")))
1051
1052 (substitute* "filters/html-converters/rst2html"
1053 (("rst2html\\.py") (which "rst2html.py")))
1054
1055 #t))
1056 (delete 'configure) ; no configure script
1057 (add-after 'build 'build-man
1058 (lambda* (#:key make-flags #:allow-other-keys)
1059 (apply invoke "make" "doc-man" make-flags)))
1060 (replace 'install
1061 (lambda* (#:key make-flags outputs #:allow-other-keys)
1062 (let ((out (assoc-ref outputs "out")))
1063 (apply invoke
1064 "make" "install" "install-man"
1065 (string-append "prefix=" out)
1066 (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit")
1067 make-flags)
1068 ;; Move the platform-dependent 'cgit.cgi' into lib to get it
1069 ;; stripped.
1070 (rename-file (string-append out "/share/cgit/cgit.cgi")
1071 (string-append out "/lib/cgit/cgit.cgi"))
1072 #t)))
1073 (add-after 'install 'wrap-python-scripts
1074 (lambda* (#:key outputs #:allow-other-keys)
1075 (for-each
1076 (lambda (file)
1077 (wrap-program (string-append (assoc-ref outputs "out")
1078 "/lib/cgit/filters/" file)
1079 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))))
1080 '("syntax-highlighting.py"
1081 "html-converters/md2html"))
1082 #t)))))
1083 (native-inputs
1084 ;; For building manpage.
1085 (list asciidoc gzip bzip2 xz))
1086 (inputs
1087 `(;; Building cgit requires a Git source tree.
1088 ("git-source"
1089 ,(origin
1090 (method url-fetch)
1091 ;; cgit is tightly bound to git. Use GIT_VER from the Makefile,
1092 ;; which may not match the current (package-version git).
1093 (uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
1094 (sha256
1095 (base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
1096 ("openssl" ,openssl)
1097 ("groff" ,groff)
1098 ("python" ,python)
1099 ("python-docutils" ,python-docutils)
1100 ("python-markdown" ,python-markdown)
1101 ("python-pygments" ,python-pygments)
1102 ("zlib" ,zlib)))
1103 (home-page "https://git.zx2c4.com/cgit/")
1104 (synopsis "Web frontend for git repositories")
1105 (description
1106 "CGit is an attempt to create a fast web interface for the Git SCM, using
1107 a built-in cache to decrease server I/O pressure.")
1108 (license license:gpl2)))
1109
1110 (define-public python-git-multimail
1111 (package
1112 (name "python-git-multimail")
1113 (version "1.5.0.post1")
1114 (source
1115 (origin
1116 (method url-fetch)
1117 (uri (pypi-uri "git-multimail" version))
1118 (sha256
1119 (base32
1120 "1zkrbsa70anwpw86ysfwalrb7nsr064kygfiyikyq1pl9pcl969y"))))
1121 (build-system python-build-system)
1122 (arguments
1123 '(#:phases
1124 (modify-phases %standard-phases
1125 (add-after 'unpack 'patch
1126 (lambda* (#:key inputs #:allow-other-keys)
1127 (substitute* "git-multimail/git_multimail.py"
1128 (("GIT_EXECUTABLE = 'git'")
1129 (string-append "GIT_EXECUTABLE = '"
1130 (assoc-ref inputs "git") "/bin/git"
1131 "'"))
1132 (("/usr/sbin/sendmail")
1133 (search-input-file inputs
1134 "/sbin/sendmail"))))))))
1135 (inputs
1136 (list git sendmail))
1137 (home-page "https://github.com/git-multimail/git-multimail")
1138 (synopsis "Send notification emails for Git pushes")
1139 (description
1140 "This hook sends emails describing changes introduced by pushes to a Git
1141 repository. For each reference that was changed, it emits one ReferenceChange
1142 email summarizing how the reference was changed, followed by one Revision
1143 email for each new commit that was introduced by the reference change.
1144
1145 This script is designed to be used as a post-receive hook in a Git
1146 repository")
1147 (license license:gpl2)))
1148
1149 (define-public python-ghp-import
1150 (package
1151 (name "python-ghp-import")
1152 (version "2.0.2")
1153 (source
1154 (origin
1155 (method git-fetch)
1156 (uri (git-reference
1157 (url "https://github.com/davisp/ghp-import")
1158 (commit version)))
1159 (file-name (git-file-name name version))
1160 (sha256
1161 (base32 "0i4lxsgqri1y8sw4k44bkwbzmdmk4vpmdi882mw148j8gk4i7vvj"))))
1162 (build-system python-build-system)
1163 (arguments
1164 `(#:phases (modify-phases %standard-phases
1165 (add-after 'install 'install-documentation
1166 (lambda* (#:key outputs #:allow-other-keys)
1167 (let* ((out (assoc-ref outputs "out"))
1168 (doc (string-append out "/share/doc"))
1169 (licenses (string-append out "/share/licenses")))
1170 (install-file "README.md" doc)
1171 (install-file "LICENSE" licenses)))))))
1172 (propagated-inputs (list python-dateutil))
1173 (home-page "https://github.com/davisp/ghp-import")
1174 (synopsis "Copy directory to the gh-pages branch")
1175 (description "Script that copies a directory to the gh-pages branch (by
1176 default) of the repository.")
1177
1178 ;; See <https://bugs.gnu.org/27913>.
1179 (license (license:non-copyleft
1180 "https://raw.githubusercontent.com/davisp/ghp-import/master/LICENSE"
1181 "Tumbolia Public License"))))
1182
1183 (define-public python-gitdb
1184 (package
1185 (name "python-gitdb")
1186 (version "4.0.2")
1187 (source (origin
1188 (method url-fetch)
1189 (uri (pypi-uri "gitdb" version))
1190 (sha256
1191 (base32
1192 "0l113fphn6msjl3cl3kyf332b6lal7daxdd0nfma0x9ipfb013jr"))))
1193 (build-system python-build-system)
1194 (arguments
1195 `(#:phases (modify-phases %standard-phases
1196 (add-before 'check 'create-test-repository
1197 (lambda _
1198 (mkdir "/tmp/testrepo")
1199 ;; Some tests require a git repository, so create one.
1200 (with-directory-excursion "/tmp/testrepo"
1201 (do ((filecount 1 (1+ filecount)))
1202 ((> filecount 1000))
1203 (call-with-output-file (string-append
1204 "file" (number->string filecount))
1205 (lambda (port)
1206 (format port "~a" filecount))))
1207 (begin
1208 (invoke "git" "init")
1209 (invoke "git" "config" "user.name" "Total Git")
1210 (invoke "git" "config" "user.email" "git@localhost")
1211 (invoke "git" "add" "-A")
1212 (invoke "git" "commit" "-q" "-m" "dummy commit")))
1213
1214 ;; The repository checkout must be a "bare" clone.
1215 (invoke "git" "clone" "--bare" "/tmp/testrepo"
1216 "/tmp/testrepo.git")))
1217 (replace 'check
1218 (lambda _
1219 (setenv "GITDB_TEST_GIT_REPO_BASE" "/tmp/testrepo.git")
1220 ;; Skip tests that must be run from the gitdb repository.
1221 (setenv "TRAVIS" "1")
1222 (invoke "nosetests" "-v"))))))
1223 (propagated-inputs
1224 (list python-smmap))
1225 (native-inputs
1226 (list git python-nose))
1227 (home-page "https://github.com/gitpython-developers/gitdb")
1228 (synopsis "Python implementation of the Git object database")
1229 (description
1230 "GitDB allows you to access @dfn{bare} Git repositories for reading and
1231 writing. It aims at allowing full access to loose objects as well as packs
1232 with performance and scalability in mind. It operates exclusively on streams,
1233 allowing to handle large objects with a small memory footprint.")
1234 (license license:bsd-3)))
1235
1236 (define-public python-gitpython
1237 (package
1238 (name "python-gitpython")
1239 (version "3.1.24")
1240 (source (origin
1241 (method url-fetch)
1242 (uri (pypi-uri "GitPython" version))
1243 (sha256
1244 (base32
1245 "1rarp97cpjnhi106k2yhb7kygdyflmlgq0icxv3ggzl4wvszv0yz"))))
1246 (build-system python-build-system)
1247 (arguments
1248 `(#:tests? #f ;XXX: Tests can only be run within the GitPython repository.
1249 #:phases (modify-phases %standard-phases
1250 (add-after 'unpack 'embed-git-reference
1251 (lambda* (#:key inputs #:allow-other-keys)
1252 (substitute* "git/cmd.py"
1253 (("git_exec_name = \"git\"")
1254 (string-append "git_exec_name = \""
1255 (assoc-ref inputs "git")
1256 "/bin/git\""))))))))
1257 (inputs
1258 (list git))
1259 (propagated-inputs
1260 (list python-gitdb python-typing-extensions))
1261 (native-inputs
1262 (list python-ddt python-nose))
1263 (home-page "https://github.com/gitpython-developers/GitPython")
1264 (synopsis "Python library for interacting with Git repositories")
1265 (description
1266 "GitPython is a python library used to interact with Git repositories,
1267 high-level like git-porcelain, or low-level like git-plumbing.
1268
1269 It provides abstractions of Git objects for easy access of repository data,
1270 and additionally allows you to access the Git repository more directly using
1271 either a pure Python implementation, or the faster, but more resource intensive
1272 @command{git} command implementation.")
1273 (license license:bsd-3)))
1274
1275 (define-public shflags
1276 (package
1277 (name "shflags")
1278 (version "1.2.3")
1279 (source (origin
1280 (method git-fetch)
1281 (uri (git-reference
1282 (url "https://github.com/kward/shflags")
1283 (commit (string-append "v" version))))
1284 (file-name (git-file-name name version))
1285 (sha256
1286 (base32
1287 "1ydx0sb6vz9s2dgp5bd64y7fpzh9qvmlfjxrbmzac8saknijrlly"))))
1288 (build-system gnu-build-system)
1289 (arguments
1290 `(#:tests? #f ; no tests
1291 #:phases
1292 (modify-phases %standard-phases
1293 (delete 'configure) ; nothing to configure
1294 (delete 'build) ; nothing to build
1295 (replace 'install
1296 (lambda* (#:key outputs #:allow-other-keys)
1297 (let* ((out (assoc-ref outputs "out"))
1298 (src (string-append out "/src")))
1299 (install-file "shflags" src)
1300 #t))))))
1301 (home-page "https://github.com/kward/shflags")
1302 (synopsis "Command-line flags library for shell scripts")
1303 (description
1304 "Shell Flags (shFlags) is a library written to greatly simplify the
1305 handling of command-line flags in Bourne based Unix shell scripts (bash, dash,
1306 ksh, sh, zsh). Most shell scripts use getopt for flags processing, but the
1307 different versions of getopt on various OSes make writing portable shell
1308 scripts difficult. shFlags instead provides an API that doesn't change across
1309 shell and OS versions so the script writer can be confident that the script
1310 will work.")
1311 (license license:lgpl2.1)))
1312
1313 (define-public git-flow
1314 (package
1315 (name "git-flow")
1316 ;; This version has not be officially released yet, so we build it
1317 ;; directly from the git repository.
1318 (version "1.12.3")
1319 (source (origin
1320 (method git-fetch)
1321 (uri (git-reference
1322 (url "https://github.com/petervanderdoes/gitflow-avh/")
1323 (commit version)))
1324 (file-name (git-file-name name version))
1325 (sha256
1326 (base32
1327 "13q4mnrxr03wz2dkhzy73j384g299m4d545cnhxcaznvdwfany4h"))))
1328 (build-system gnu-build-system)
1329 (inputs (list shflags))
1330 (arguments
1331 '(#:tests? #f ; no tests
1332 #:make-flags (list (string-append "prefix="
1333 (assoc-ref %outputs "out")))
1334 #:phases
1335 (modify-phases %standard-phases
1336 (add-after 'unpack 'reset-shFlags-link
1337 (lambda* (#:key inputs #:allow-other-keys)
1338 ;; The link points to a file in the shFlags submodule.
1339 ;; Redirect it to point to our system shFlags.
1340 (let ((shflags (assoc-ref inputs "shflags")))
1341 (begin
1342 (delete-file "gitflow-shFlags")
1343 (symlink (string-append shflags "/src/shflags")
1344 "gitflow-shFlags")))))
1345 (delete 'configure)
1346 (delete 'build))))
1347 (home-page "https://nvie.com/posts/a-successful-git-branching-model/")
1348 (synopsis "Git extensions for Vincent Driessen's branching model")
1349 (description
1350 "Vincent Driessen's branching model is a git branching and release
1351 management strategy that helps developers keep track of features, hotfixes,
1352 and releases in bigger software projects. The git-flow library of git
1353 subcommands helps automate some parts of the flow to make working with it a
1354 lot easier.")
1355 (license license:bsd-2)))
1356
1357 (define-public stgit
1358 (package
1359 (name "stgit")
1360 (version "1.5")
1361 (source
1362 (origin
1363 (method git-fetch)
1364 (uri (git-reference
1365 (url "https://github.com/ctmarinas/stgit")
1366 (commit (string-append "v" version))))
1367 (file-name (git-file-name name version))
1368 (sha256
1369 (base32 "1igljjpdgl4na1a5hi0nmg36ph0hw6hw8hhq5436fgcl8yjimyz3"))))
1370 (build-system python-build-system)
1371 (native-inputs
1372 (list perl))
1373 (inputs
1374 (list git))
1375 (arguments
1376 `(#:phases
1377 (modify-phases %standard-phases
1378 (add-after 'unpack 'hard-code-version
1379 (lambda _
1380 ;; setup.py tries to cleverly extract the version number from the
1381 ;; git history, which the source checkout lacks. Hard-code one.
1382 (substitute* "setup.py"
1383 (("get_ver\\(\\)")
1384 (format #f "'~a'" ,version)))
1385 #t))
1386 (add-before 'check 'patch-tests
1387 (lambda _
1388 (substitute* (list "t/t1900-mail.sh"
1389 "t/t7504-commit-msg-hook.sh")
1390 (("/bin/sh")
1391 (which "bash")))
1392 #t))
1393 (replace 'check
1394 (lambda _
1395 (invoke "make"
1396 "PERL_PATH=perl"
1397 (string-append "SHELL_PATH=" (which "bash"))
1398 "test"))))))
1399 (home-page "https://stacked-git.github.io/")
1400 (synopsis "Stacked Git")
1401 (description
1402 "StGit is a command-line application that provides functionality similar
1403 to Quilt (i.e., pushing/popping patches to/from a stack), but using Git
1404 instead of @command{diff} and @command{patch}. StGit stores its patches in a
1405 Git repository as normal Git commits, and provides a number of commands to
1406 manipulate them in various ways.")
1407 (license license:gpl2)))
1408
1409 (define-public vcsh
1410 (package
1411 (name "vcsh")
1412 (version "1.20190621-4")
1413 (source
1414 (origin
1415 (method git-fetch)
1416 (uri (git-reference
1417 (url "https://github.com/RichiH/vcsh")
1418 (commit (string-append "v" version))))
1419 (file-name (git-file-name name version))
1420 (sha256
1421 (base32 "1gx5nbqyprgy6picns5hxky3lyzkqfq3xhm614f0wcdi58xrsdh0"))))
1422 (build-system gnu-build-system)
1423 (native-inputs
1424 (list which))
1425 (inputs
1426 (list git perl perl-test-harness perl-shell-command perl-test-most))
1427 (arguments
1428 '(#:phases
1429 (modify-phases %standard-phases
1430 (delete 'configure)
1431 (delete 'build)
1432 (add-after 'install 'install-bash-completion
1433 ;; As of 1.20190621, zsh completion is installed by default but bash
1434 ;; completion is not. Do so manually.
1435 (lambda* (#:key outputs #:allow-other-keys)
1436 (let* ((out (assoc-ref outputs "out"))
1437 (completions (string-append out "/etc/bash_completion.d")))
1438 (mkdir-p completions)
1439 (copy-file "_vcsh_bash" (string-append completions "/vcsh"))))))
1440 #:make-flags (list (string-append "PREFIX="
1441 (assoc-ref %outputs "out")))
1442 #:test-target "test"))
1443 (home-page "https://github.com/RichiH/vcsh")
1444 (synopsis "Version control system for @code{$HOME}")
1445 (description
1446 "vcsh version-controls configuration files in several Git repositories,
1447 all in one single directory. They all maintain their working trees without
1448 clobbering each other or interfering otherwise. By default, all Git
1449 repositories maintained via vcsh store the actual files in @code{$HOME},
1450 though this can be overridden.")
1451 (license license:gpl2+)))
1452
1453 (define-public git-test-sequence
1454 (let ((commit "48e5a2f5a13a5f30452647237e23362b459b9c76"))
1455 (package
1456 (name "git-test-sequence")
1457 (version (string-append "20140312." (string-take commit 7)))
1458 (source (origin
1459 (method git-fetch)
1460 (uri (git-reference
1461 ;; There are many other scripts in this directory; we
1462 ;; are interested in just one for this package.
1463 (url "https://github.com/dustin/bindir")
1464 (commit commit)))
1465 (file-name (git-file-name name version))
1466 (sha256
1467 (base32
1468 "1dcq0y16yznbv4k9h8gg90kv1gkn8r8dbvl4m2rpfd7q5nqhn617"))))
1469 (build-system trivial-build-system)
1470 (arguments
1471 `(#:modules ((guix build utils))
1472 #:builder (begin
1473 (use-modules (guix build utils))
1474 (let* ((source (assoc-ref %build-inputs "source"))
1475 (output (assoc-ref %outputs "out"))
1476 (bindir (string-append output "/bin"))
1477 (script "git-test-sequence"))
1478 (install-file (string-append source "/" script)
1479 bindir)
1480 #t))))
1481 (home-page "https://dustin.sallings.org/2010/03/28/git-test-sequence.html")
1482 (synopsis "Run a command over a sequence of commits")
1483 (description
1484 "git-test-sequence is similar to an automated git bisect except it’s
1485 linear. It will test every change between two points in the DAG. It will
1486 also walk each side of a merge and test those changes individually.")
1487 (license (license:x11-style "file://LICENSE")))))
1488
1489 (define* (make-gitolite #:optional (extra-inputs '()))
1490 "Make a gitolite package object with EXTRA-INPUTS added to the binary
1491 wrappers, to be used for optional gitolite extensions."
1492 (package
1493 (name "gitolite")
1494 (version "3.6.12")
1495 (source
1496 (origin
1497 (method git-fetch)
1498 (uri (git-reference
1499 (url "https://github.com/sitaramc/gitolite")
1500 (commit (string-append "v" version))))
1501 (file-name (git-file-name name version))
1502 (sha256
1503 (base32 "05xw1pmagvkrbzga5pgl3xk9qyc6b5x73f842454f3w9ijspa8zy"))))
1504 (build-system gnu-build-system)
1505 (arguments
1506 (list #:tests? #f ; no tests
1507 #:phases
1508 #~(modify-phases %standard-phases
1509 (delete 'configure)
1510 (delete 'build)
1511 (add-before 'install 'patch-scripts
1512 (lambda* _
1513 ;; This seems to take care of every shell script that
1514 ;; invokes Perl.
1515 (substitute* (find-files ".")
1516 ((" perl -")
1517 (string-append " " #$perl "/bin/perl" " -")))
1518
1519 (substitute* (find-files "src/triggers" ".*")
1520 ((" sed ")
1521 (string-append " " #$sed "/bin/sed" " ")))
1522
1523 (substitute*
1524 '("src/triggers/post-compile/update-gitweb-access-list"
1525 "src/triggers/post-compile/ssh-authkeys-split"
1526 "src/triggers/upstream")
1527 ((" grep ")
1528 (string-append " " #$grep "/bin/grep" " ")))
1529
1530 ;; Avoid references to the store in authorized_keys.
1531 ;; This works because gitolite-shell is in the PATH.
1532 (substitute* "src/triggers/post-compile/ssh-authkeys"
1533 (("\\$glshell \\$user")
1534 "gitolite-shell $user"))))
1535 (add-before 'install 'patch-source
1536 (lambda* _
1537 ;; Gitolite uses cat to test the readability of the
1538 ;; pubkey
1539 (substitute* "src/lib/Gitolite/Setup.pm"
1540 (("\"cat ")
1541 (string-append "\"" #$coreutils "/bin/cat" " "))
1542 (("\"ssh-keygen")
1543 (string-append "\"" #$openssh "/bin/ssh-keygen")))
1544
1545 (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
1546 "src/lib/Gitolite/Hooks/Update.pm")
1547 (("/usr/bin/perl")
1548 (string-append #$perl "/bin/perl")))
1549
1550 (substitute* "src/lib/Gitolite/Common.pm"
1551 (("\"ssh-keygen")
1552 (string-append "\"" #$openssh "/bin/ssh-keygen"))
1553 (("\"logger\"")
1554 (string-append "\"" #$inetutils "/bin/logger\"")))
1555
1556 (substitute* "src/lib/Gitolite/Cache.pm"
1557 (("/usr/sbin/redis-server") "redis-server"))
1558
1559 (substitute* "src/commands/svnserve"
1560 (("/usr/bin/svnserve") "svnserve"))))
1561 (replace 'install
1562 (lambda* _
1563 (let* ((sharedir (string-append #$output "/share/gitolite"))
1564 (bindir (string-append #$output "/bin")))
1565 (mkdir-p sharedir)
1566 (mkdir-p bindir)
1567 (invoke "./install" "-to" sharedir)
1568 ;; Create symlinks for executable scripts in /bin.
1569 (for-each (lambda (script)
1570 (symlink (string-append sharedir "/" script)
1571 (string-append bindir "/" script)))
1572 '("gitolite" "gitolite-shell")))))
1573 (add-after 'install 'wrap-scripts
1574 (lambda* _
1575 (for-each (lambda (file-name)
1576 (wrap-program (string-append #$output file-name)
1577 `("PATH" ":" prefix
1578 ,(map (lambda (dir)
1579 (string-append dir "/bin"))
1580 (list #$output
1581 #$coreutils
1582 #$findutils
1583 #$git
1584 #$@extra-inputs)))))
1585 '("/bin/gitolite" "/bin/gitolite-shell")))))))
1586 (inputs
1587 (append (list bash-minimal coreutils findutils git inetutils openssh perl)
1588 extra-inputs))
1589 (home-page "https://gitolite.com")
1590 (synopsis "Git access control layer")
1591 (description
1592 "Gitolite is an access control layer on top of Git, providing fine access
1593 control to Git repositories.")
1594 (license license:gpl2)))
1595
1596 (define-public gitolite (make-gitolite))
1597
1598 (define-public gitile
1599 (package
1600 (name "gitile")
1601 (version "0.1.4")
1602 (source
1603 (origin
1604 (method git-fetch)
1605 (uri (git-reference
1606 (url "https://git.lepiller.eu/git/gitile")
1607 (commit version)))
1608 (file-name (git-file-name name version))
1609 (sha256
1610 (base32 "1wb1rajcrzdqjncv40s7hjsnvlh1gq4z9pn9gf210g1iy35vimmz"))))
1611 (build-system gnu-build-system)
1612 (arguments
1613 `(#:imported-modules ((guix build guile-build-system)
1614 ,@%gnu-build-system-modules)
1615 #:make-flags (list "GUILE_AUTO_COMPILE=0")
1616 #:phases
1617 (modify-phases %standard-phases
1618 (add-after 'install-bin 'wrap-program
1619 (lambda* (#:key inputs outputs #:allow-other-keys)
1620 (use-modules (guix build guile-build-system))
1621 ;; Wrap the 'gitile' command to refer to the right modules.
1622 (let* ((out (assoc-ref outputs "out"))
1623 (commonmark (assoc-ref inputs "guile-commonmark"))
1624 (git (assoc-ref inputs "guile-git"))
1625 (bytes (assoc-ref inputs "guile-bytestructures"))
1626 (fibers (assoc-ref inputs "guile-fibers"))
1627 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1628 (syntax-highlight (assoc-ref inputs "guile-syntax-highlight"))
1629 (deps (list out commonmark git bytes fibers gcrypt
1630 syntax-highlight))
1631 (guile (assoc-ref inputs "guile"))
1632 (effective (target-guile-effective-version))
1633 (mods (string-drop-right ;drop trailing colon
1634 (string-join deps
1635 (string-append "/share/guile/site/"
1636 effective ":")
1637 'suffix)
1638 1))
1639 (objs (string-drop-right
1640 (string-join deps
1641 (string-append "/lib/guile/" effective
1642 "/site-ccache:")
1643 'suffix)
1644 1)))
1645 (wrap-program (string-append out "/bin/gitile")
1646 `("GUILE_LOAD_PATH" ":" prefix (,mods))
1647 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))))))))
1648 (native-inputs
1649 (list autoconf automake guile-3.0 pkg-config))
1650 (inputs
1651 (list guile-3.0
1652 guile-commonmark
1653 guile-fibers
1654 guile-gcrypt
1655 guile-git
1656 guile-syntax-highlight-for-gitile
1657 gnutls))
1658 (home-page "https://git.lepiller.eu/gitile")
1659 (synopsis "Simple Git forge written in Guile")
1660 (description "Gitile is a Git forge written in Guile that lets you
1661 visualize your public Git repositories on a web interface.")
1662 (license license:agpl3+)))
1663
1664 (define-public pre-commit
1665 (package
1666 (name "pre-commit")
1667 (version "2.20.0")
1668 (source
1669 (origin
1670 (method git-fetch) ; no tests in PyPI release
1671 (uri (git-reference
1672 (url "https://github.com/pre-commit/pre-commit")
1673 (commit (string-append "v" version))))
1674 (file-name (git-file-name name version))
1675 (sha256
1676 (base32 "19jcg6nfnscp87h4wmbpw6r3lc8c75zkvb6wqgavq5dh7wkyg6pq"))))
1677 (build-system python-build-system)
1678 (arguments
1679 `(#:phases
1680 (modify-phases %standard-phases
1681 (add-before 'check 'prepare-check-env
1682 (lambda _
1683 ;; Change from /homeless-shelter to /tmp for write permission.
1684 (setenv "HOME" "/tmp")
1685 ;; Environment variables used in the tests.
1686 (setenv "GIT_AUTHOR_NAME" "Your Name")
1687 (setenv "GIT_COMMITTER_NAME" "Your Name")
1688 (setenv "GIT_AUTHOR_EMAIL" "you@example.com")
1689 (setenv "GIT_COMMITTER_EMAIL" "you@example.com")
1690 ;; Some tests still fail with PermissionError. Make the source
1691 ;; tree writable.
1692 (for-each make-file-writable (find-files "."))
1693 ;; Some tests will need a working git repository.
1694 (invoke "git" "init")
1695 (invoke "git" "config" "--global" "user.name" "Your Name")
1696 (invoke "git" "config" "--global" "user.email" "you@example.com")))
1697 (replace 'check
1698 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1699 (add-installed-pythonpath inputs outputs)
1700 (when tests?
1701 ;; The file below contains 30+ tests that fail because they
1702 ;; depend on tools from multiple languages (cargo, npm, cpan,
1703 ;; Rscript, etc). Other tests are passing, but it's more
1704 ;; convenient to skip the file than list 30 tests to skip.
1705 (invoke "pytest" "--ignore=tests/repository_test.py"
1706 ;; Ruby and Node tests require node and gem.
1707 "--ignore=tests/languages/node_test.py"
1708 "--ignore=tests/languages/ruby_test.py"
1709 "-k"
1710 (string-append
1711 ;; TODO: these tests fail with AssertionError. It may
1712 ;; be possible to fix them.
1713 "not test_install_existing_hooks_no_overwrite"
1714 " and not test_uninstall_restores_legacy_hooks"
1715 " and not test_installed_from_venv"
1716 " and not test_healthy_venv_creator"))))))))
1717 (native-inputs
1718 `(("git" ,git-minimal)
1719 ("python-covdefaults" ,python-covdefaults)
1720 ("python-coverage" ,python-coverage)
1721 ("python-distlib" ,python-distlib)
1722 ("python-pytest" ,python-pytest)
1723 ("python-pytest-env" ,python-pytest-env)
1724 ("python-re-assert" ,python-re-assert)
1725 ("which" ,which)))
1726 ;; Propagate because pre-commit is also used as a module.
1727 (propagated-inputs
1728 (list python-cfgv
1729 python-identify
1730 python-nodeenv
1731 python-pyyaml
1732 python-toml
1733 python-virtualenv))
1734 (home-page "https://pre-commit.com/")
1735 (synopsis "Framework for managing and maintaining pre-commit hooks")
1736 (description
1737 "Pre-commit is a multi-language package manager for pre-commit hooks. You
1738 specify a list of hooks you want and pre-commit manages the installation and
1739 execution of any hook written in any language before every commit.")
1740 (license license:expat)))
1741
1742 (define-public mercurial
1743 (package
1744 (name "mercurial")
1745 (version "6.2.2")
1746 (source (origin
1747 (method url-fetch)
1748 (uri (string-append "https://www.mercurial-scm.org/"
1749 "release/mercurial-" version ".tar.gz"))
1750 (patches (search-patches "mercurial-hg-extension-path.patch"
1751 "mercurial-openssl-compat.patch"))
1752 (sha256
1753 (base32
1754 "1pr00hdk3l9095fhq6302fgj0wmbqhqs93y4r457ba4pyjjrvyly"))
1755 (modules '((guix build utils)))
1756 (snippet
1757 '(substitute* (find-files "tests" "\\.(t|sh)$")
1758 ;; grep 3.8 emits deprecation warnings for 'egrep' and
1759 ;; 'fgrep' which breaks expected test output.
1760 (("egrep") "grep -E")
1761 (("fgrep") "grep -F")))))
1762 (build-system gnu-build-system)
1763 (arguments
1764 `(#:make-flags
1765 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1766 #:phases
1767 (modify-phases %standard-phases
1768 (delete 'configure)
1769 (add-after 'unpack 'patch-tests
1770 (lambda _
1771 (substitute* (find-files "tests" "\\.(t|py)$")
1772 (("/bin/sh")
1773 (which "sh"))
1774 (("/usr/bin/env")
1775 (which "env")))))
1776 (replace 'check
1777 (lambda* (#:key tests? #:allow-other-keys)
1778 (with-directory-excursion "tests"
1779 ;; The following tests are known to fail.
1780 (for-each delete-file
1781 '(;; XXX: This test calls 'run-tests.py --with-hg=
1782 ;; `which hg`' and fails because there is no hg on
1783 ;; PATH from before (that's why we are building it!)?
1784 "test-hghave.t"
1785
1786 ;; This test creates a shebang spanning multiple
1787 ;; lines which is difficult to substitute. It
1788 ;; only tests the test runner itself, which gets
1789 ;; thoroughly tested during the check phase anyway.
1790 "test-run-tests.t"
1791
1792 ;; These tests fail because the program is not
1793 ;; connected to a TTY in the build container.
1794 "test-nointerrupt.t"
1795 "test-transaction-rollback-on-sigpipe.t"
1796
1797 ;; FIXME: This gets killed but does not receive an interrupt.
1798 "test-commandserver.t"
1799
1800 ;; These tests get unexpected warnings about using
1801 ;; deprecated functionality in Python, but otherwise
1802 ;; succeed; try enabling for later Mercurial versions.
1803 "test-demandimport.py"
1804 "test-patchbomb-tls.t"
1805 ;; Similarly, this gets a more informative error
1806 ;; message from Python 3.10 than it expects.
1807 "test-http-bad-server.t"
1808
1809 ;; Only works when run in a hg-repo, not in an
1810 ;; extracted tarball
1811 "test-doctest.py"
1812
1813 ;; TODO: the fqaddr() call fails in the build
1814 ;; container, causing these server tests to fail.
1815 "test-hgwebdir.t"
1816 "test-http-branchmap.t"
1817 "test-pull-bundle.t"
1818 "test-push-http.t"
1819 "test-serve.t"
1820 "test-subrepo-deep-nested-change.t"
1821 "test-subrepo-recursion.t"))
1822 (when tests?
1823 (invoke "./run-tests.py"
1824 ;; ‘make check’ does not respect ‘-j’.
1825 (string-append "-j" (number->string
1826 (parallel-job-count)))
1827 ;; The default time-outs are too low for many systems.
1828 ;; Raise them generously: Guix enforces its own.
1829 "--timeout" "86400"
1830 "--slowtimeout" "86400"
1831 ;; The test suite takes a long time and produces little
1832 ;; output by default. Prevent timeouts due to silence.
1833 "-v"))))))))
1834 (native-inputs
1835 (list python-docutils
1836 ;; The following inputs are only needed to run the tests.
1837 python-nose unzip which))
1838 (inputs
1839 (list python-wrapper))
1840 ;; Find third-party extensions.
1841 (native-search-paths
1842 (list (search-path-specification
1843 (variable "HGEXTENSIONPATH")
1844 (files '("lib/python3.9/site-packages/hgext3rd")))))
1845 (home-page "https://www.mercurial-scm.org/")
1846 (synopsis "Decentralized version control system")
1847 (description
1848 "Mercurial is a free, distributed source control management tool. It
1849 efficiently handles projects of any size and offers an easy and intuitive
1850 interface.")
1851 (license license:gpl2+)))
1852
1853 (define-public python-hg-evolve
1854 (package
1855 (name "python-hg-evolve")
1856 (version "10.3.2")
1857 (source
1858 (origin
1859 (method hg-fetch)
1860 (uri (hg-reference
1861 (url "https://www.mercurial-scm.org/repo/evolve")
1862 (changeset version)))
1863 (file-name (hg-file-name name version))
1864 (sha256
1865 (base32
1866 "0qgk39s5pwxbshfa6x1f1ccxahja3fs265dddxy6q99spy3b3x5h"))))
1867 (build-system python-build-system)
1868 (arguments
1869 ;; Tests need mercurial source code.
1870 '(#:tests? #f))
1871 (propagated-inputs
1872 (list mercurial))
1873 (home-page "https://www.mercurial-scm.org/doc/evolution/")
1874 (synopsis "Flexible evolution of Mercurial history")
1875 (description "Evolve is a Mercurial extension for faster and safer mutable
1876 history. It implements the changeset evolution concept for Mercurial.")
1877 (license license:gpl2)))
1878
1879 (define-public hg-commitsigs
1880 ;; Latest tag is 11 years old.
1881 (let ((changeset "b53eb6862bff")
1882 (revision "0"))
1883 (package
1884 (name "hg-commitsigs")
1885 (version (git-version "0.1.0" revision changeset))
1886 (source (origin
1887 (method hg-fetch)
1888 (uri (hg-reference
1889 (url "https://foss.heptapod.net/mercurial/commitsigs")
1890 (changeset changeset)))
1891 (file-name (git-file-name name version))
1892 (sha256
1893 (base32
1894 "059gm66q06m6ayl4brsc517zkw3ahmz249b6xm1m32ac5y24wb9x"))))
1895 (build-system copy-build-system)
1896 (arguments
1897 `(#:imported-modules ((guix build python-build-system)
1898 ,@%copy-build-system-modules)
1899 #:modules ((srfi srfi-1)
1900 (guix build python-build-system)
1901 ;; Don't use `%copy-build-system-modules' because
1902 ;; `standard-phases' from (guix build gnu-build-system)
1903 ;; shadows the one from (guix build copy-build-system),
1904 ;; which is the one we actually want.
1905 (guix build copy-build-system)
1906 ((guix build gnu-build-system) #:prefix gnu)
1907 (guix build utils)
1908 (guix build gremlin)
1909 (ice-9 ftw)
1910 (guix elf))
1911 #:phases
1912 (modify-phases %standard-phases
1913 (add-after 'unpack 'patch-paths
1914 (lambda* (#:key inputs #:allow-other-keys)
1915 (let ((gpg (search-input-file inputs "/bin/gpg"))
1916 (openssl (search-input-file inputs "/bin/openssl")))
1917 (substitute* "commitsigs.py"
1918 (("b'gpg',") (string-append "b'" gpg "',"))
1919 (("b'openssl',") (string-append "b'" openssl "',")))))))
1920 #:install-plan
1921 `(("commitsigs.py" ,(string-append "lib/python"
1922 (python-version
1923 (assoc-ref %build-inputs "python"))
1924 "/site-packages/hgext3rd/commitsigs.py")))))
1925 (native-inputs
1926 (list python))
1927 (inputs
1928 (list gnupg openssl))
1929 (home-page "https://foss.heptapod.net/mercurial/commitsigs")
1930 (synopsis "Automatic signing of changeset hashes")
1931 (description "This package provides a Mercurial extension for signing
1932 the changeset hash of commits. The signure is embedded directly in the
1933 changeset itself; there won't be any extra commits. Either GnuPG or OpenSSL
1934 can be used for signing.")
1935 (license license:gpl2)))) ;per commitsigs.py
1936
1937 (define-public neon
1938 (package
1939 (name "neon")
1940 (version "0.32.2")
1941 (source (origin
1942 (method url-fetch)
1943 (uri (string-append "https://notroj.github.io/neon/neon-"
1944 version ".tar.gz"))
1945 (sha256
1946 (base32
1947 "11mj5zpp317dmds874wfwcpgij9i3scaahdi1xfzr5b2ii36crcq"))))
1948 (build-system gnu-build-system)
1949 (native-inputs
1950 (list perl pkg-config))
1951 (inputs
1952 (list libxml2 openssl zlib))
1953 (arguments
1954 `(;; FIXME: Add tests once reverse address lookup is fixed in glibc, see
1955 ;; https://sourceware.org/bugzilla/show_bug.cgi?id=16475
1956 #:tests? #f
1957 #:configure-flags '("--enable-shared"
1958 "--disable-static"
1959 ;; requires libgnutils-config, deprecated
1960 ;; in gnutls 2.8.
1961 ; "--with-ssl=gnutls")))
1962 "--with-ssl=openssl")))
1963 (home-page "https://notroj.github.io/neon/")
1964 (synopsis "HTTP and WebDAV client library")
1965 (description
1966 "Neon is an HTTP and WebDAV client library, with a C interface and the
1967 following features:
1968 @enumerate
1969 @item High-level wrappers for common HTTP and WebDAV operations (GET, MOVE,
1970 DELETE, etc.);
1971 @item low-level interface to the HTTP request/response engine, allowing the use
1972 of arbitrary HTTP methods, headers, etc.;
1973 @item authentication support including Basic and Digest support, along with
1974 GSSAPI-based Negotiate on Unix, and SSPI-based Negotiate/NTLM on Win32;
1975 @item SSL/TLS support using OpenSSL or GnuTLS, exposing an abstraction layer for
1976 verifying server certificates, handling client certificates, and examining
1977 certificate properties, smartcard-based client certificates are also
1978 supported via a PKCS#11 wrapper interface;
1979 @item abstract interface to parsing XML using libxml2 or expat, and wrappers for
1980 simplifying handling XML HTTP response bodies;
1981 @item WebDAV metadata support, wrappers for PROPFIND and PROPPATCH to simplify
1982 property manipulation.
1983 @end enumerate\n")
1984 (license license:gpl2+))) ; for documentation and tests; source under lgpl2.0+
1985
1986 (define-public subversion
1987 (package
1988 (name "subversion")
1989 (version "1.14.1")
1990 (source (origin
1991 (method url-fetch)
1992 (uri (string-append "mirror://apache/subversion/"
1993 "subversion-" version ".tar.bz2"))
1994 (sha256
1995 (base32
1996 "1ag1hvcm9q92kgalzbbgcsq9clxnzmbj9nciz9lmabjx4lyajp9c"))))
1997 (build-system gnu-build-system)
1998 (arguments
1999 '(#:parallel-tests? #f ; TODO Seems to cause test failures on
2000 ; i686-linux
2001 #:configure-flags '("--enable-static=no")
2002 #:phases
2003 (modify-phases %standard-phases
2004 (add-after 'configure 'patch-libtool-wrapper-ls
2005 (lambda* (#:key inputs #:allow-other-keys)
2006 ;; This substitution allows tests svnauthz_tests and svnlook_tests
2007 ;; to pass. These tests execute svnauthz and svnlook through
2008 ;; their libtool wrapper scripts from svn hooks, whose empty
2009 ;; environments cause "ls: command not found" errors. It would be
2010 ;; nice if this fix ultimately made its way into libtool.
2011 (let ((coreutils (assoc-ref inputs "coreutils")))
2012 (substitute* "libtool"
2013 (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls")))
2014 #t)))
2015 (add-before 'build 'patch-test-sh
2016 (lambda _
2017 (substitute* "subversion/tests/libsvn_repos/repos-test.c"
2018 (("#!/bin/sh") (string-append "#!" (which "sh"))))
2019 #t))
2020 (add-before 'check 'set-PARALLEL
2021 (lambda* (#:key parallel-tests? #:allow-other-keys)
2022 (if parallel-tests?
2023 (setenv "PARALLEL" (number->string (parallel-job-count)))
2024 (simple-format #t "parallel-tests? are disabled\n"))
2025 #t))
2026 (add-after 'install 'install-perl-bindings
2027 (lambda* (#:key outputs #:allow-other-keys)
2028 ;; Follow the instructions from 'subversion/bindings/swig/INSTALL'.
2029 (let ((out (assoc-ref outputs "out")))
2030 (invoke "make" "swig-pl-lib")
2031 ;; FIXME: Test failures.
2032 ;; (invoke "make" "check-swig-pl")
2033 (invoke "make" "install-swig-pl-lib")
2034
2035 ;; Set the right installation prefix.
2036 (with-directory-excursion
2037 "subversion/bindings/swig/perl/native"
2038 (invoke "perl" "Makefile.PL"
2039 "NO_PERLLOCAL=1"
2040 (string-append "PREFIX=" out))
2041 (invoke "make" "install"
2042 (string-append "OTHERLDFLAGS="
2043 "-Wl,-rpath="
2044 out "/lib")))))))))
2045 (native-inputs
2046 (list pkg-config
2047 ;; For the Perl bindings.
2048 swig))
2049 (inputs
2050 `(("apr" ,apr)
2051 ("apr-util" ,apr-util)
2052 ("lz4" ,lz4)
2053 ("serf" ,serf)
2054 ("perl" ,perl)
2055 ("python" ,python-wrapper)
2056 ("sqlite" ,sqlite)
2057 ("utf8proc" ,utf8proc)
2058 ("zlib" ,zlib)))
2059 (home-page "https://subversion.apache.org/")
2060 (synopsis "Revision control system")
2061 (description
2062 "@dfn{Subversion} (svn) exists to be recognized and adopted as a
2063 centralized version control system characterized by its
2064 reliability as a safe haven for valuable data; the simplicity of its model and
2065 usage; and its ability to support the needs of a wide variety of users and
2066 projects, from individuals to large-scale enterprise operations.")
2067 (license license:asl2.0)))
2068
2069 (define-public rcs
2070 (package
2071 (name "rcs")
2072 (version "5.10.1")
2073 (source (origin
2074 (method url-fetch)
2075 (uri (string-append "mirror://gnu/rcs/rcs-"
2076 version ".tar.lz"))
2077 (sha256
2078 (base32
2079 "1iac4d1dhsfy5zb0n3p605pihdq702v06r4g8vi8b2saf88gxpa3"))))
2080 (build-system gnu-build-system)
2081 (arguments `(#:phases
2082 (modify-phases %standard-phases
2083 (add-after 'install 'install-rcsfreeze
2084 (lambda* (#:key outputs #:allow-other-keys)
2085 (let* ((out (assoc-ref outputs "out"))
2086 (bin (string-append out "/bin"))
2087 (man1 (string-append out "/share/man/man1")))
2088 (chmod "src/rcsfreeze" #o755)
2089 (install-file "src/rcsfreeze" bin)
2090 (install-file "man/rcsfreeze.1" man1)))))))
2091 (native-inputs (list ed lzip))
2092 (home-page "https://www.gnu.org/software/rcs/")
2093 (synopsis "Per-file local revision control system")
2094 (description
2095 "RCS is the original Revision Control System. It works on a
2096 file-by-file basis, in contrast to subsequent version control systems such as
2097 CVS, Subversion, and Git. This can make it suitable for system
2098 administration files, for example, which are often inherently local to one
2099 machine.")
2100 (license license:gpl3+)))
2101
2102 (define-public rcs-blame
2103 (package
2104 (name "rcs-blame")
2105 (version "1.3.1-20210207")
2106 (source (origin
2107 (method url-fetch)
2108 (uri (string-append
2109 "https://invisible-mirror.net/archives/rcs-blame/blame-"
2110 version ".tgz"))
2111 (sha256
2112 (base32
2113 "1j0brsvdx3hlbwchddafh8r2xmxv5vg4ahpd68v4bb9xhcq6pcih"))))
2114 (build-system gnu-build-system)
2115 (home-page "https://invisible-island.net/rcs-blame/rcs-blame.html")
2116 (synopsis "Display the last modification for each line in an RCS file")
2117 (description
2118 "@code{blame} outputs an annotated revision from each RCS file. An
2119 annotated RCS file describes the revision and date in which each line was
2120 added to the file, and the author of each line.")
2121 (license license:gpl2+)))
2122
2123 (define-public rcshist
2124 (package
2125 (name "rcshist")
2126 (version "1.04-20190106")
2127 (source (origin
2128 (method url-fetch)
2129 (uri (string-append
2130 "https://invisible-mirror.net/archives/rcshist/rcshist-"
2131 version ".tgz"))
2132 (sha256
2133 (base32
2134 "01ab3xwgm934lxr8bm758am3vxwx4hxx7cc9prbgqj5nh30vdg1n"))))
2135 (build-system gnu-build-system)
2136 (home-page "https://invisible-island.net/rcshist/rcshist.html")
2137 (synopsis "Display RCS change history")
2138 (description
2139 "The @code{rcshist} utility displays the complete revision history of a
2140 set of RCS files including log messages and patches. It can also display the
2141 patch associated with a particular revision of an RCS file.")
2142 (license (list license:bsd-2
2143 license:bsd-3)))) ; bsd_queue.h
2144
2145 (define-public cvs
2146 (package
2147 (name "cvs")
2148 (version "1.12.13")
2149 (source (origin
2150 (method url-fetch)
2151 (uri (string-append
2152 "https://ftp.gnu.org/non-gnu/cvs/source/feature/"
2153 version "/cvs-" version ".tar.bz2"))
2154 (patches (search-patches "cvs-CVE-2017-12836.patch"))
2155 (sha256
2156 (base32
2157 "0pjir8cwn0087mxszzbsi1gyfc6373vif96cw4q3m1x6p49kd1bq"))))
2158 (build-system gnu-build-system)
2159 (arguments
2160 ;; XXX: The test suite looks flawed, and the package is obsolete anyway.
2161 '(#:tests? #f
2162 #:configure-flags (list "--with-external-zlib")))
2163 (inputs (list zlib nano)) ; the default editor
2164 (home-page "http://cvs.nongnu.org")
2165 (synopsis "Historical centralized version control system")
2166 (description
2167 "CVS is a version control system, an important component of Source
2168 Configuration Management (SCM). Using it, you can record the history of
2169 sources files, and documents. It fills a similar role to the free software
2170 RCS, PRCS, and Aegis packages.")
2171 (license license:gpl1+)))
2172
2173 (define-public cvs-fast-export
2174 (package
2175 (name "cvs-fast-export")
2176 (version "1.56")
2177 (source (origin
2178 (method url-fetch)
2179 (uri (string-append "http://www.catb.org/~esr/cvs-fast-export/"
2180 "cvs-fast-export-" version ".tar.gz"))
2181 (sha256
2182 (base32
2183 "058bzp3npng48ascls943m16kgvrl0h197a10brf7mvx8zpfc7sc"))))
2184 (build-system gnu-build-system)
2185 (arguments
2186 '(#:phases
2187 (modify-phases %standard-phases
2188 (delete 'configure)) ; no configure script
2189 #:parallel-build? #f ; parallel a2x commands fail spectacularly
2190 #:make-flags
2191 (list "CC=gcc" (string-append "prefix?=" (assoc-ref %outputs "out")))))
2192 (inputs
2193 `(("git" ,git)
2194 ("python" ,python-wrapper)))
2195 (native-inputs
2196 (list asciidoc
2197 ;; These are needed for the tests.
2198 cvs rcs))
2199 (home-page "http://www.catb.org/esr/cvs-fast-export/")
2200 (synopsis "Export an RCS or CVS history as a fast-import stream")
2201 (description "This program analyzes a collection of RCS files in a CVS
2202 repository (or outside of one) and, when possible, emits an equivalent history
2203 in the form of a fast-import stream. Not all possible histories can be
2204 rendered this way; the program tries to emit useful warnings when it can't.
2205
2206 The program can also produce a visualization of the resulting commit directed
2207 acyclic graph (DAG) in the input format of @uref{http://www.graphviz.org,
2208 Graphviz}. The package also includes @command{cvssync}, a tool for mirroring
2209 masters from remote CVS hosts.")
2210 (license license:gpl2+)))
2211
2212 (define-public vc-dwim
2213 (package
2214 (name "vc-dwim")
2215 (version "1.10")
2216 (source (origin
2217 (method url-fetch)
2218 (uri (string-append "mirror://gnu/vc-dwim/vc-dwim-"
2219 version ".tar.xz"))
2220 (sha256
2221 (base32
2222 "0am6axxdvkm2vwgg0gjrd930yv4dlsdbf0rdv0zh5bhy1ir64rph"))))
2223 (build-system gnu-build-system)
2224 (inputs (list perl))
2225 (native-inputs
2226 (list emacs-minimal ; for `ctags'
2227 inetutils)) ; for `hostname', used in the tests
2228 (home-page "https://www.gnu.org/software/vc-dwim/")
2229 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
2230 (description
2231 "The vc-dwim package contains two tools, \"vc-dwim\" and \"vc-chlog\".
2232 vc-dwim is a tool that simplifies the task of maintaining a ChangeLog and
2233 using version control at the same time, for example by printing a reminder
2234 when a file change has been described in the ChangeLog but the file has not
2235 been added to the VC. vc-chlog scans changed files and generates
2236 standards-compliant ChangeLog entries based on the changes that it detects.")
2237 (license license:gpl3+)))
2238
2239 (define-public diffstat
2240 (package
2241 (name "diffstat")
2242 (version "1.64")
2243 (source (origin
2244 (method url-fetch)
2245 (uri
2246 (list
2247 (string-append "ftp://invisible-island.net/diffstat/"
2248 "diffstat-" version ".tgz")
2249 (string-append "http://invisible-mirror.net/archives/diffstat/"
2250 "diffstat-" version ".tgz")))
2251 (sha256
2252 (base32
2253 "1z7pwcv48fjnhxrjcsjdy83x8b9ckl582mbbds90a79fkn6y7bmq"))))
2254 (build-system gnu-build-system)
2255 (home-page "https://invisible-island.net/diffstat/")
2256 (synopsis "Make histograms from the output of @command{diff}")
2257 (description
2258 "Diffstat reads the output of @command{diff} and displays a histogram of
2259 the insertions, deletions, and modifications per file. It is useful for
2260 reviewing large, complex patch files.")
2261 (license (license:x11-style "file://COPYING"))))
2262
2263 (define-public cssc
2264 (package
2265 (name "cssc")
2266 (version "1.4.1")
2267 (source (origin
2268 (method url-fetch)
2269 (uri (string-append "mirror://gnu/" name "/CSSC-"
2270 version ".tar.gz"))
2271 (sha256
2272 (base32
2273 "1vsisqq573xjr2qpn19iwmpqgl3mq03m790akpa4rvj60b4d1gni"))))
2274 (build-system gnu-build-system)
2275 (arguments
2276 `(#:phases
2277 (modify-phases %standard-phases
2278 (add-before 'check 'precheck
2279 (lambda _
2280 (begin
2281 (substitute* "tests/common/test-common"
2282 (("/bin/pwd") (which "pwd")))
2283
2284 (substitute* "tests/prt/all-512.sh"
2285 (("/bin/sh") (which "sh")))
2286
2287 ;; XXX: This test has no hope of passing until there is a "nogroup"
2288 ;; entry (or at least some group to which the guix builder does
2289 ;; not belong) in the /etc/group file of the build environment.
2290 ;; Currently we do not have such a group. Disable this test for now.
2291 (substitute* "tests/Makefile"
2292 (("test-delta ") ""))))))))
2293 ;; These are needed for the tests
2294 (native-inputs (list git cvs))
2295 (home-page "https://www.gnu.org/software/cssc/")
2296 (synopsis "File-based version control like SCCS")
2297 (description "GNU CSSC provides a replacement for the legacy Unix source
2298 code control system SCCS. This allows old code still under that system to be
2299 accessed and migrated on modern systems.")
2300 (license license:gpl3+)))
2301
2302 ;; This package can unfortunately work only in -TEST mode, since Aegis
2303 ;; requires that it is installed setuid root.
2304 (define-public aegis
2305 (package
2306 (name "aegis")
2307 (version "4.24")
2308 (source (origin
2309 (method url-fetch)
2310 (uri (string-append "mirror://sourceforge/aegis/aegis/" version
2311 "/aegis-" version ".tar.gz"))
2312 (sha256
2313 (base32
2314 "18s86ssarfmc4l17gbpzybca29m5wa37cbaimdji8czlcry3mcjl"))
2315 (patches (search-patches "aegis-perl-tempdir1.patch"
2316 "aegis-perl-tempdir2.patch"
2317 "aegis-test-fixup-1.patch"
2318 "aegis-test-fixup-2.patch"
2319 "aegis-constness-error.patch"))))
2320 (build-system gnu-build-system)
2321 (inputs
2322 `(("e2fsprogs" ,e2fsprogs)
2323 ("curl" ,curl)
2324 ("file" ,file)
2325 ("libxml2" ,libxml2)
2326 ("zlib" ,zlib)
2327 ("gettext" ,gettext-minimal)))
2328 (native-inputs
2329 (list bison
2330 groff
2331 perl
2332 ;; Various tests require the following:
2333 cvs
2334 flex
2335 cook
2336 subversion
2337 rcs
2338 ed))
2339 (arguments
2340 `(#:configure-flags (list "--with-no-aegis-configured"
2341 "--sharedstatedir=/var/com/aegis"
2342 ;; Uses the old 'throw()' specifier with 'new'
2343 ;; which changed in C++11.
2344 "CXXFLAGS=-std=c++03")
2345 #:parallel-build? #f ; There are some nasty racy rules in the Makefile.
2346 #:phases
2347 (modify-phases %standard-phases
2348 (add-before 'configure 'pre-conf
2349 (lambda _
2350 (substitute* (append '("configure"
2351 "etc/check-tar-gz.sh"
2352 "etc/patches.sh"
2353 "etc/test.sh"
2354 "script/aexver.in"
2355 "script/aebisect.in"
2356 "script/aeintegratq.in"
2357 "script/tkaegis.in"
2358 "script/test_funcs.in"
2359 "web/eg_oss_templ.sh"
2360 "web/webiface.html"
2361 "libaegis/getpw_cache.cc")
2362 (find-files "test" "\\.sh"))
2363 (("/bin/sh") (which "sh")))
2364 (setenv "SH" (which "sh"))
2365 #t))
2366 (replace 'check
2367 (lambda _
2368 (let ((home (string-append (getcwd) "/my-new-home")))
2369 ;; Some tests need to write to $HOME.
2370 (mkdir home)
2371 (setenv "HOME" home)
2372
2373 ;; This test assumes that flex has been symlinked to "lex".
2374 (substitute* "test/00/t0011a.sh"
2375 (("type lex") "type flex"))
2376
2377 ;; XXX Disable tests that fail, for unknown reasons, ‘for now’.
2378 (for-each
2379 (lambda (test) (substitute* "Makefile"
2380 (((string-append "test/" test "\\.ES ")) "")))
2381 (list "00/t0011a"
2382 "00/t0049a"
2383 "01/t0196a"))
2384
2385 ;; The author decided to call the check rule "sure".
2386 (invoke "make" "sure")))))))
2387 (home-page "https://sourceforge.net/projects/aegis/")
2388 (synopsis "Project change supervisor")
2389 (description "Aegis is a project change supervisor, and performs some of
2390 the Software Configuration Management needed in a CASE environment. Aegis
2391 provides a framework within which a team of developers may work on many
2392 changes to a program independently, and Aegis coordinates integrating these
2393 changes back into the master source of the program, with as little disruption
2394 as possible. Resolution of contention for source files, a major headache for
2395 any project with more than one developer, is one of Aegis's major functions.")
2396 (license license:gpl3+)))
2397
2398 (define-public reposurgeon
2399 (package
2400 (name "reposurgeon")
2401 (version "3.43")
2402 (source (origin
2403 (method url-fetch)
2404 (uri (string-append "http://www.catb.org/~esr/" name "/"
2405 name "-" version ".tar.xz"))
2406 (sha256
2407 (base32
2408 "1af0z14wcm4bk5a9ysinbwq2fp3lf5f7i8mvwh7286hr3fnagcaz"))
2409 (patches (search-patches
2410 "reposurgeon-add-missing-docbook-files.patch"))))
2411 (build-system gnu-build-system)
2412 (arguments
2413 `(#:make-flags
2414 (list "ECHO=echo"
2415 (string-append "target=" (assoc-ref %outputs "out")))
2416 #:phases
2417 (modify-phases %standard-phases
2418 (add-after 'unpack 'patch-inputs
2419 (lambda* (#:key inputs #:allow-other-keys)
2420 (let ((tzdata (assoc-ref inputs "tzdata")))
2421 (substitute* "reposurgeon"
2422 (("/usr/share/zoneinfo")
2423 (string-append tzdata "/share/zoneinfo")))
2424 (substitute* "test/svn-to-svn"
2425 (("/bin/echo") "echo"))
2426 #t)))
2427 (delete 'configure) ; no configure script
2428 (add-before 'build 'fix-docbook
2429 (lambda* (#:key inputs #:allow-other-keys)
2430 (substitute* (find-files "." "\\.xml$")
2431 (("docbook/docbookx.dtd")
2432 (string-append (assoc-ref inputs "docbook-xml")
2433 "/xml/dtd/docbook/docbookx.dtd")))
2434 #t))
2435 (add-before 'check 'set-up-test-environment
2436 (lambda* (#:key inputs #:allow-other-keys)
2437 (let ((tzdata (assoc-ref inputs "tzdata")))
2438 (setenv "TZDIR" (string-append tzdata "/share/zoneinfo"))
2439 #t)))
2440 (add-after 'install 'install-emacs-data
2441 (lambda* (#:key outputs #:allow-other-keys)
2442 (install-file "reposurgeon-mode.el"
2443 (string-append (assoc-ref outputs "out")
2444 "/share/emacs/site-lisp"))
2445 #t)))))
2446 (inputs
2447 `(("python" ,python-wrapper)
2448 ("tzdata" ,tzdata)))
2449 (native-inputs
2450 (list ;; For building documentation.
2451 asciidoc
2452 docbook-xml
2453 docbook-xsl
2454 libxml2
2455 xmlto
2456 ;; For tests.
2457 cvs
2458 git
2459 mercurial
2460 subversion))
2461 (home-page "http://www.catb.org/~esr/reposurgeon/")
2462 (synopsis "Edit version-control repository history")
2463 (description "Reposurgeon enables risky operations that version-control
2464 systems don't want to let you do, such as editing past comments and metadata
2465 and removing commits. It works with any version control system that can
2466 export and import Git fast-import streams, including Git, Mercurial, Fossil,
2467 Bazaar, CVS, RCS, and Src. It can also read Subversion dump files directly
2468 and can thus be used to script production of very high-quality conversions
2469 from Subversion to any supported Distributed Version Control System (DVCS).")
2470 ;; Most files are distributed under bsd-2, except 'repocutter' which is
2471 ;; under bsd-3.
2472 (license (list license:bsd-2 license:bsd-3))))
2473
2474 (define-public tig
2475 (package
2476 (name "tig")
2477 (version "2.5.7")
2478 (source (origin
2479 (method url-fetch)
2480 (uri (string-append
2481 "https://github.com/jonas/tig/releases/download/tig-"
2482 version "/tig-" version ".tar.gz"))
2483 (sha256
2484 (base32
2485 "0xna55y1r1jssdmrzpinv96p7w00w9hn39q5l3d8l299dg4bmiyv"))
2486 (modules '((guix build utils)))
2487 (snippet
2488 '(begin
2489 ;; TODO: Delete and rebuild doc/*.(1|5|7).
2490 (for-each delete-file (find-files "doc" "\\.html$"))))))
2491 (build-system gnu-build-system)
2492 (native-inputs
2493 (list asciidoc xmlto))
2494 (inputs
2495 (list ncurses readline))
2496 (arguments
2497 `(#:phases
2498 (modify-phases %standard-phases
2499 (add-after 'install 'install-doc
2500 (lambda _
2501 (invoke "make" "install-doc")))
2502 (add-after 'install 'install-completions
2503 (lambda* (#:key outputs #:allow-other-keys)
2504 (let* ((out (assoc-ref outputs "out"))
2505 (share (string-append out "/share")))
2506 (mkdir-p (string-append share "/bash-completion/completions"))
2507 (mkdir-p (string-append share "/zsh/site-functions"))
2508 (copy-file "contrib/tig-completion.bash"
2509 (string-append share "/bash-completion/completions/tig"))
2510 (copy-file "contrib/tig-completion.zsh"
2511 (string-append share "/zsh/site-functions/_tig"))))))
2512 #:test-target "test"
2513 #:tests? #f)) ; tests require access to /dev/tty
2514 (home-page "https://jonas.github.io/tig/")
2515 (synopsis "Ncurses-based text user interface for Git")
2516 (description
2517 "Tig is an ncurses text user interface for Git, primarily intended as
2518 a history browser. It can also stage hunks for commit, or colorize the
2519 output of the @code{git} command.")
2520 (license license:gpl2+)))
2521
2522 (define-public findnewest
2523 (package
2524 (name "findnewest")
2525 (version "0.3")
2526 (source
2527 (origin
2528 (method git-fetch)
2529 (uri (git-reference
2530 (url "https://github.com/0-wiz-0/findnewest")
2531 (commit (string-append "findnewest-" version))))
2532 (file-name (git-file-name name version))
2533 (sha256
2534 (base32 "1x1cbn2b27h5r0ah5xc06fkalfdci2ngrgd4wibxjw0h88h0nvgq"))))
2535 (build-system gnu-build-system)
2536 (native-inputs (list autoconf automake))
2537 (home-page "https://github.com/0-wiz-0/findnewest/releases")
2538 (synopsis "Print the modification time of the latest file")
2539 (description
2540 "Recursively find the newest file in a file tree and print its
2541 modification time.")
2542 (license license:bsd-2)))
2543
2544 (define-public myrepos
2545 (package
2546 (name "myrepos")
2547 (version "1.20180726")
2548 (source
2549 (origin
2550 (method git-fetch)
2551 (uri (git-reference
2552 (url "git://myrepos.branchable.com/myrepos")
2553 (commit version)))
2554 (file-name (string-append name "-" version "-checkout"))
2555 (sha256
2556 (base32 "0jphw61plm8cgklja6hs639xhdvxgvjwbr6jpvjwpp7hc5gmhms5"))))
2557 (build-system gnu-build-system)
2558 (arguments
2559 '(#:test-target "test"
2560 #:make-flags (list (string-append "PREFIX=" %output))
2561 #:phases
2562 (modify-phases %standard-phases
2563 (delete 'configure)
2564 (add-after 'install 'wrap-webcheckout
2565 (lambda* (#:key inputs outputs #:allow-other-keys)
2566 (let ((out (assoc-ref outputs "out")))
2567 (wrap-program (string-append out "/bin/webcheckout")
2568 `("PERL5LIB" ":" prefix
2569 ,(map (lambda (i) (string-append (assoc-ref inputs i)
2570 "/lib/perl5/site_perl"))
2571 '("perl-encode-locale" "perl-http-date"
2572 "perl-http-message" "perl-html-parser" "perl-libwww"
2573 "perl-uri" "perl-try-tiny"))))
2574 #t))))))
2575 (inputs
2576 (list perl
2577 perl-encode-locale
2578 perl-html-parser
2579 perl-http-date
2580 perl-http-message
2581 perl-libwww
2582 perl-try-tiny
2583 perl-uri))
2584 (home-page "https://myrepos.branchable.com/")
2585 (synopsis "Multiple repository management tool")
2586 (description
2587 "Myrepos provides the @code{mr} command, which maps an operation (e.g.,
2588 fetching updates) over a collection of version control repositories. It
2589 supports a large number of version control systems: Git, Subversion,
2590 Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
2591 (license license:gpl2+)))
2592
2593 (define-public grokmirror
2594 (package
2595 (name "grokmirror")
2596 (version "2.0.11")
2597 (source
2598 (origin
2599 (method git-fetch)
2600 (uri (git-reference
2601 (url (string-append "https://git.kernel.org/pub/scm/"
2602 "utils/grokmirror/grokmirror.git"))
2603 (commit (string-append "v" version))))
2604 (file-name (string-append name "-" version "-checkout"))
2605 (sha256
2606 (base32 "0c6nnfzzyl247r1dcjnsyx16d34nyra9ikjjhi0xzlrbiwnb0w32"))))
2607 (build-system python-build-system)
2608 (arguments
2609 `(#:tests? #f ; no test suite
2610 #:phases
2611 (modify-phases %standard-phases
2612 (add-after 'install 'install-manpages
2613 (lambda* (#:key outputs #:allow-other-keys)
2614 (let* ((man (string-append (assoc-ref outputs "out")
2615 "/man/man1/")))
2616 (mkdir-p man)
2617 (for-each (lambda (file) (install-file file man))
2618 (find-files "." "\\.1$"))))))))
2619 (propagated-inputs
2620 (list python-packaging python-requests))
2621 (home-page
2622 "https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git")
2623 (synopsis "Framework to smartly mirror git repositories")
2624 (description "Grokmirror enables replicating large git repository
2625 collections efficiently. Mirrors decide to clone and update repositories
2626 based on a manifest file published by servers.")
2627 (license license:gpl3+)))
2628
2629 (define-public patatt
2630 (package
2631 (name "patatt")
2632 (version "0.4.9")
2633 (source
2634 (origin
2635 (method url-fetch)
2636 (uri (pypi-uri "patatt" version))
2637 (sha256
2638 (base32 "0fpbkmdlnz9s1lakw11jlrzpz4mb6f4dksdiir9g1ppq0g34sy58"))))
2639 (build-system python-build-system)
2640 (arguments '(#:tests? #f)) ; No tests.
2641 (propagated-inputs
2642 (list python-pynacl))
2643 (home-page "https://git.kernel.org/pub/scm/utils/patatt/patatt.git")
2644 (synopsis "Tool for cryptographic patch attestation")
2645 (description "This utility provides end-to-end cryptographic attestation
2646 of patches sent via mail. It does so by adapting the DKIM email signature
2647 standard to include cryptographic signatures via the X-Developer-Signature
2648 email header.")
2649 (license license:expat-0)))
2650
2651 (define-public b4
2652 (package
2653 (name "b4")
2654 (version "0.8.0")
2655 (source
2656 (origin
2657 (method url-fetch)
2658 (uri (pypi-uri "b4" version))
2659 (sha256
2660 (base32 "115ysciq15sxc8fd9hf7p0f4wnd5xapcfkmq8g33y1c8nbdxclbx"))))
2661 (build-system python-build-system)
2662 (arguments
2663 (list #:tests? #f ;no tests
2664 #:phases
2665 #~(modify-phases %standard-phases
2666 ;; XXX: dnspython attempts to read /etc/resolv.conf when loading
2667 ;; resolver.py, which breaks the sanity check in dependent
2668 ;; packages. This should rather be fixed in dnspython.
2669 (delete 'sanity-check))))
2670 (inputs
2671 (list python-dkimpy python-dnspython python-requests))
2672 (propagated-inputs
2673 (list patatt))
2674 (home-page "https://git.kernel.org/pub/scm/utils/b4/b4.git")
2675 (synopsis "Tool for working with patches in public-inbox archives")
2676 (description
2677 "The @code{b4} command is designed to make it easier to participate in
2678 patch-based workflows for projects that have public-inbox archives.
2679
2680 Features include:
2681 @itemize
2682 @item downloading a thread's mbox given a message ID
2683 @item processing an mbox so that is ready to be fed to @code{git-am}
2684 @item creating templated replies for processed patches and pull requests
2685 @item submitting cryptographic attestation for patches.
2686 @end itemize")
2687 (license license:gpl2+)))
2688
2689 (define-public git-annex-remote-rclone
2690 (package
2691 (name "git-annex-remote-rclone")
2692 (version "0.6")
2693 (source
2694 (origin
2695 (method git-fetch)
2696 (uri (git-reference
2697 (url "https://github.com/DanielDent/git-annex-remote-rclone")
2698 (commit (string-append "v" version))))
2699 (file-name (git-file-name name version))
2700 (sha256
2701 (base32
2702 "0j0hlxji8d974fq7zd4xc02n0jpi31ylhxc7z4zp8iiwad5mkpxp"))))
2703 (build-system trivial-build-system)
2704 (arguments
2705 `(#:modules ((guix build utils))
2706 #:builder
2707 (begin
2708 (use-modules (guix build utils))
2709 (let ((bash (search-input-file %build-inputs "/bin/bash"))
2710 (rclone (search-input-file %build-inputs "/bin/rclone")))
2711 (copy-file (string-append (assoc-ref %build-inputs "source")
2712 "/git-annex-remote-rclone")
2713 "git-annex-remote-rclone")
2714 (substitute* "git-annex-remote-rclone"
2715 (("/bin/bash") bash)
2716 (("runcmd rclone") (string-append "runcmd " rclone)))
2717 (install-file "git-annex-remote-rclone"
2718 (string-append %output "/bin"))
2719 #t))))
2720 (inputs
2721 (list bash rclone))
2722 (home-page "https://github.com/DanielDent/git-annex-remote-rclone")
2723 (synopsis "Use rclone-supported cloud storage providers with git-annex")
2724 (description "This wrapper around rclone makes any destination supported
2725 by rclone usable with git-annex.")
2726 (license license:gpl3+)))
2727
2728 (define-public fossil
2729 (package
2730 (name "fossil")
2731 (version "2.18")
2732 (source
2733 (origin
2734 (method url-fetch)
2735 (uri (string-append
2736 "https://www.fossil-scm.org/home/tarball/"
2737 "84f25d7eb10c0714109d69bb2809abfa8b4b5c3d73b151a5b10df724dacd46d8"
2738 "/fossil-src-" version ".tar.gz"))
2739 ;; XXX: Currently the above hash must be manually updated.
2740 (sha256
2741 (base32 "0cq7677p84nnbfvk2dsh3c3y900gslw3zaw8iipfq932vmf1s31h"))
2742 (modules '((guix build utils)))
2743 (snippet
2744 '(begin
2745 (delete-file-recursively "compat")
2746 ;; Disable obsolete SQLite feature check; remove for 2.19.
2747 (substitute* "tools/sqlcompattest.c"
2748 ((".*\"ENABLE_JSON1\".*")
2749 ""))))))
2750 (build-system gnu-build-system)
2751 (native-inputs
2752 (list tcl ;for configuration only
2753 which ;for tests only
2754 ed)) ;ditto
2755 (inputs
2756 (list openssl zlib sqlite-next)) ;SQLite 3.37 or later
2757 (arguments
2758 `(#:configure-flags (list "--with-openssl=auto"
2759 "--disable-internal-sqlite")
2760 #:test-target "test"
2761 #:phases (modify-phases %standard-phases
2762 (add-after 'patch-source-shebangs 'patch-sh
2763 (lambda _
2764 (substitute* '("auto.def")
2765 (("/bin/sh") (which "sh")))))
2766 (replace 'configure
2767 (lambda* (#:key outputs (configure-flags '())
2768 #:allow-other-keys)
2769 ;; The 'configure' script is not an autoconf script and
2770 ;; chokes on unrecognized options.
2771 (apply invoke
2772 "./configure"
2773 (string-append "--prefix="
2774 (assoc-ref outputs "out"))
2775 configure-flags)))
2776 (add-before 'check 'test-setup
2777 (lambda _
2778 (setenv "USER" "guix")
2779 (setenv "TZ" "UTC"))))))
2780 (home-page "https://fossil-scm.org")
2781 (synopsis "Software configuration management system")
2782 (description
2783 "Fossil is a distributed source control management system which supports
2784 access and administration over HTTP CGI or via a built-in HTTP server. It has
2785 a built-in wiki, built-in file browsing, built-in tickets system, etc.")
2786 (properties
2787 '((release-monitoring-url
2788 . "https://fossil-scm.org/home/uv/latest-release.md")))
2789 (license (list license:public-domain ;src/miniz.c, src/shell.c
2790 license:bsd-2))))
2791
2792 (define-public stagit
2793 (package
2794 (name "stagit")
2795 (version "1.0")
2796 (source (origin
2797 (method git-fetch)
2798 (uri (git-reference
2799 (url "git://git.codemadness.org/stagit")
2800 (commit version)))
2801 (file-name (git-file-name name version))
2802 (sha256
2803 (base32
2804 "0j2242vx5pbwdv79gcjxdbrwii48qphr8gk1lk7szj2irxdql171"))))
2805 (build-system gnu-build-system)
2806 (arguments
2807 `(#:tests? #f ; No tests
2808 #:make-flags (list (string-append "CC=" ,(cc-for-target))
2809 (string-append "PREFIX=" %output))
2810 #:phases
2811 (modify-phases %standard-phases
2812 (delete 'configure)))) ; No configure script
2813 (inputs
2814 (list libgit2))
2815 (home-page "https://git.codemadness.org/stagit/")
2816 (synopsis "Static git page generator")
2817 (description "Stagit creates static pages for git repositories, the results can
2818 be served with a HTTP file server of your choice.")
2819 (license license:expat)))
2820
2821 (define-public gource
2822 (package
2823 (name "gource")
2824 (version "0.51")
2825 (source (origin
2826 (method url-fetch)
2827 (uri (string-append
2828 "https://github.com/acaudwell/Gource/releases/download"
2829 "/gource-" version "/gource-" version ".tar.gz"))
2830 (sha256
2831 (base32
2832 "16p7b1x4r0915w883lp374jcdqqja37fnb7m8vnsfnl2n64gi8qr"))))
2833 (build-system gnu-build-system)
2834 (arguments
2835 `(#:configure-flags
2836 (list (string-append "--with-boost-libdir="
2837 (assoc-ref %build-inputs "boost")
2838 "/lib"))))
2839 (native-inputs
2840 (list pkg-config))
2841 (inputs
2842 (list boost
2843 ftgl
2844 glew
2845 glm
2846 glu
2847 libpng
2848 mesa
2849 pcre
2850 (sdl-union (list sdl2 sdl2-image))))
2851 (home-page "https://gource.io/")
2852 (synopsis "3D visualisation tool for source control repositories")
2853 (description "@code{gource} provides a software version control
2854 visualization. The repository is displayed as a tree where the root of the
2855 repository is the centre, directories are branches and files are leaves.
2856 Contributors to the source code appear and disappear as they contribute to
2857 specific files and directories.")
2858 (license license:gpl3+)))
2859
2860 (define-public src
2861 (package
2862 (name "src")
2863 (version "1.29")
2864 (source (origin
2865 (method url-fetch)
2866 (uri (string-append
2867 "http://www.catb.org/~esr/src/src-" version ".tar.gz"))
2868 (sha256
2869 (base32
2870 "0ha287gc95vz6bdvn42pi3qibc56h1w5dshsvjvdn2zd283amksd"))))
2871 (build-system gnu-build-system)
2872 (arguments
2873 '(#:make-flags
2874 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2875 #:phases
2876 (modify-phases %standard-phases
2877 (delete 'configure) ; no 'configure' script
2878 (add-after 'install 'wrap-program
2879 (lambda* (#:key inputs outputs #:allow-other-keys)
2880 (let* ((out (assoc-ref outputs "out"))
2881 (prog (string-append out "/bin/src"))
2882 (rcs (assoc-ref inputs "rcs")))
2883 (wrap-program prog
2884 `("PATH" ":" prefix (,(string-append rcs "/bin"))))
2885 #t)))
2886 (replace 'check
2887 (lambda _
2888 (setenv "HOME" (getenv "TMPDIR"))
2889 (invoke "git" "config" "--global" "user.name" "guix")
2890 (invoke "git" "config" "--global" "user.email" "guix")
2891 (invoke "./srctest"))))))
2892 (native-inputs
2893 ;; For testing.
2894 (list git perl))
2895 (inputs
2896 `(("cssc" ,cssc)
2897 ("python" ,python-wrapper)
2898 ("rcs" ,rcs)))
2899 (synopsis "Simple revision control")
2900 (home-page "http://www.catb.org/~esr/src/")
2901 (description
2902 "SRC (or src) is simple revision control, a version-control system for
2903 single-file projects by solo developers and authors. It modernizes the
2904 venerable RCS, hence the anagrammatic acronym. The design is tuned for use
2905 cases like all those little scripts in your @file{~/bin} directory, or a
2906 directory full of HOWTOs.")
2907 (license license:bsd-2)))
2908
2909 (define-public git-when-merged
2910 ;; Use an unreleased version to get a PY3 compatibility fix.
2911 (let ((commit "ab6af7865a0ba55ba364a6c507e0be6f84f31c6d"))
2912 (package
2913 (name "git-when-merged")
2914 (version (string-append "1.2.0-" (string-take commit 7)))
2915 (source (origin
2916 (method git-fetch)
2917 (uri (git-reference
2918 (url "https://github.com/mhagger/git-when-merged/")
2919 (commit commit)))
2920 (file-name (git-file-name name version))
2921 (sha256
2922 (base32
2923 "0iyk2psf97bc9h43m89p3xjmm79fsx99i7px29g4lcnmdy5kmz0p"))))
2924 (build-system gnu-build-system)
2925 (arguments
2926 `(#:tests? #f ; there are no tests
2927 #:phases
2928 (modify-phases %standard-phases
2929 (delete 'configure)
2930 (delete 'build)
2931 (replace 'install
2932 (lambda* (#:key outputs #:allow-other-keys)
2933 (install-file "bin/git-when-merged"
2934 (string-append (assoc-ref outputs "out")
2935 "/bin"))
2936 #t))
2937 (add-before 'install 'patch-git
2938 (lambda* (#:key inputs #:allow-other-keys)
2939 (let ((git (search-input-file inputs "/bin/git")))
2940 (substitute* "bin/git-when-merged"
2941 (("'git'") (string-append "'" git "'")))
2942 #t)))
2943 (add-after 'install 'wrap-script
2944 (lambda* (#:key outputs #:allow-other-keys)
2945 (wrap-program (string-append (assoc-ref outputs "out")
2946 "/bin/git-when-merged")
2947 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
2948 #t)))))
2949 (inputs
2950 `(("git" ,git)
2951 ("python" ,python-wrapper)))
2952 (home-page "https://github.com/mhagger/git-when-merged")
2953 (synopsis "Determine when a commit was merged into a Git branch")
2954 (description "This Git extension defines a subcommand,
2955 @code{when-merged}, whose core operation is to find the merge that brought a
2956 given commit into the specified ref(s). It has various options that control
2957 how information about the merge is displayed.")
2958 (license license:gpl2+))))
2959
2960 (define-public git-imerge
2961 (package
2962 (name "git-imerge")
2963 (version "1.1.0")
2964 (source
2965 (origin
2966 (method git-fetch)
2967 (uri (git-reference
2968 (url "https://github.com/mhagger/git-imerge")
2969 (commit (string-append "v" version))))
2970 (file-name (git-file-name name version))
2971 (sha256
2972 (base32 "0vi1w3f0yk4gqhxj2hzqafqq28rihyhyfnp8x7xzib96j2si14a4"))))
2973 (build-system gnu-build-system)
2974 (arguments
2975 `(#:tests? #f ; only manual test scripts
2976 #:make-flags (list (string-append "DESTDIR=" %output)
2977 "PREFIX=")
2978 #:phases
2979 (modify-phases %standard-phases
2980 (delete 'configure)
2981 (add-before 'install 'patch-git
2982 (lambda* (#:key inputs #:allow-other-keys)
2983 (let ((git (search-input-file inputs "/bin/git")))
2984 (substitute* "git-imerge"
2985 (("'git'") (string-append "'" git "'")))
2986 #t)))
2987 (add-after 'install 'wrap-script
2988 (lambda* (#:key outputs #:allow-other-keys)
2989 (wrap-program (string-append (assoc-ref outputs "out")
2990 "/bin/git-imerge")
2991 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
2992 #t)))))
2993 (inputs
2994 `(("git" ,git)
2995 ("python" ,python-wrapper)))
2996 (home-page "https://github.com/mhagger/git-imerge")
2997 (synopsis "Incremental merge for Git")
2998 (description "This Git extension defines a subcommand, @code{imerge},
2999 which performs an incremental merge between two branches. Its two primary
3000 design goals are to reduce the pain of resolving merge conflicts by finding
3001 the smallest possible conflicts and to allow a merge to be saved, tested,
3002 interrupted, published, and collaborated on while in progress.")
3003 (license license:gpl2+)))
3004
3005 (define-public git-lfs
3006 (package
3007 (name "git-lfs")
3008 (version "2.13.3")
3009 (source (origin
3010 (method git-fetch)
3011 (uri (git-reference
3012 (url "https://github.com/git-lfs/git-lfs")
3013 (commit (string-append "v" version))))
3014 (file-name (git-file-name name version))
3015 (sha256
3016 (base32
3017 "0r7dmqhkhz91d3n7qfpny483x8f1n88yya22j2fvx75rgg33z2sg"))))
3018 (build-system go-build-system)
3019 (arguments
3020 `(#:import-path "github.com/git-lfs/git-lfs"
3021 #:install-source? #f
3022 #:phases
3023 (modify-phases %standard-phases
3024 (add-before 'build 'man-gen
3025 ;; Without this, the binary generated in 'build
3026 ;; phase won't have any embedded usage-text.
3027 (lambda _
3028 (with-directory-excursion "src/github.com/git-lfs/git-lfs"
3029 (invoke "make" "mangen"))))
3030 (add-after 'build 'build-man-pages
3031 (lambda _
3032 (with-directory-excursion "src/github.com/git-lfs/git-lfs"
3033 (invoke "make" "man"))
3034 #t))
3035 (add-after 'install 'install-man-pages
3036 (lambda* (#:key outputs #:allow-other-keys)
3037 (with-directory-excursion "src/github.com/git-lfs/git-lfs/man"
3038 (let ((out (assoc-ref outputs "out")))
3039 (for-each
3040 (lambda (manpage)
3041 (install-file manpage (string-append out "/share/man/man1")))
3042 (find-files "." "^git-lfs.*\\.1$"))))
3043 #t)))))
3044 ;; make `ronn` available during build for man page generation
3045 (native-inputs (list ronn-ng))
3046 (home-page "https://git-lfs.github.com/")
3047 (synopsis "Git extension for versioning large files")
3048 (description
3049 "Git Large File Storage (LFS) replaces large files such as audio samples,
3050 videos, datasets, and graphics with text pointers inside Git, while storing the
3051 file contents on a remote server.")
3052 (license license:expat)))
3053
3054 (define-public git-open
3055 (package
3056 (name "git-open")
3057 (version "2.1.0")
3058 (source
3059 (origin
3060 (method git-fetch)
3061 (uri (git-reference
3062 (url "https://github.com/paulirish/git-open")
3063 (commit (string-append "v" version))))
3064 (file-name (git-file-name name version))
3065 (sha256
3066 (base32 "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0"))))
3067 (build-system copy-build-system)
3068 (inputs
3069 (list xdg-utils))
3070 (arguments
3071 `(#:phases
3072 (modify-phases %standard-phases
3073 (add-after 'install 'wrap-program
3074 (lambda* (#:key outputs inputs #:allow-other-keys)
3075 (let ((out (assoc-ref outputs "out"))
3076 (xdg-utils (assoc-ref inputs "xdg-utils")))
3077 (wrap-program (string-append out "/bin/git-open")
3078 `("PATH" ":" prefix (,(string-append xdg-utils "/bin"))))))))
3079 #:install-plan
3080 '(("git-open" "bin/git-open"))))
3081 (home-page "https://github.com/paulirish/git-open")
3082 (synopsis "Open a Git repository's homepage from the command-line")
3083 (description
3084 "@code{git open} opens the repository's website from the command-line,
3085 guessing the URL pattern from the @code{origin} remote.")
3086 (license license:expat)))
3087
3088 (define-public tla
3089 (package
3090 (name "gnu-arch")
3091 (version "1.3.5")
3092 (source (origin
3093 (method url-fetch)
3094 (uri (string-append "https://ftp.gnu.org/old-gnu/gnu-arch/"
3095 "tla-" version ".tar.gz"))
3096 (sha256
3097 (base32
3098 "01mfzj1i6p4s8191cgd5850hds1zls88hkf9rb6qx1vqjv585aj0"))
3099 (modules '((guix build utils)))
3100 (snippet
3101 '(begin
3102 ;; In tar 1.32, '--preserve' is ambiguous and leads to an
3103 ;; error, so address that.
3104 (substitute* "src/tla/libarch/archive.c"
3105 (("\"--preserve\"")
3106 "\"--preserve-permissions\""))
3107 #t))))
3108 (build-system gnu-build-system)
3109 (arguments
3110 '(#:phases (modify-phases %standard-phases
3111 (replace 'configure
3112 (lambda* (#:key inputs outputs #:allow-other-keys)
3113 (let ((out (assoc-ref outputs "out")))
3114 (chdir "src")
3115
3116 (mkdir "=build")
3117 (chdir "=build")
3118
3119 ;; For libneon's 'configure' script.
3120 ;; XXX: There's a bundled copy of neon.
3121 (setenv "CONFIG_SHELL" (which "sh"))
3122
3123 (invoke "../configure" "--prefix" out
3124 "--config-shell" (which "sh")
3125 "--with-posix-shell" (which "sh")
3126 "--with-cc" "gcc")))))
3127
3128
3129 ;; There are build failures when building in parallel.
3130 #:parallel-build? #f
3131 #:parallel-tests? #f
3132
3133 #:test-target "test"))
3134 (native-inputs
3135 (list which))
3136 (synopsis "Historical distributed version-control system")
3137 (description
3138 "GNU Arch, aka. @code{tla}, was one of the first free distributed
3139 version-control systems (DVCS). It saw its last release in 2006. This
3140 package is provided for users who need to recover @code{tla} repositories and
3141 for historians.")
3142 (home-page "https://www.gnu.org/software/gnu-arch/")
3143 (license license:gpl2))) ;version 2 only
3144
3145 (define-public diff-so-fancy
3146 (package
3147 (name "diff-so-fancy")
3148 (version "1.4.3")
3149 (source (origin
3150 (method git-fetch)
3151 (uri (git-reference
3152 (url "https://github.com/so-fancy/diff-so-fancy")
3153 (commit (string-append "v" version))))
3154 (file-name (git-file-name name version))
3155 (sha256
3156 (base32
3157 "11vkq5njjlvjipic7db44ga875n61drszw1qrdzwxmmfmnz425zz"))))
3158 (inputs
3159 (list perl ncurses))
3160 (build-system copy-build-system)
3161 (arguments
3162 '(#:phases
3163 (modify-phases %standard-phases
3164 (add-after 'unpack 'patch-lib-path
3165 (lambda* (#:key outputs #:allow-other-keys)
3166 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
3167 (substitute* "diff-so-fancy"
3168 (("use lib.*$")
3169 (string-append "use lib '" lib "';\n"))))))
3170 (add-after 'install 'symlink-executable
3171 (lambda* (#:key outputs inputs #:allow-other-keys)
3172 (let ((out (assoc-ref outputs "out"))
3173 (ncurses (assoc-ref inputs "ncurses"))
3174 (perl (assoc-ref inputs "perl")))
3175 (wrap-program (string-append out "/bin/diff-so-fancy")
3176 `("PATH" ":" prefix (,(string-append ncurses "/bin")
3177 ,(string-append perl "/bin"))))))))
3178 #:install-plan
3179 '(("lib" "lib")
3180 ("diff-so-fancy" "bin/"))))
3181 (home-page "https://github.com/so-fancy/diff-so-fancy")
3182 (synopsis "Makes diffs more human friendly and readable")
3183 (description
3184 "@code{diff-so-fancy} strives to make your diffs human readable instead
3185 of machine readable. This helps improve code quality and helps you spot
3186 defects faster.")
3187 (license license:expat)))
3188
3189 (define-public go-github-go-git
3190 (package
3191 (name "go-github-go-git")
3192 (version "5.1.0")
3193 (source (origin
3194 (method git-fetch)
3195 (uri (git-reference
3196 (url "https://github.com/go-git/go-git")
3197 (commit (string-append "v" version))))
3198 (file-name (git-file-name name version))
3199 (sha256
3200 (base32
3201 "1vkcmhh2qq8c38sjbnzf0wvg2rzr19wssaq177bsvrjwj1xz1qbs"))))
3202 (build-system go-build-system)
3203 (arguments
3204 `(#:tests? #f ;requires network connection
3205 #:import-path "github.com/go-git/go-git/v5"
3206 #:phases
3207 (modify-phases %standard-phases
3208 (add-before 'build 'setup
3209 (lambda* (#:key inputs #:allow-other-keys)
3210 (let* ((git (assoc-ref inputs "git"))
3211 (git-bin (string-append (assoc-ref inputs "git") "/bin"))
3212 (git-exe (string-append git-bin "/git")))
3213 (setenv "GIT_DIST_PATH=" git)
3214 (setenv "GIT_EXEC_PATH=" git-bin)
3215 (setenv "HOME" (getcwd))
3216 (invoke git-exe "config" "--global" "user.email" "gha@example.com")
3217 (invoke git-exe "config" "--global" "user.name" "GitHub Actions")
3218 #t)
3219 #t)))))
3220 (native-inputs
3221 `(("go-github-com-emirpasic-gods" ,go-github-com-emirpasic-gods)
3222 ("go-github-com-go-git-gcfg" ,go-github-com-go-git-gcfg)
3223 ("go-github-com-go-git-go-billy" ,go-github-com-go-git-go-billy)
3224 ("go-github-com-imdario-mergo" ,go-github-com-imdario-mergo)
3225 ("go-github-com-jbenet-go-context" ,go-github-com-jbenet-go-context)
3226 ("go-github-com-kevinburke-ssh-config" ,go-github-com-kevinburke-ssh-config)
3227 ("go-github-com-mitchellh-go-homedir" ,go-github-com-mitchellh-go-homedir)
3228 ("go-github-com-sergi-go-diff" ,go-github-com-sergi-go-diff)
3229 ("go-github-com-xanzy-ssh-agentf" ,go-github-com-xanzy-ssh-agent)
3230 ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
3231 ("go-golang-org-x-net" ,go-golang-org-x-net)
3232 ("go-gopkg-in-warnings" ,go-gopkg-in-warnings)
3233 ("go-github-com-go-git-go-git-fixtures" ,go-github-com-go-git-go-git-fixtures)
3234 ("go-gopkg-in-check-v1" ,go-gopkg-in-check-v1)
3235 ("go-github-com-alcortesm-tgz" ,go-github-com-alcortesm-tgz)
3236 ("go-golang-org-x-text" ,go-golang-org-x-text)
3237 ("git" ,git)))
3238 (home-page "https://github.com/go-git/")
3239 (synopsis "Git implementation library")
3240 (description "This package provides a Git implementation library.")
3241 (license license:asl2.0)))
3242
3243 (define-public gita
3244 (let ((commit "e41b504dca90a25e9be27f296da7ce22e5782893")
3245 (revision "1"))
3246 (package
3247 (name "gita")
3248 (version (git-version "0.12.9" revision commit))
3249 (source (origin
3250 (method git-fetch)
3251 (uri (git-reference
3252 (url "https://github.com/nosarthur/gita")
3253 (commit commit)))
3254 (file-name (git-file-name name version))
3255 (sha256
3256 (base32
3257 "1k03zgcbhl91cgyh4k7ywyjp00y63q4bqbimncqh5b3lni8l8j5l"))))
3258 (build-system python-build-system)
3259 (native-inputs
3260 (list git ;for tests
3261 python-pytest))
3262 (propagated-inputs
3263 (list python-pyyaml))
3264 (arguments
3265 `(#:phases
3266 (modify-phases %standard-phases
3267 (replace 'check
3268 (lambda* (#:key inputs outputs #:allow-other-keys)
3269 (substitute* "tests/test_main.py"
3270 (("'gita\\\\n'") "'source\\n'")
3271 (("'gita'") "'source'"))
3272 (invoke (search-input-file inputs "/bin/git")
3273 "init")
3274 (add-installed-pythonpath inputs outputs)
3275 (invoke (search-input-file inputs "/bin/pytest")
3276 "-vv" "tests")))
3277 (add-after 'install 'install-shell-completions
3278 (lambda* (#:key outputs #:allow-other-keys)
3279 (let* ((out (assoc-ref outputs "out"))
3280 (bash-completion (string-append out "/etc/bash_completion.d"))
3281 (zsh-completion (string-append out "/etc/zsh/site-functions")))
3282 (mkdir-p bash-completion)
3283 (copy-file ".gita-completion.bash"
3284 (string-append bash-completion "/gita"))
3285 (mkdir-p zsh-completion)
3286 (copy-file ".gita-completion.zsh"
3287 (string-append zsh-completion "/_gita"))))))))
3288 (home-page "https://github.com/nosarthur/gita")
3289 (synopsis "Command-line tool to manage multiple Git repos")
3290 (description "This package provides a command-line tool to manage
3291 multiple Git repos.
3292
3293 This tool does two things:
3294 @itemize
3295 @item display the status of multiple Git repos such as branch, modification,
3296 commit message side by side
3297 @item (batch) delegate Git commands/aliases from any working directory
3298 @end itemize
3299
3300 If several repos are related, it helps to see their status together.")
3301 (license license:expat))))
3302
3303 (define-public ghq
3304 (package
3305 (name "ghq")
3306 (version "1.1.7")
3307 (home-page "https://github.com/x-motemen/ghq")
3308 (source (origin
3309 (method git-fetch)
3310 (uri (git-reference
3311 (url home-page)
3312 (commit (string-append "v" version))))
3313 (file-name (git-file-name name version))
3314 (sha256
3315 (base32
3316 "155sfmhmh4ia3iinm1s8fk7fxyn5dxdryad9xkbg7mr3i3ikqjwh"))))
3317 (build-system go-build-system)
3318 (arguments
3319 '(#:install-source? #f
3320 #:import-path "github.com/x-motemen/ghq"
3321 #:phases
3322 (modify-phases %standard-phases
3323 (add-after 'install 'install-completions
3324 (lambda* (#:key outputs import-path #:allow-other-keys)
3325 (let* ((out (assoc-ref outputs "out"))
3326 (bash-completion (string-append out "/etc/bash_completion.d"))
3327 (zsh-completion (string-append out "/share/zsh/site-functions")))
3328 (with-directory-excursion (string-append "src/" import-path)
3329 (mkdir-p bash-completion)
3330 (copy-file "misc/bash/_ghq"
3331 (string-append bash-completion "/ghq"))
3332 (mkdir-p zsh-completion)
3333 (copy-file "misc/zsh/_ghq"
3334 (string-append zsh-completion "/_ghq"))))
3335 #t)))))
3336 (native-inputs
3337 `(("git" ,git-minimal)))
3338 (inputs
3339 `(("github.com/songmu/gitconfig" ,go-github-com-songmu-gitconfig)
3340 ("github.com/mattn/go-isatty" ,go-github-com-mattn-go-isatty)
3341 ("github.com/motemen/go-colorine" ,go-github-com-motemen-go-colorine)
3342 ("github.com/saracen/walker" ,go-github-com-saracen-walker)
3343 ("github.com/urfave/cli/v2" ,go-github-com-urfave-cli-v2)
3344 ("golang.org/x/net/html" ,go-golang-org-x-net-html)
3345 ("golang.org/x/sync/errgroup" ,go-golang.org-x-sync-errgroup)))
3346 (synopsis "Manage remote repository clones")
3347 (description
3348 "@code{ghq} provides a way to organize remote repository clones, like
3349 @code{go get} does. When you clone a remote repository by @code{ghq get}, ghq
3350 makes a directory under a specific root directory (by default @file{~/ghq})
3351 using the remote repository URL's host and path.")
3352 (license license:expat)))
3353
3354 (define-public tkrev
3355 (package
3356 (name "tkrev")
3357 (version "9.4.1")
3358 (source
3359 (origin
3360 (method url-fetch)
3361 (uri (string-append
3362 "mirror://sourceforge/tkcvs/tkrev_" version ".tar.gz"))
3363 (sha256
3364 (base32 "0bpfbhkngzmwy476mfc69mkd94l0m2wxznrn0qzd81s450yxjw2q"))))
3365 (build-system gnu-build-system)
3366 (arguments
3367 `(#:phases
3368 (modify-phases %standard-phases
3369 (delete 'configure)
3370 (delete 'build)
3371 (replace 'install
3372 (lambda* (#:key outputs #:allow-other-keys)
3373 (let* ((out (assoc-ref outputs "out"))
3374 (bin (string-append out "/bin")))
3375 (invoke "wish" "doinstall.tcl" "-nox" out)
3376 (install-file "contrib/tkdirdiff" bin))))
3377 (add-after 'install 'wrap-programs
3378 (lambda* (#:key outputs #:allow-other-keys)
3379 (for-each
3380 (lambda (file)
3381 (wrap-program (string-append (assoc-ref outputs "out")
3382 "/bin/" file)
3383 `("PATH" ":" prefix (,(dirname (which "wish"))))))
3384 '("tkdiff"
3385 "tkdirdiff"
3386 "tkrev")))))
3387 #:tests? #f))
3388 (inputs
3389 (list tk))
3390 (home-page "https://tkcvs.sourceforge.io")
3391 (synopsis "Graphical interface to CVS, Subversion, Git, and RCS")
3392 (description
3393 "TkRev (formerly TkCVS) is a Tcl/Tk-based graphical interface to the CVS,
3394 Subversion and Git configuration management systems. It will also help with
3395 RCS. It shows the status of the files in the current working directory, and
3396 has tools for tagging, merging, checking in/out, and other user operations.
3397 TkDiff is included for browsing and merging your changes.")
3398 (license license:gpl2+)))
3399
3400 (define-public git-filter-repo
3401 (package
3402 (name "git-filter-repo")
3403 (version "2.29.0")
3404 (source
3405 (origin
3406 ;; Use a release tarball instead of 'git-fetch' because it contains
3407 ;; pre-compiled man-pages which are too hard to build in this context
3408 ;; as it depends on Git's Makefile.
3409 (method url-fetch)
3410 (uri (string-append "https://github.com/newren/git-filter-repo/releases/"
3411 "download/v" version
3412 "/git-filter-repo-" version ".tar.xz"))
3413 (sha256
3414 (base32
3415 "00nn7k9jqrybb762486fmigsnbcn9lbvimgpfvvarz4ikdp9y9pb"))))
3416 (build-system copy-build-system)
3417 (arguments
3418 `(#:install-plan
3419 '(("git-filter-repo" "libexec/git-core/")
3420 ("Documentation/man1/" "share/man/man1")
3421 ("/" "" #:include ()))))
3422 (inputs (list python)) ;for the shebang
3423 (home-page "https://github.com/newren/git-filter-repo")
3424 (synopsis "Quickly rewrite Git repository history")
3425 (description
3426 "@command{git filter-repo} is a versatile tool for rewriting history,
3427 which roughly falls into the same space of tool like git filter-branch but
3428 with more capabilities. @command{git filter-repo} is now recommended by the
3429 Git project instead of @command{git filter-branch}.")
3430 (license (list license:expat ;; Main license.
3431 license:gpl2)))) ;; For test harness.
3432
3433 (define-public gitlint
3434 (package
3435 (name "gitlint")
3436 (version "0.17.0")
3437 (source (origin
3438 (method url-fetch)
3439 ;; the gitlint-core pypi package contains the actual gitlint
3440 ;; code; the gitlint package only pulls in gitlint-core with
3441 ;; stricter dependency versioning
3442 (uri (pypi-uri "gitlint-core" version))
3443 (sha256
3444 (base32
3445 "14cn89biys8r7mwcdgllv371k34km9k1941ylxf53a7sxwrzsbbp"))))
3446 (build-system python-build-system)
3447 (arguments
3448 (list
3449 #:phases
3450 #~(modify-phases %standard-phases
3451 (add-before 'build 'loosen-requirements
3452 (lambda* (#:key inputs #:allow-other-keys)
3453 (substitute* "gitlint/shell.py"
3454 (("'git'") (string-append
3455 "'"
3456 (search-input-file inputs "bin/git")
3457 "'"))
3458 ;; force using subprocess instead of sh so git does not need
3459 ;; to be a propagated input
3460 (("if USE_SH_LIB") "if False")))))))
3461 (inputs
3462 (list git python-arrow python-click python-sh))
3463 (home-page "https://jorisroovers.com/gitlint/")
3464 (synopsis "Linting Git commit messages")
3465 (description
3466 "Gitlint is a Git commit message linter written in Python: it checks your
3467 commit messages for style.")
3468 (license license:expat)))
3469
3470 (define-public hut
3471 (package
3472 (name "hut")
3473 (version "0.2.0")
3474 (source
3475 (origin
3476 (method git-fetch)
3477 (uri (git-reference
3478 (url "https://git.sr.ht/~emersion/hut")
3479 (commit (string-append "v" version))))
3480 (file-name (git-file-name name version))
3481 (sha256
3482 (base32 "0ybngrwwmkm00dlkdhvkfcvcjhp5xzs8fh90zqr0h12ssqx9pll3"))))
3483 (build-system go-build-system)
3484 (arguments
3485 (list
3486 #:import-path "git.sr.ht/~emersion/hut"
3487 #:phases
3488 #~(modify-phases %standard-phases
3489 (replace 'build
3490 (lambda* (#:key import-path #:allow-other-keys)
3491 (with-directory-excursion (string-append "src/" import-path)
3492 ;; The flags are copied from (guix build go-build-system).
3493 (setenv "CGO_LDFLAGS" "-s -w")
3494 (invoke "make" "all" "GOFLAGS=-v -x"))))
3495 (replace 'install
3496 (lambda* (#:key import-path #:allow-other-keys)
3497 (with-directory-excursion (string-append "src/" import-path)
3498 (invoke "make" "install"
3499 (string-append "PREFIX=" #$output))))))))
3500 (native-inputs
3501 (list scdoc))
3502 (inputs
3503 (list go-git-sr-ht-emersion-go-scfg
3504 go-git-sr-ht-emersion-gqlclient
3505 go-github-com-juju-ansiterm
3506 go-github-com-spf13-cobra
3507 go-golang-org-x-oauth2
3508 go-golang-org-x-term))
3509 (home-page "https://git.sr.ht/~emersion/hut")
3510 (synopsis "CLI tool for sr.ht")
3511 (description "@command{hut} is a CLI tool for
3512 @uref{https://sr.ht/~sircmpwn/sourcehut/, sr.ht}. It helps you interact with
3513 sr.ht's public services:
3514 @table @asis
3515 @item builds
3516 submit and manage build jobs
3517 @item git
3518 create, and manage git repositories and artifacts
3519 @item hg
3520 list Mercurial repositories
3521 @item lists
3522 manage mailing lists and patches
3523 @item meta
3524 manage PGP, and SSH keys
3525 @item pages
3526 publish and manage hosted websites
3527 @item paste
3528 create and manage pastes
3529 @item todo
3530 create and manage trackers, tickets
3531 @item graphql
3532 interact with GraphQL APIs directly
3533 @end table")
3534 (license license:agpl3)))