gnu: version-control: Add make-gitolite procedure.
[jackhill/guix/guix.git] / gnu / packages / version-control.scm
CommitLineData
dcee3fc5
NK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
cf3fe3b0 3;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4668454f 4;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
fc1e4516 5;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
62063d85 6;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
6c0e2dbb 7;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
f116b476 8;;; Copyright © 2014, 2016, 2019, 2021 Eric Bavier <bavier@posteo.net>
a0c8c8cd 9;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
7cc707b4 10;;; Copyright © 2015, 2018, 2020, 2021, 2022 Kyle Meyer <kyle@kyleam.com>
71382578 11;;; Copyright © 2015, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
8343d373 12;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
3c986a7d 13;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is>
d129d962 14;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <me@tobias.gr>
136968fb 15;;; Copyright © 2017 Vasile Dumitrascu <va511e@yahoo.com>
0ea45ef4 16;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
d6d5a67e 17;;; Copyright © 2017, 2020 EuAndreh <eu@euandre.org>
16701a3c 18;;; Copyright © 2017, 2018, 2020, 2022 Marius Bakke <marius@gnu.org>
205441eb 19;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
dec43e9f 20;;; Copyright © 2017, 2020 Oleg Pykhalov <go.wigust@gmail.com>
0ed7498a 21;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
57c5aa7c 22;;; Copyright © 2018 Christopher Baines <mail@cbaines.net>
a078a6ec 23;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
72816ebe 24;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
66d05055 25;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
a3e6cf98 26;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
bbac3fff 27;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
10576acb 28;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
a45d5a94 29;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
f930814a 30;;; Copyright © 2020 John D. Boy <jboy@bius.moe>
fc179005 31;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
1b778f03 32;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
de3a8ecb 33;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
2c09755a 34;;; Copyright © 2020, 2021 Michael Rohleder <mike@rohleder.de>
8a9bf794 35;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
03f26438 36;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
c53ee79c
LLB
37;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
38;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
d45d779e 39;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
369d0e7f 40;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
cd95cb28 41;;; Copyright © 2021 François J. <francois-oss@avalenn.eu>
5dac09e2 42;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
aa916f34 43;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
b09daf52 44;;; Copyright © 2021 jgart <jgart@dismail.de>
94fbcf7b 45;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
54c8b444 46;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
e764b89a 47;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
c20d684c 48;;; Copyright © 2022 Dhruvin Gandhi <contact@dhruvin.dev>
966118da 49;;; Copyright © 2015, 2022 David Thompson <davet@gnu.org>
dcee3fc5
NK
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
1b1c335f 66(define-module (gnu packages version-control)
369387b6 67 #:use-module ((guix licenses) #:prefix license:)
d1cba090 68 #:use-module (guix utils)
dcee3fc5 69 #:use-module (guix packages)
16701a3c 70 #:use-module (guix gexp)
dcee3fc5 71 #:use-module (guix download)
c7810bd1 72 #:use-module (guix git-download)
de3a8ecb 73 #:use-module (guix hg-download)
541f93ad 74 #:use-module (guix build python-build-system)
086e498b 75 #:use-module (guix build-system cmake)
4cf3734c 76 #:use-module (guix build-system copy)
1b1c335f 77 #:use-module (guix build-system gnu)
a3e6cf98 78 #:use-module (guix build-system go)
dec43e9f 79 #:use-module (guix build-system perl)
dcee3fc5 80 #:use-module (guix build-system python)
c7810bd1 81 #:use-module (guix build-system trivial)
2b24faa2 82 #:use-module (gnu packages apr)
df7393b9 83 #:use-module (gnu packages autotools)
99828fa7 84 #:use-module (gnu packages documentation)
c7810bd1 85 #:use-module (gnu packages base)
24112773 86 #:use-module (gnu packages bash)
0e534e74 87 #:use-module (gnu packages bison)
ca3c1439 88 #:use-module (gnu packages boost)
ea4be20a 89 #:use-module (gnu packages check)
0e534e74 90 #:use-module (gnu packages cook)
d9ff410f 91 #:use-module (gnu packages curl)
59ef2030 92 #:use-module (gnu packages docbook)
740c24df 93 #:use-module (gnu packages ed)
0e534e74
JD
94 #:use-module (gnu packages file)
95 #:use-module (gnu packages flex)
d6d5a67e 96 #:use-module (gnu packages freedesktop)
fc1e4516 97 #:use-module (gnu packages gettext)
ca3c1439 98 #:use-module (gnu packages gl)
c53ee79c
LLB
99 #:use-module (gnu packages glib)
100 #:use-module (gnu packages gnome)
541f93ad 101 #:use-module (gnu packages gnupg)
c7452d23 102 #:use-module (gnu packages golang)
0e534e74 103 #:use-module (gnu packages groff)
03fb5ff6 104 #:use-module (gnu packages guile)
5dac09e2 105 #:use-module (gnu packages guile-xyz)
ca3c1439 106 #:use-module (gnu packages image)
0e534e74 107 #:use-module (gnu packages linux)
add8d509 108 #:use-module (gnu packages mail)
c20d684c 109 #:use-module (gnu packages man)
ca3c1439 110 #:use-module (gnu packages maths)
1972fed4 111 #:use-module (gnu packages nano)
2459141e 112 #:use-module (gnu packages ncurses)
378b01dc 113 #:use-module (gnu packages ssh)
46138f3e 114 #:use-module (gnu packages web)
e8d2168c 115 #:use-module (gnu packages openstack)
ca3c1439 116 #:use-module (gnu packages pcre)
cf3fe3b0 117 #:use-module (gnu packages perl)
5ccde207 118 #:use-module (gnu packages perl-check)
fc1e4516 119 #:use-module (gnu packages pkg-config)
cf3fe3b0 120 #:use-module (gnu packages python)
13bb41f8 121 #:use-module (gnu packages python-build)
830c4df6 122 #:use-module (gnu packages python-check)
f116b476 123 #:use-module (gnu packages python-crypto)
1b2f753d 124 #:use-module (gnu packages python-web)
44d10b1f 125 #:use-module (gnu packages python-xyz)
d0e11e8b 126 #:use-module (gnu packages readline)
a078a6ec 127 #:use-module (gnu packages rsync)
cd0322a3 128 #:use-module (gnu packages sqlite)
5dac09e2 129 #:use-module (gnu packages texinfo)
9de46ffb 130 #:use-module (gnu packages admin)
d9ff410f 131 #:use-module (gnu packages xml)
a4572a17 132 #:use-module (gnu packages emacs)
8b2fe785 133 #:use-module (gnu packages compression)
ca3c1439 134 #:use-module (gnu packages sdl)
ecfb6993 135 #:use-module (gnu packages swig)
623d4b46 136 #:use-module (gnu packages sync)
25f76ef0 137 #:use-module (gnu packages tcl)
71653653 138 #:use-module (gnu packages textutils)
33dc54b0 139 #:use-module (gnu packages time)
cc2b77df 140 #:use-module (gnu packages tls)
58c18069
EB
141 #:use-module (gnu packages)
142 #:use-module (ice-9 match)
966118da
DT
143 #:use-module (srfi srfi-1)
144 #:export (make-gitolite))
dcee3fc5 145
f116b476
EB
146(define-public breezy
147 (package
148 (name "breezy")
d129d962 149 (version "3.2.2")
f116b476
EB
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"))
dc71b4f1
MC
156 (modules '((guix build utils)))
157 ;; Delete pre-generated Cython C files.
158 (snippet '(for-each delete-file (find-files "." "\\pyx.c$")))
f116b476 159 (sha256
dc71b4f1
MC
160 (base32
161 "1md4b6ajawf5h50fqizmjj0g833ihc674dh7fn0mvl4d412nwyhq"))
162 (patches (search-patches "breezy-fix-gio.patch"))))
f116b476 163 (build-system python-build-system)
f116b476 164 (arguments
dc71b4f1
MC
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))
f116b476
EB
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
210default, Breezy provides support for both the
dc71b4f1
MC
211@uref{https://bazaar.canonical.com/, Bazaar} and @uref{https://www.git-scm.com,
212Git} file formats. Breezy is backwabrds compatible with Bazaar's disk format
f116b476
EB
213and protocols. One of the key differences with Bazaar is that Breezy runs on
214Python 3.3 and later, rather than on Python 2.")
215 (license license:gpl2+)))
216
be672f1f
MC
217(define-public bazaar
218 (deprecated-package "bazaar" breezy))
219
6beb6cc6
MO
220(define git-cross-configure-flags
221 '("ac_cv_fread_reads_directories=yes"
fc179005
JN
222 "ac_cv_snprintf_returns_bogus=no"
223 "ac_cv_iconv_omits_bom=no"))
6beb6cc6 224
d9ff410f
AE
225(define-public git
226 (package
227 (name "git")
2cdd60de 228 (version "2.38.0")
d9ff410f
AE
229 (source (origin
230 (method url-fetch)
4d96439d 231 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
ff212a5c 232 version ".tar.xz"))
d9ff410f
AE
233 (sha256
234 (base32
2cdd60de 235 "02ij201lyipv1w2zkcq4ng2bga2xkw58xnkbs1wdw50qdgiasglj"))))
d9ff410f 236 (build-system gnu-build-system)
2a5e15c6
LC
237 (native-inputs
238 `(("native-perl" ,perl)
22236ceb
MB
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)
b94a6ca0 243 ("gettext" ,gettext-minimal)
817f40d0
F
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.
d1cada04
LF
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
2cdd60de 255 "1qyn6rhwblshz0hp0kdc8lk22c1fv8avfr44sia0vzlbd82xj828"))))
13164135 256 ;; For subtree documentation.
c2649f28 257 ("asciidoc" ,asciidoc)
13164135 258 ("docbook-xsl" ,docbook-xsl)
c53ee79c
LLB
259 ("xmlto" ,xmlto)
260 ("pkg-config" ,pkg-config)))
d9ff410f
AE
261 (inputs
262 `(("curl" ,curl)
263 ("expat" ,expat)
d9ff410f
AE
264 ("openssl" ,openssl)
265 ("perl" ,perl)
71382578 266 ("python" ,python) ; for git-p4
ed5f49ff
LC
267 ("zlib" ,zlib)
268
abb6a0e0
PN
269 ;; For PCRE support in git grep (USE_LIBPCRE2).
270 ("pcre" ,pcre2)
271
272 ;; For 'gitweb.cgi'.
3bec8a01
RW
273 ("perl-cgi" ,perl-cgi)
274
ed5f49ff 275 ;; For 'git-svn'.
ecfb6993 276 ("subversion" ,subversion)
b411517a 277 ("perl-term-readkey" ,perl-term-readkey)
ecfb6993 278
abb6a0e0 279 ;; For 'git-send-email'.
58c18069
EB
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
ecfb6993
LC
284 ;; For 'git gui', 'gitk', and 'git citool'.
285 ("tcl" ,tcl)
c53ee79c
LLB
286 ("tk" ,tk)
287
288 ;; For 'git-credential-libsecret'
289 ("glib" ,glib)
290 ("libsecret" ,libsecret)))
ecfb6993 291 (outputs '("out" ; the core
58c18069 292 "send-email" ; for git-send-email
ecfb6993 293 "svn" ; git-svn
145b0693 294 "credential-netrc" ; git-credential-netrc
c53ee79c 295 "credential-libsecret" ; git-credential-libsecret
13164135 296 "subtree" ; git-subtree
ecfb6993 297 "gui")) ; gitk, git gui
d9ff410f 298 (arguments
1a59b6d0
LC
299 `(#:make-flags `("V=1" ;more verbose compilation
300
24112773
MB
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
abb6a0e0
PN
310 "USE_LIBPCRE2=yes"
311
1a59b6d0
LC
312 ;; By default 'make install' creates hard links for
313 ;; things in 'libexec/git-core', which leads to huge
9006f8bc 314 ;; nars; see <https://bugs.gnu.org/21949>.
1a59b6d0 315 "NO_INSTALL_HARDLINKS=indeed")
24112773
MB
316
317 ;; Make sure the full bash does not end up in the final closure.
318 #:disallowed-references (,bash)
319
d9ff410f 320 #:test-target "test"
ecfb6993
LC
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")
6beb6cc6
MO
326 "/bin/wish8.6") ; XXX
327 ,@(if (%current-target-system)
328 git-cross-configure-flags
329 '()))
ecfb6993 330
58c18069 331 #:modules ((srfi srfi-1)
24112773 332 (srfi srfi-26)
c53ee79c 333 ((guix build gnu-build-system) #:prefix gnu:)
58c18069 334 ,@%gnu-build-system-modules)
d9ff410f 335 #:phases
98378db6 336 (modify-phases %standard-phases
fc179005 337 ,@(if (%current-target-system)
457ded48
JN
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"
8a9bf794
MC
345 all)))
346 #t)))
457ded48 347 ;; We do not have bash-for-tests when cross-compiling.
fc179005
JN
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)
8a9bf794
MC
356 ":"))
357 #t)))))
6beb6cc6
MO
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:"
8a9bf794
MC
364 (getenv "PATH")))
365 #t)))
6beb6cc6 366 '())
0fff1495 367 (add-after 'configure 'patch-makefiles
98378db6
LC
368 (lambda _
369 (substitute* "Makefile"
98378db6 370 (("/usr/bin/perl") (which "perl"))
8a9bf794
MC
371 (("/usr/bin/python") (which "python3")))
372 #t))
8601feae
LC
373 (add-after 'configure 'add-PM.stamp
374 (lambda _
375 ;; Add the "PM.stamp" to avoid "no rule to make target".
8a9bf794
MC
376 (call-with-output-file "perl/PM.stamp" (const #t))
377 #t))
13164135
PN
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.
9310ad34 386 (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
13164135
PN
387 (string-append "$(XMLTO) -x "
388 (string-append (assoc-ref inputs "docbook-xsl")
389 "/xml/xsl/docbook-xsl-"
390 ,(package-version docbook-xsl))
9310ad34 391 "/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
13164135
PN
392 (invoke "make")
393 (invoke "make" "install")
394 (invoke "make" "install-doc")
395 (substitute* "git-subtree"
8a9bf794
MC
396 (("/bin/sh") (which "sh"))))
397 #t))
c9f4f56b
MB
398 (add-before 'check 'patch-tests
399 (lambda _
6e0efe8c
Y
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")
c7699ebe 429
6e0efe8c
Y
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"
8a9bf794
MC
435 "t/t9141-git-svn-multiple-branches.sh"))
436 #t)))
98378db6
LC
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"
8a9bf794
MC
444 (string-append completions "/git"))
445 #t)))
145b0693
PN
446 (add-after 'install 'install-credential-netrc
447 (lambda* (#:key outputs #:allow-other-keys)
448 (let* ((netrc (assoc-ref outputs "credential-netrc")))
aae5f89d 449 (install-file "contrib/credential/netrc/git-credential-netrc.perl"
145b0693 450 (string-append netrc "/bin"))
aae5f89d
LF
451 (rename-file (string-append netrc "/bin/git-credential-netrc.perl")
452 (string-append netrc "/bin/git-credential-netrc"))
1cfcb841
PN
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
8a9bf794
MC
459 (,(string-append (assoc-ref outputs "out") "/share/perl5"))))
460 #t)))
c53ee79c
LLB
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"
8a9bf794
MC
467 (string-append libsecret "/bin"))
468 #t))))
13164135
PN
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"
8a9bf794
MC
475 (string-append subtree "/share/man/man1"))
476 #t)))
46ce24fb
MÁAV
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")))
8a9bf794
MC
485 (find-files dir ".*"))
486 #t)))
98378db6 487 (add-after 'install 'split
23c0e743
LC
488 (lambda* (#:key inputs outputs #:allow-other-keys)
489 ;; Split the binaries to the various outputs.
490 (let* ((out (assoc-ref outputs "out"))
58c18069 491 (se (assoc-ref outputs "send-email"))
23c0e743
LC
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"))
58c18069
EB
500 (git-se (string-append out "/libexec/git-core/git-send-email"))
501 (git-se* (string-append se "/libexec/git-core/git-send-email"))
23c0e743
LC
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"))
58c18069 508 (mkdir-p (string-append se "/libexec/git-core"))
23c0e743 509 (mkdir-p (string-append svn "/libexec/git-core"))
ecfb6993 510
23c0e743
LC
511 (for-each (lambda (old new)
512 (copy-file old new)
513 (delete-file old)
514 (chmod new #o555))
58c18069
EB
515 (list gitk git-gui git-cit git-se git-svn)
516 (list gitk* git-gui* git-cit* git-se* git-svn*))
ed5f49ff 517
b411517a 518 ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
23c0e743
LC
519 (wrap-program git-svn*
520 `("PATH" ":" prefix
521 (,(string-append (assoc-ref inputs "subversion")
522 "/bin")))
523 `("PERL5LIB" ":" prefix
b411517a
TD
524 ,(map (lambda (i) (string-append (assoc-ref inputs i)
525 "/lib/perl5/site_perl"))
526 '("subversion" "perl-term-readkey")))
ed5f49ff 527
23c0e743
LC
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"))))
0a5a1db2 533
58c18069
EB
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"))
355e53c4 538 (list
a6d0b306 539 ,@(transitive-input-references
355e53c4 540 'inputs
a6d0b306 541 (map (lambda (l)
adb6462c 542 (assoc l (package-inputs this-package)))
a6d0b306
EB
543 '("perl-authen-sasl"
544 "perl-net-smtp-ssl"
545 "perl-io-socket-ssl")))))))
3bec8a01
RW
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)
adb6462c 555 (assoc l (package-inputs this-package)))
3bec8a01 556 '("perl-cgi")))))))
58c18069 557
23c0e743
LC
558 ;; Tell 'git-submodule' where Perl is.
559 (wrap-program git-sm
560 `("PATH" ":" prefix
561 (,(string-append (assoc-ref inputs "perl")
8a9bf794
MC
562 "/bin"))))
563
564 #t)))
d1cada04
LF
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
ecb67a18 572 (invoke "tar" "xvf" manpages))))))))
da699774
LC
573
574 (native-search-paths
575 ;; For HTTPS access, Git needs a single-file certificate bundle, specified
576 ;; with $GIT_SSL_CAINFO.
da699774
LC
577 (list (search-path-specification
578 (variable "GIT_SSL_CAINFO")
6d461b21 579 (file-type 'regular)
fcd75bdb 580 (separator #f) ;single entry
82de2655
DC
581 (files '("etc/ssl/certs/ca-certificates.crt")))
582 (search-path-specification
583 (variable "GIT_EXEC_PATH")
e3ff8383 584 (separator #f) ;single entry
82de2655 585 (files '("libexec/git-core")))))
da699774 586
d9ff410f
AE
587 (synopsis "Distributed version control system")
588 (description
589 "Git is a free distributed version control system designed to handle
590everything from small to very large projects with speed and efficiency.")
ea042952
BW
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"
987f5acb
EF
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"))))
369387b6 605 (license license:gpl2)
9006f8bc 606 (home-page "https://git-scm.com/")))
d9ff410f 607
c23cf183
LC
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)
c53ee79c 629 (delete 'install-credential-libsecret)
c23cf183
LC
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)))))
abb6a0e0
PN
652 ((#:make-flags flags)
653 `(delete "USE_LIBPCRE2=yes" ,flags))
c23cf183 654 ((#:configure-flags flags)
6beb6cc6
MO
655 `(list
656 ,@(if (%current-target-system)
657 git-cross-configure-flags
658 '())))
c23cf183
LC
659 ((#:disallowed-references lst '())
660 `(,perl ,@lst))))
661 (outputs '("out"))
662 (native-inputs
22236ceb
MB
663 `(("bash" ,bash-minimal)
664 ("bash-for-tests" ,bash)
665 ("native-perl" ,perl)
c23cf183
LC
666 ("gettext" ,gettext-minimal)))
667 (inputs
8394619b
LC
668 (list curl ;for HTTP(S) access
669 expat ;for 'git push' over HTTP(S)
670 openssl
671 perl
672 zlib))))
669d150f
LC
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"))))))
c23cf183 685
369d0e7f
XC
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
8394619b 702 (list perl))
369d0e7f
XC
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
708logs to GNU ChangeLog format.")
709 (license license:gpl2+))))
710
f930814a
TGR
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")))
d42245d4 751 `("GUIX_PYTHONPATH" ":" =
f930814a
TGR
752 (,(string-append out "/lib/python"
753 ,(version-major+minor
754 (package-version python))
755 "/site-packages:")
d42245d4 756 ,(getenv "GUIX_PYTHONPATH"))))
f930814a
TGR
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
769learn and use. It simplifies the common workflow by committing changes to
770tracked files by default and saving any uncommitted changes as part of a branch.
771
772The friendly @command{gl} command-line interface gives feedback and helps you
773figure out what to do next.
774
775Gitless is implemented on top of Git and its commits and repositories are
776indistinguishable from Git's. You (or other contributors) can always fall back
777on @command{git}, and use any regular Git hosting service.")
dec43e9f
OP
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
797to GitHub contributions calendar.")
f930814a
TGR
798 (license license:expat)))
799
086e498b
RW
800(define-public libgit2
801 (package
802 (name "libgit2")
e764b89a 803 (version "1.4.3")
086e498b 804 (source (origin
e0e23164
MC
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))
086e498b
RW
812 (sha256
813 (base32
e764b89a 814 "02x1a4zrzpzjd0yxnsi8njh5hgihc1iy1v4r0fnl8m4ckcgp6x2s"))
e0e23164 815 (modules '((guix build utils)))
e48b5484
LC
816 (snippet
817 '(begin
818 (delete-file-recursively "deps")
819
820 ;; The "refs:revparse::date" test is time-dependent: it
e764b89a
LC
821 ;; assumes "HEAD@{10 years ago}" matches a specific commit.
822 ;; See <https://github.com/libgit2/libgit2/pull/6299>.
e48b5484 823 (substitute* "tests/refs/revparse.c"
e764b89a
LC
824 (("test_object.*10 years ago.*" all)
825 (string-append "// " all "\n")))))))
086e498b 826 (build-system cmake-build-system)
8ecba89b 827 (outputs '("out" "debug"))
086e498b 828 (arguments
bc5ae287 829 `(#:configure-flags
ebb7cf9e
MB
830 (list "-DUSE_NTLMCLIENT=OFF" ;TODO: package this
831 "-DREGEX_BACKEND=pcre2"
27783023 832 "-DUSE_HTTP_PARSER=system"
e764b89a 833 "-DUSE_SSH=ON" ; cmake fails to find libssh if this is missing
bc5ae287
MO
834 ,@(if (%current-target-system)
835 `((string-append
836 "-DPKG_CONFIG_EXECUTABLE="
8da6dfb0
LC
837 (search-input-file
838 %build-inputs
839 (string-append "/bin/" ,(%current-target-system)
840 "-pkg-config"))))
bc5ae287 841 '()))
3d0fbd3c 842 #:phases
086e498b 843 (modify-phases %standard-phases
bc5ae287 844 ;; Run checks more verbosely, unless we are cross-compiling.
086e498b 845 (replace 'check
bc5ae287
MO
846 (lambda* (#:key (tests? #t) #:allow-other-keys)
847 (if tests?
e764b89a 848 (invoke "./libgit2_tests" "-v" "-Q")
bc5ae287
MO
849 ;; Tests may be disabled if cross-compiling.
850 (format #t "Test suite not run.~%")))))))
086e498b 851 (inputs
8394619b 852 (list libssh2 http-parser))
086e498b 853 (native-inputs
8394619b 854 (list pkg-config python))
413f71f3 855 (propagated-inputs
0a7aa692 856 ;; These libraries are in 'Requires.private' in libgit2.pc.
8394619b 857 (list openssl pcre2 zlib))
912b6ab0 858 (home-page "https://libgit2.org/")
086e498b
RW
859 (synopsis "Library providing Git core methods")
860 (description
861 "Libgit2 is a portable, pure C implementation of the Git core methods
862provided as a re-entrant linkable library with a solid API, allowing you to
863write native speed custom Git applications in any language with bindings.")
864 ;; GPLv2 with linking exception
369387b6 865 (license license:gpl2)))
086e498b 866
e764b89a 867(define-public libgit2-1.3
c0e7242a
LC
868 (package
869 (inherit libgit2)
e764b89a
LC
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)
c0e7242a
LC
896 (version "1.1.0")
897 (source (origin
e764b89a
LC
898 (inherit (package-source libgit2-1.3))
899 (file-name #f) ;use the default name
c0e7242a
LC
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"))
e764b89a 907 (patches (search-patches "libgit2-mtime-0.patch"))))))
c0e7242a 908
53ff5495
DC
909(define-public git-crypt
910 (package
911 (name "git-crypt")
57f90b2a 912 (version "0.6.0")
09be6a5f
TGR
913 (source
914 (origin
915 (method git-fetch)
916 (uri (git-reference
b0e7b699 917 (url "https://github.com/AGWA/git-crypt")
09be6a5f
TGR
918 (commit version)))
919 (file-name (git-file-name name version))
920 (sha256
57f90b2a 921 (base32 "1ba5s0fvmd9hhnfhfsjrm40v0qpxfnwc8vmm55m0k4dryzkzx66q"))))
53ff5495
DC
922 (build-system gnu-build-system)
923 (inputs
8394619b 924 (list git openssl))
ddc5e746 925 (native-inputs
8394619b 926 (list docbook-xsl libxslt))
53ff5495
DC
927 (arguments
928 `(#:tests? #f ; No tests.
929 #:phases
930 (modify-phases %standard-phases
931 (delete 'configure)
ddc5e746
BW
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))
53ff5495
DC
941 (replace 'build
942 (lambda _
ddc5e746 943 (invoke "make" "ENABLE_MAN=yes")))
53ff5495
DC
944 (replace 'install
945 (lambda* (#:key outputs #:allow-other-keys)
946 (let ((out (assoc-ref outputs "out")))
56d63f81 947 (invoke "make" "install"
ddc5e746 948 "ENABLE_MAN=yes"
56d63f81 949 (string-append "PREFIX=" out))))))))
ddc5e746 950 (home-page "https://www.agwa.name/projects/git-crypt/")
53ff5495
DC
951 (synopsis "Transparent encryption of files in a git repository")
952 (description "git-crypt enables transparent encryption and decryption of
79990ce3
TGR
953files in a git repository. Files which you choose to protect are encrypted when
954committed, and decrypted when checked out. git-crypt lets you freely share a
955repository containing a mix of public and private content. git-crypt gracefully
53ff5495 956degrades, so developers without the secret key can still clone and commit to a
79990ce3 957repository with encrypted files. This lets you store your secret material (such
53ff5495
DC
958as keys or passwords) in the same repository as your code, without requiring you
959to lock down your entire repository.")
960 (license license:gpl3+)))
961
ed2b7cb2
AM
962(define-public git-remote-gcrypt
963 (package
964 (name "git-remote-gcrypt")
e8ef3b80 965 (version "1.4")
ed2b7cb2
AM
966 (source (origin
967 (method git-fetch)
968 (uri (git-reference
969 (url "https://git.spwhitton.name/git-remote-gcrypt")
970 (commit version)))
e8ef3b80 971 (file-name (git-file-name name version))
ed2b7cb2
AM
972 (sha256
973 (base32
e8ef3b80 974 "1x5ca1fi0hyn5w5mnz230x27bqr8j78adnzmlc7cbhzr13q36y5q"))))
ed2b7cb2
AM
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")
e8ef3b80 984 bindir)))))
ed2b7cb2
AM
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
988repositories encrypted with GnuPG. It works with the standard Git transports,
989including repository hosting services like GitLab.
990
991Remote helper programs are invoked by Git to handle network transport. This
992helper handles @code{gcrypt:} URLs that access a remote repository encrypted
993with GPG, using our custom format.
994
995Supported locations are local, @code{rsync://} and @code{sftp://}, where the
996repository is stored as a set of files, or instead any Git URL where gcrypt
997will store the same representation in a Git repository, bridged over arbitrary
998Git transport.
999
1000The aim is to provide confidential, authenticated Git storage and
1001collaboration using typical untrusted file hosts or services.")
1002 (license license:gpl3+)))
1003
7ad1fee5
SB
1004(define-public cgit
1005 (package
1006 (name "cgit")
ef201cfe 1007 ;; Update the ‘git-source’ input as well.
acf900ee 1008 (version "1.2.3")
7ad1fee5
SB
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
acf900ee 1016 "193d990ym10qlslk0p8mjwp2j6rhqa7fq0y1iff65lvbyv914pss"))))
7ad1fee5
SB
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.
0eb21fba 1027 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
19a3e7f8 1028 (assoc-ref inputs "git-source"))))
91b21ba9
OP
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")))
57c5aa7c
CB
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
91b21ba9 1055 #t))
7ad1fee5
SB
1056 (delete 'configure) ; no configure script
1057 (add-after 'build 'build-man
1058 (lambda* (#:key make-flags #:allow-other-keys)
0eb21fba 1059 (apply invoke "make" "doc-man" make-flags)))
7ad1fee5
SB
1060 (replace 'install
1061 (lambda* (#:key make-flags outputs #:allow-other-keys)
1062 (let ((out (assoc-ref outputs "out")))
0eb21fba
TGR
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)))
57c5aa7c
CB
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)
d42245d4 1079 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))))
57c5aa7c
CB
1080 '("syntax-highlighting.py"
1081 "html-converters/md2html"))
1082 #t)))))
7ad1fee5
SB
1083 (native-inputs
1084 ;; For building manpage.
8394619b 1085 (list asciidoc gzip bzip2 xz))
7ad1fee5 1086 (inputs
19a3e7f8 1087 `(;; Building cgit requires a Git source tree.
5d9c28f1
LF
1088 ("git-source"
1089 ,(origin
1090 (method url-fetch)
ef201cfe
TGR
1091 ;; cgit is tightly bound to git. Use GIT_VER from the Makefile,
1092 ;; which may not match the current (package-version git).
b023a8ac 1093 (uri "mirror://kernel.org/software/scm/git/git-2.25.4.tar.xz")
5d9c28f1 1094 (sha256
b023a8ac 1095 (base32 "11am6s46wmn1yll5614smjhzlghbqq6gysgcs64igjr9y5wzpdxq"))))
7ad1fee5 1096 ("openssl" ,openssl)
57c5aa7c
CB
1097 ("groff" ,groff)
1098 ("python" ,python)
1099 ("python-docutils" ,python-docutils)
1100 ("python-markdown" ,python-markdown)
1101 ("python-pygments" ,python-pygments)
7ad1fee5
SB
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
1107a built-in cache to decrease server I/O pressure.")
369387b6 1108 (license license:gpl2)))
7ad1fee5 1109
add8d509
CB
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")
bc64d955 1133 (search-input-file inputs
c4133c43 1134 "/sbin/sendmail"))))))))
add8d509 1135 (inputs
8394619b 1136 (list git sendmail))
add8d509
CB
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
1141repository. For each reference that was changed, it emits one ReferenceChange
1142email summarizing how the reference was changed, followed by one Revision
1143email for each new commit that was introduced by the reference change.
1144
1145This script is designed to be used as a post-receive hook in a Git
1146repository")
1147 (license license:gpl2)))
1148
65101a25
OP
1149(define-public python-ghp-import
1150 (package
1151 (name "python-ghp-import")
03f26438 1152 (version "2.0.2")
65101a25
OP
1153 (source
1154 (origin
3d78bf0e
TGR
1155 (method git-fetch)
1156 (uri (git-reference
b0e7b699 1157 (url "https://github.com/davisp/ghp-import")
3d78bf0e
TGR
1158 (commit version)))
1159 (file-name (git-file-name name version))
65101a25 1160 (sha256
03f26438 1161 (base32 "0i4lxsgqri1y8sw4k44bkwbzmdmk4vpmdi882mw148j8gk4i7vvj"))))
65101a25
OP
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)))))))
03f26438 1172 (propagated-inputs (list python-dateutil))
65101a25
OP
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
1176default) 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
ea4be20a
MB
1183(define-public python-gitdb
1184 (package
1185 (name "python-gitdb")
cbe4272e 1186 (version "4.0.2")
ea4be20a
MB
1187 (source (origin
1188 (method url-fetch)
cbe4272e 1189 (uri (pypi-uri "gitdb" version))
ea4be20a
MB
1190 (sha256
1191 (base32
cbe4272e 1192 "0l113fphn6msjl3cl3kyf332b6lal7daxdd0nfma0x9ipfb013jr"))))
ea4be20a
MB
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))))
899e1974 1207 (begin
ea4be20a
MB
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
8394619b 1224 (list python-smmap))
ea4be20a 1225 (native-inputs
8394619b 1226 (list git python-nose))
ea4be20a
MB
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
1231writing. It aims at allowing full access to loose objects as well as packs
1232with performance and scalability in mind. It operates exclusively on streams,
1233allowing to handle large objects with a small memory footprint.")
1234 (license license:bsd-3)))
1235
8e617720
MB
1236(define-public python-gitpython
1237 (package
1238 (name "python-gitpython")
b09daf52 1239 (version "3.1.24")
8e617720
MB
1240 (source (origin
1241 (method url-fetch)
1242 (uri (pypi-uri "GitPython" version))
1243 (sha256
1244 (base32
b09daf52 1245 "1rarp97cpjnhi106k2yhb7kygdyflmlgq0icxv3ggzl4wvszv0yz"))))
8e617720
MB
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")
b09daf52 1256 "/bin/git\""))))))))
8e617720 1257 (inputs
8394619b 1258 (list git))
8e617720 1259 (propagated-inputs
8394619b 1260 (list python-gitdb python-typing-extensions))
8e617720 1261 (native-inputs
8394619b 1262 (list python-ddt python-nose))
8e617720
MB
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,
1267high-level like git-porcelain, or low-level like git-plumbing.
1268
1269It provides abstractions of Git objects for easy access of repository data,
1270and additionally allows you to access the Git repository more directly using
1271either a pure Python implementation, or the faster, but more resource intensive
1272@command{git} command implementation.")
1273 (license license:bsd-3)))
1274
c7810bd1
EB
1275(define-public shflags
1276 (package
1277 (name "shflags")
453c0026 1278 (version "1.2.3")
c7810bd1 1279 (source (origin
4aeb7f34
EF
1280 (method git-fetch)
1281 (uri (git-reference
b0e7b699 1282 (url "https://github.com/kward/shflags")
4aeb7f34
EF
1283 (commit (string-append "v" version))))
1284 (file-name (git-file-name name version))
c7810bd1
EB
1285 (sha256
1286 (base32
4aeb7f34 1287 "1ydx0sb6vz9s2dgp5bd64y7fpzh9qvmlfjxrbmzac8saknijrlly"))))
dcb06ac9 1288 (build-system gnu-build-system)
c7810bd1 1289 (arguments
dcb06ac9
TGR
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")))
453c0026 1299 (install-file "shflags" src)
dcb06ac9 1300 #t))))))
b65195c2 1301 (home-page "https://github.com/kward/shflags")
c7810bd1
EB
1302 (synopsis "Command-line flags library for shell scripts")
1303 (description
1304 "Shell Flags (shFlags) is a library written to greatly simplify the
1305handling of command-line flags in Bourne based Unix shell scripts (bash, dash,
1306ksh, sh, zsh). Most shell scripts use getopt for flags processing, but the
1307different versions of getopt on various OSes make writing portable shell
1308scripts difficult. shFlags instead provides an API that doesn't change across
1309shell and OS versions so the script writer can be confident that the script
1310will work.")
369387b6 1311 (license license:lgpl2.1)))
c7810bd1
EB
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.
f6a2a5cc 1318 (version "1.12.3")
c7810bd1
EB
1319 (source (origin
1320 (method git-fetch)
1321 (uri (git-reference
f6a2a5cc
EB
1322 (url "https://github.com/petervanderdoes/gitflow-avh/")
1323 (commit version)))
d36df187 1324 (file-name (git-file-name name version))
c7810bd1
EB
1325 (sha256
1326 (base32
f6a2a5cc 1327 "13q4mnrxr03wz2dkhzy73j384g299m4d545cnhxcaznvdwfany4h"))))
c7810bd1 1328 (build-system gnu-build-system)
8394619b 1329 (inputs (list shflags))
c7810bd1
EB
1330 (arguments
1331 '(#:tests? #f ; no tests
1332 #:make-flags (list (string-append "prefix="
1333 (assoc-ref %outputs "out")))
aac42d78
EF
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))))
8173e7a0 1347 (home-page "https://nvie.com/posts/a-successful-git-branching-model/")
c7810bd1
EB
1348 (synopsis "Git extensions for Vincent Driessen's branching model")
1349 (description
1350 "Vincent Driessen's branching model is a git branching and release
1351management strategy that helps developers keep track of features, hotfixes,
1352and releases in bigger software projects. The git-flow library of git
1353subcommands helps automate some parts of the flow to make working with it a
1354lot easier.")
369387b6 1355 (license license:bsd-2)))
c7810bd1 1356
205441eb
SR
1357(define-public stgit
1358 (package
1359 (name "stgit")
36704803 1360 (version "1.5")
3154ac32
TGR
1361 (source
1362 (origin
1363 (method git-fetch)
1364 (uri (git-reference
b0e7b699 1365 (url "https://github.com/ctmarinas/stgit")
3154ac32
TGR
1366 (commit (string-append "v" version))))
1367 (file-name (git-file-name name version))
1368 (sha256
36704803 1369 (base32 "1igljjpdgl4na1a5hi0nmg36ph0hw6hw8hhq5436fgcl8yjimyz3"))))
205441eb 1370 (build-system python-build-system)
90b8f4e2 1371 (native-inputs
8394619b 1372 (list perl))
205441eb 1373 (inputs
8394619b 1374 (list git))
205441eb 1375 (arguments
90b8f4e2 1376 `(#:phases
205441eb 1377 (modify-phases %standard-phases
90b8f4e2
TGR
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))
205441eb
SR
1393 (replace 'check
1394 (lambda _
90b8f4e2
TGR
1395 (invoke "make"
1396 "PERL_PATH=perl"
1397 (string-append "SHELL_PATH=" (which "bash"))
1398 "test"))))))
d5956a42 1399 (home-page "https://stacked-git.github.io/")
205441eb
SR
1400 (synopsis "Stacked Git")
1401 (description
1402 "StGit is a command-line application that provides functionality similar
1403to Quilt (i.e., pushing/popping patches to/from a stack), but using Git
1404instead of @command{diff} and @command{patch}. StGit stores its patches in a
1405Git repository as normal Git commits, and provides a number of commands to
1406manipulate them in various ways.")
1407 (license license:gpl2)))
1408
80d9941c
SR
1409(define-public vcsh
1410 (package
1411 (name "vcsh")
57c5c8a3 1412 (version "1.20190621-4")
c8c42907
TGR
1413 (source
1414 (origin
1415 (method git-fetch)
1416 (uri (git-reference
b0e7b699 1417 (url "https://github.com/RichiH/vcsh")
c8c42907
TGR
1418 (commit (string-append "v" version))))
1419 (file-name (git-file-name name version))
1420 (sha256
57c5c8a3 1421 (base32 "1gx5nbqyprgy6picns5hxky3lyzkqfq3xhm614f0wcdi58xrsdh0"))))
80d9941c
SR
1422 (build-system gnu-build-system)
1423 (native-inputs
8394619b 1424 (list which))
80d9941c 1425 (inputs
8394619b 1426 (list git perl perl-test-harness perl-shell-command perl-test-most))
80d9941c 1427 (arguments
2c09755a
MR
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"))))))
80d9941c
SR
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,
1447all in one single directory. They all maintain their working trees without
1448clobbering each other or interfering otherwise. By default, all Git
1449repositories maintained via vcsh store the actual files in @code{$HOME},
1450though this can be overridden.")
1451 (license license:gpl2+)))
1452
a63094a7 1453(define-public git-test-sequence
698bd297 1454 (let ((commit "48e5a2f5a13a5f30452647237e23362b459b9c76"))
a63094a7
EB
1455 (package
1456 (name "git-test-sequence")
698bd297 1457 (version (string-append "20140312." (string-take commit 7)))
a63094a7
EB
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)))
348f8c85 1465 (file-name (git-file-name name version))
a63094a7
EB
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"))
96c46210
LC
1478 (install-file (string-append source "/" script)
1479 bindir)
1480 #t))))
de948658 1481 (home-page "https://dustin.sallings.org/2010/03/28/git-test-sequence.html")
a63094a7
EB
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
1485linear. It will test every change between two points in the DAG. It will
1486also walk each side of a merge and test those changes individually.")
369387b6 1487 (license (license:x11-style "file://LICENSE")))))
a63094a7 1488
966118da
DT
1489(define* (make-gitolite #:optional (extra-inputs '()))
1490 "Make a gitolite package object with EXTRA-INPUTS added to the binary
1491wrappers, to be used for optional gitolite extensions."
378b01dc
DT
1492 (package
1493 (name "gitolite")
6319c2f7 1494 (version "3.6.12")
6a8472d1
TGR
1495 (source
1496 (origin
1497 (method git-fetch)
1498 (uri (git-reference
b0e7b699 1499 (url "https://github.com/sitaramc/gitolite")
6a8472d1
TGR
1500 (commit (string-append "v" version))))
1501 (file-name (git-file-name name version))
1502 (sha256
6319c2f7 1503 (base32 "05xw1pmagvkrbzga5pgl3xk9qyc6b5x73f842454f3w9ijspa8zy"))))
378b01dc
DT
1504 (build-system gnu-build-system)
1505 (arguments
a503d0ba
DT
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
966118da
DT
1583 #$git
1584 #$@extra-inputs)))))
a503d0ba 1585 '("/bin/gitolite" "/bin/gitolite-shell")))))))
378b01dc 1586 (inputs
966118da
DT
1587 (append (list bash-minimal coreutils findutils git inetutils openssh perl)
1588 extra-inputs))
fdfe65b7 1589 (home-page "https://gitolite.com")
378b01dc
DT
1590 (synopsis "Git access control layer")
1591 (description
1592 "Gitolite is an access control layer on top of Git, providing fine access
1593control to Git repositories.")
369387b6 1594 (license license:gpl2)))
378b01dc 1595
966118da
DT
1596(define-public gitolite (make-gitolite))
1597
5dac09e2
JL
1598(define-public gitile
1599 (package
1600 (name "gitile")
5bae870e 1601 (version "0.1.4")
5dac09e2
JL
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
5bae870e 1610 (base32 "1wb1rajcrzdqjncv40s7hjsnvlh1gq4z9pn9gf210g1iy35vimmz"))))
5dac09e2
JL
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
8394619b 1649 (list autoconf automake guile-3.0 pkg-config))
5dac09e2 1650 (inputs
8394619b
LC
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))
5dac09e2
JL
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
1661visualize your public Git repositories on a web interface.")
1662 (license license:agpl3+)))
1663
581b37c8
VM
1664(define-public pre-commit
1665 (package
1666 (name "pre-commit")
887a5fd5 1667 (version "2.20.0")
581b37c8
VM
1668 (source
1669 (origin
258150fd 1670 (method git-fetch) ; no tests in PyPI release
581b37c8
VM
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
887a5fd5 1676 (base32 "19jcg6nfnscp87h4wmbpw6r3lc8c75zkvb6wqgavq5dh7wkyg6pq"))))
581b37c8
VM
1677 (build-system python-build-system)
1678 (arguments
1679 `(#:phases
1680 (modify-phases %standard-phases
7fb73841 1681 (add-before 'check 'prepare-check-env
581b37c8
VM
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")
7fb73841
VM
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")
581b37c8 1695 (invoke "git" "config" "--global" "user.name" "Your Name")
a2bcf643 1696 (invoke "git" "config" "--global" "user.email" "you@example.com")))
581b37c8 1697 (replace 'check
335f7668 1698 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
581b37c8 1699 (add-installed-pythonpath inputs outputs)
335f7668
VM
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"
1d5d115e 1709 "-k"
335f7668
VM
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"
1d5d115e 1715 " and not test_installed_from_venv"
27cc25e1 1716 " and not test_healthy_venv_creator"))))))))
581b37c8 1717 (native-inputs
a968f2ea 1718 `(("git" ,git-minimal)
7fb73841
VM
1719 ("python-covdefaults" ,python-covdefaults)
1720 ("python-coverage" ,python-coverage)
1d5d115e 1721 ("python-distlib" ,python-distlib)
830c4df6 1722 ("python-pytest" ,python-pytest)
7fb73841
VM
1723 ("python-pytest-env" ,python-pytest-env)
1724 ("python-re-assert" ,python-re-assert)
1725 ("which" ,which)))
830c4df6
VM
1726 ;; Propagate because pre-commit is also used as a module.
1727 (propagated-inputs
8394619b
LC
1728 (list python-cfgv
1729 python-identify
1730 python-nodeenv
1731 python-pyyaml
1732 python-toml
1733 python-virtualenv))
581b37c8 1734 (home-page "https://pre-commit.com/")
a2bcf643 1735 (synopsis "Framework for managing and maintaining pre-commit hooks")
581b37c8
VM
1736 (description
1737 "Pre-commit is a multi-language package manager for pre-commit hooks. You
1738specify a list of hooks you want and pre-commit manages the installation and
1739execution of any hook written in any language before every commit.")
1740 (license license:expat)))
1741
5151c2e1
AB
1742(define-public mercurial
1743 (package
1744 (name "mercurial")
e916bc67 1745 (version "6.2.2")
5151c2e1
AB
1746 (source (origin
1747 (method url-fetch)
5575917d
EF
1748 (uri (string-append "https://www.mercurial-scm.org/"
1749 "release/mercurial-" version ".tar.gz"))
997a51be
MB
1750 (patches (search-patches "mercurial-hg-extension-path.patch"
1751 "mercurial-openssl-compat.patch"))
5151c2e1
AB
1752 (sha256
1753 (base32
e916bc67 1754 "1pr00hdk3l9095fhq6302fgj0wmbqhqs93y4r457ba4pyjjrvyly"))
003fdf0a
MB
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")))))
bdb6ff3a 1762 (build-system gnu-build-system)
5151c2e1 1763 (arguments
bdb6ff3a
XC
1764 `(#:make-flags
1765 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
1766 #:phases
10576acb 1767 (modify-phases %standard-phases
bdb6ff3a 1768 (delete 'configure)
944e3502
MB
1769 (add-after 'unpack 'patch-tests
1770 (lambda _
997a51be 1771 (substitute* (find-files "tests" "\\.(t|py)$")
944e3502 1772 (("/bin/sh")
997a51be
MB
1773 (which "sh"))
1774 (("/usr/bin/env")
1775 (which "env")))))
10576acb 1776 (replace 'check
e2e62bf5
TGR
1777 (lambda* (#:key tests? #:allow-other-keys)
1778 (with-directory-excursion "tests"
1779 ;; The following tests are known to fail.
944e3502
MB
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!)?
e2e62bf5 1784 "test-hghave.t"
944e3502 1785
997a51be
MB
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
af3b67a2
MC
1792 ;; These tests fail because the program is not
1793 ;; connected to a TTY in the build container.
944e3502 1794 "test-nointerrupt.t"
af3b67a2 1795 "test-transaction-rollback-on-sigpipe.t"
944e3502 1796
eb15d381
DAB
1797 ;; FIXME: This gets killed but does not receive an interrupt.
1798 "test-commandserver.t"
1799
997a51be
MB
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
eb15d381
DAB
1809 ;; Only works when run in a hg-repo, not in an
1810 ;; extracted tarball
1811 "test-doctest.py"
1812
944e3502
MB
1813 ;; TODO: the fqaddr() call fails in the build
1814 ;; container, causing these server tests to fail.
e2e62bf5
TGR
1815 "test-hgwebdir.t"
1816 "test-http-branchmap.t"
e2e62bf5
TGR
1817 "test-pull-bundle.t"
1818 "test-push-http.t"
e2e62bf5
TGR
1819 "test-serve.t"
1820 "test-subrepo-deep-nested-change.t"
944e3502 1821 "test-subrepo-recursion.t"))
e2e62bf5
TGR
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)))
03d76f8a
TGR
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"
e2e62bf5
TGR
1831 ;; The test suite takes a long time and produces little
1832 ;; output by default. Prevent timeouts due to silence.
af3b67a2 1833 "-v"))))))))
10576acb 1834 (native-inputs
8394619b
LC
1835 (list python-docutils
1836 ;; The following inputs are only needed to run the tests.
1837 python-nose unzip which))
bdb6ff3a 1838 (inputs
997a51be 1839 (list python-wrapper))
ae0882bb
XC
1840 ;; Find third-party extensions.
1841 (native-search-paths
1842 (list (search-path-specification
1843 (variable "HGEXTENSIONPATH")
e5d93c87 1844 (files '("lib/python3.9/site-packages/hgext3rd")))))
5575917d 1845 (home-page "https://www.mercurial-scm.org/")
5151c2e1
AB
1846 (synopsis "Decentralized version control system")
1847 (description
bdb6ff3a
XC
1848 "Mercurial is a free, distributed source control management tool. It
1849efficiently handles projects of any size and offers an easy and intuitive
1850interface.")
369387b6 1851 (license license:gpl2+)))
5151c2e1 1852
de3a8ecb
TLC
1853(define-public python-hg-evolve
1854 (package
1855 (name "python-hg-evolve")
272e9ffd 1856 (version "10.3.2")
de3a8ecb
TLC
1857 (source
1858 (origin
1859 (method hg-fetch)
1860 (uri (hg-reference
1861 (url "https://www.mercurial-scm.org/repo/evolve")
1862 (changeset version)))
272e9ffd 1863 (file-name (hg-file-name name version))
de3a8ecb
TLC
1864 (sha256
1865 (base32
272e9ffd 1866 "0qgk39s5pwxbshfa6x1f1ccxahja3fs265dddxy6q99spy3b3x5h"))))
de3a8ecb
TLC
1867 (build-system python-build-system)
1868 (arguments
1869 ;; Tests need mercurial source code.
1870 '(#:tests? #f))
1871 (propagated-inputs
8394619b 1872 (list mercurial))
de3a8ecb
TLC
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
1876history. It implements the changeset evolution concept for Mercurial.")
1877 (license license:gpl2)))
1878
541f93ad
XC
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)
bc64d955
LC
1915 (let ((gpg (search-input-file inputs "/bin/gpg"))
1916 (openssl (search-input-file inputs "/bin/openssl")))
541f93ad
XC
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
8394619b 1926 (list python))
541f93ad 1927 (inputs
8394619b 1928 (list gnupg openssl))
541f93ad
XC
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
1932the changeset hash of commits. The signure is embedded directly in the
1933changeset itself; there won't be any extra commits. Either GnuPG or OpenSSL
1934can be used for signing.")
1935 (license license:gpl2)))) ;per commitsigs.py
1936
fc1e4516
AE
1937(define-public neon
1938 (package
1939 (name "neon")
54c8b444 1940 (version "0.32.2")
fc1e4516
AE
1941 (source (origin
1942 (method url-fetch)
68bee13a 1943 (uri (string-append "https://notroj.github.io/neon/neon-"
fc1e4516
AE
1944 version ".tar.gz"))
1945 (sha256
1946 (base32
54c8b444 1947 "11mj5zpp317dmds874wfwcpgij9i3scaahdi1xfzr5b2ii36crcq"))))
fc1e4516
AE
1948 (build-system gnu-build-system)
1949 (native-inputs
8394619b 1950 (list perl pkg-config))
fc1e4516 1951 (inputs
8394619b 1952 (list libxml2 openssl zlib))
fc1e4516
AE
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"
66c352a1 1958 "--disable-static"
fc1e4516
AE
1959 ;; requires libgnutils-config, deprecated
1960 ;; in gnutls 2.8.
1961 ; "--with-ssl=gnutls")))
1962 "--with-ssl=openssl")))
68bee13a 1963 (home-page "https://notroj.github.io/neon/")
fc1e4516 1964 (synopsis "HTTP and WebDAV client library")
35ad6b2e
TGR
1965 (description
1966 "Neon is an HTTP and WebDAV client library, with a C interface and the
1967following 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")
369387b6 1984 (license license:gpl2+))) ; for documentation and tests; source under lgpl2.0+
fc1e4516 1985
cf3fe3b0
CR
1986(define-public subversion
1987 (package
1988 (name "subversion")
27a5360a 1989 (version "1.14.1")
cf3fe3b0
CR
1990 (source (origin
1991 (method url-fetch)
4908ba05 1992 (uri (string-append "mirror://apache/subversion/"
3d79fd59 1993 "subversion-" version ".tar.bz2"))
cf3fe3b0
CR
1994 (sha256
1995 (base32
27a5360a 1996 "1ag1hvcm9q92kgalzbbgcsq9clxnzmbj9nciz9lmabjx4lyajp9c"))))
cf3fe3b0 1997 (build-system gnu-build-system)
8b2fe785 1998 (arguments
cd820bf7
CB
1999 '(#:parallel-tests? #f ; TODO Seems to cause test failures on
2000 ; i686-linux
fa9f5df7 2001 #:configure-flags '("--enable-static=no")
cd820bf7 2002 #:phases
7c5a1454
EF
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"
491f2918
EF
2013 (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls")))
2014 #t)))
71653653
LF
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))
59796dfd 2020 (add-before 'check 'set-PARALLEL
cd820bf7
CB
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"))
59796dfd 2025 #t))
7c5a1454
EF
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")))
6d0f2612
MW
2030 (invoke "make" "swig-pl-lib")
2031 ;; FIXME: Test failures.
2032 ;; (invoke "make" "check-swig-pl")
2033 (invoke "make" "install-swig-pl-lib")
7c5a1454 2034
6d0f2612
MW
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")))))))))
8b2fe785 2045 (native-inputs
8394619b
LC
2046 (list pkg-config
2047 ;; For the Perl bindings.
2048 swig))
cf3fe3b0 2049 (inputs
2b24faa2
AE
2050 `(("apr" ,apr)
2051 ("apr-util" ,apr-util)
71653653 2052 ("lz4" ,lz4)
46138f3e 2053 ("serf" ,serf)
cf3fe3b0 2054 ("perl" ,perl)
71653653 2055 ("python" ,python-wrapper)
cf3fe3b0 2056 ("sqlite" ,sqlite)
71653653 2057 ("utf8proc" ,utf8proc)
cf3fe3b0 2058 ("zlib" ,zlib)))
ce84c924 2059 (home-page "https://subversion.apache.org/")
35b9e423 2060 (synopsis "Revision control system")
cf3fe3b0 2061 (description
36a4366d 2062 "@dfn{Subversion} (svn) exists to be recognized and adopted as a
749b90a5 2063centralized version control system characterized by its
cf3fe3b0
CR
2064reliability as a safe haven for valuable data; the simplicity of its model and
2065usage; and its ability to support the needs of a wide variety of users and
2066projects, from individuals to large-scale enterprise operations.")
369387b6 2067 (license license:asl2.0)))
cf3fe3b0 2068
1b1c335f
LC
2069(define-public rcs
2070 (package
2071 (name "rcs")
84ca88e7 2072 (version "5.10.1")
1b1c335f
LC
2073 (source (origin
2074 (method url-fetch)
2075 (uri (string-append "mirror://gnu/rcs/rcs-"
84ca88e7 2076 version ".tar.lz"))
1b1c335f
LC
2077 (sha256
2078 (base32
84ca88e7 2079 "1iac4d1dhsfy5zb0n3p605pihdq702v06r4g8vi8b2saf88gxpa3"))))
1b1c335f 2080 (build-system gnu-build-system)
b737607c
FCW
2081 (arguments `(#:phases
2082 (modify-phases %standard-phases
2083 (add-after 'install 'install-rcsfreeze
2084 (lambda* (#:key outputs #:allow-other-keys)
442b2d9d
FCW
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)))))))
84ca88e7 2091 (native-inputs (list ed lzip))
6fd52309 2092 (home-page "https://www.gnu.org/software/rcs/")
1b1c335f
LC
2093 (synopsis "Per-file local revision control system")
2094 (description
79c311b8
LC
2095 "RCS is the original Revision Control System. It works on a
2096file-by-file basis, in contrast to subsequent version control systems such as
2097CVS, Subversion, and Git. This can make it suitable for system
2098administration files, for example, which are often inherently local to one
2099machine.")
369387b6 2100 (license license:gpl3+)))
1972fed4 2101
94fbcf7b
FCW
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
2119annotated RCS file describes the revision and date in which each line was
2120added to the file, and the author of each line.")
2121 (license license:gpl2+)))
2122
c9930b1f
FCW
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
2140set of RCS files including log messages and patches. It can also display the
2141patch associated with a particular revision of an RCS file.")
2142 (license (list license:bsd-2
2143 license:bsd-3)))) ; bsd_queue.h
2144
1972fed4
LC
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
9006f8bc 2152 "https://ftp.gnu.org/non-gnu/cvs/source/feature/"
1972fed4 2153 version "/cvs-" version ".tar.bz2"))
bba3c489 2154 (patches (search-patches "cvs-CVE-2017-12836.patch"))
1972fed4
LC
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.
7fbbd3e7
EF
2161 '(#:tests? #f
2162 #:configure-flags (list "--with-external-zlib")))
8394619b 2163 (inputs (list zlib nano)) ; the default editor
1972fed4
LC
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
2168Configuration Management (SCM). Using it, you can record the history of
2169sources files, and documents. It fills a similar role to the free software
2170RCS, PRCS, and Aegis packages.")
369387b6 2171 (license license:gpl1+)))
a4572a17 2172
59ef2030
ML
2173(define-public cvs-fast-export
2174 (package
2175 (name "cvs-fast-export")
f87d377a 2176 (version "1.56")
59ef2030
ML
2177 (source (origin
2178 (method url-fetch)
cfc92cd7
TGR
2179 (uri (string-append "http://www.catb.org/~esr/cvs-fast-export/"
2180 "cvs-fast-export-" version ".tar.gz"))
59ef2030
ML
2181 (sha256
2182 (base32
f87d377a 2183 "058bzp3npng48ascls943m16kgvrl0h197a10brf7mvx8zpfc7sc"))))
59ef2030
ML
2184 (build-system gnu-build-system)
2185 (arguments
d2885c83
EF
2186 '(#:phases
2187 (modify-phases %standard-phases
d462bf0e
TGR
2188 (delete 'configure)) ; no configure script
2189 #:parallel-build? #f ; parallel a2x commands fail spectacularly
59ef2030
ML
2190 #:make-flags
2191 (list "CC=gcc" (string-append "prefix?=" (assoc-ref %outputs "out")))))
a894ca32
TGR
2192 (inputs
2193 `(("git" ,git)
2194 ("python" ,python-wrapper)))
2195 (native-inputs
8394619b
LC
2196 (list asciidoc
2197 ;; These are needed for the tests.
2198 cvs rcs))
59ef2030
ML
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
2202repository (or outside of one) and, when possible, emits an equivalent history
2203in the form of a fast-import stream. Not all possible histories can be
2204rendered this way; the program tries to emit useful warnings when it can't.
2205
2206The program can also produce a visualization of the resulting commit directed
2207acyclic graph (DAG) in the input format of @uref{http://www.graphviz.org,
2208Graphviz}. The package also includes @command{cvssync}, a tool for mirroring
2209masters from remote CVS hosts.")
369387b6 2210 (license license:gpl2+)))
59ef2030 2211
a4572a17
LC
2212(define-public vc-dwim
2213 (package
2214 (name "vc-dwim")
d512990d 2215 (version "1.10")
a4572a17
LC
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
d512990d 2222 "0am6axxdvkm2vwgg0gjrd930yv4dlsdbf0rdv0zh5bhy1ir64rph"))))
a4572a17 2223 (build-system gnu-build-system)
8394619b 2224 (inputs (list perl))
b2211976 2225 (native-inputs
e3196755
LC
2226 (list emacs-minimal ; for `ctags'
2227 inetutils)) ; for `hostname', used in the tests
f968f1a7 2228 (home-page "https://www.gnu.org/software/vc-dwim/")
a4572a17
LC
2229 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
2230 (description
a22dc0c4
LC
2231 "The vc-dwim package contains two tools, \"vc-dwim\" and \"vc-chlog\".
2232vc-dwim is a tool that simplifies the task of maintaining a ChangeLog and
2233using version control at the same time, for example by printing a reminder
2234when a file change has been described in the ChangeLog but the file has not
79c311b8 2235been added to the VC. vc-chlog scans changed files and generates
a22dc0c4 2236standards-compliant ChangeLog entries based on the changes that it detects.")
369387b6 2237 (license license:gpl3+)))
83a39ed7
LC
2238
2239(define-public diffstat
2240 (package
2241 (name "diffstat")
00275eac 2242 (version "1.64")
83a39ed7
LC
2243 (source (origin
2244 (method url-fetch)
86bc52f9
TGR
2245 (uri
2246 (list
2247 (string-append "ftp://invisible-island.net/diffstat/"
17e5b488 2248 "diffstat-" version ".tgz")
86bc52f9 2249 (string-append "http://invisible-mirror.net/archives/diffstat/"
17e5b488 2250 "diffstat-" version ".tgz")))
83a39ed7
LC
2251 (sha256
2252 (base32
00275eac 2253 "1z7pwcv48fjnhxrjcsjdy83x8b9ckl582mbbds90a79fkn6y7bmq"))))
83a39ed7 2254 (build-system gnu-build-system)
432fd269 2255 (home-page "https://invisible-island.net/diffstat/")
0aea268a 2256 (synopsis "Make histograms from the output of @command{diff}")
83a39ed7 2257 (description
0aea268a
TGR
2258 "Diffstat reads the output of @command{diff} and displays a histogram of
2259the insertions, deletions, and modifications per file. It is useful for
2260reviewing large, complex patch files.")
369387b6 2261 (license (license:x11-style "file://COPYING"))))
25f76ef0 2262
25f76ef0
JD
2263(define-public cssc
2264 (package
2265 (name "cssc")
f9f7e28b 2266 (version "1.4.1")
25f76ef0
JD
2267 (source (origin
2268 (method url-fetch)
2269 (uri (string-append "mirror://gnu/" name "/CSSC-"
2270 version ".tar.gz"))
2271 (sha256
2272 (base32
f9f7e28b 2273 "1vsisqq573xjr2qpn19iwmpqgl3mq03m790akpa4rvj60b4d1gni"))))
25f76ef0
JD
2274 (build-system gnu-build-system)
2275 (arguments
bf3c57ff
EF
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 ") ""))))))))
25f76ef0 2293 ;; These are needed for the tests
8394619b 2294 (native-inputs (list git cvs))
6fd52309 2295 (home-page "https://www.gnu.org/software/cssc/")
25f76ef0
JD
2296 (synopsis "File-based version control like SCCS")
2297 (description "GNU CSSC provides a replacement for the legacy Unix source
2298code control system SCCS. This allows old code still under that system to be
2299accessed and migrated on modern systems.")
369387b6 2300 (license license:gpl3+)))
0e534e74 2301
e881752c 2302;; This package can unfortunately work only in -TEST mode, since Aegis
0e534e74
JD
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)
de67e922
LF
2310 (uri (string-append "mirror://sourceforge/aegis/aegis/" version
2311 "/aegis-" version ".tar.gz"))
0e534e74
JD
2312 (sha256
2313 (base32
2314 "18s86ssarfmc4l17gbpzybca29m5wa37cbaimdji8czlcry3mcjl"))
fc1adab1
AK
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"))))
0e534e74
JD
2320 (build-system gnu-build-system)
2321 (inputs
2322 `(("e2fsprogs" ,e2fsprogs)
2323 ("curl" ,curl)
0253ab39 2324 ("file" ,file)
0e534e74
JD
2325 ("libxml2" ,libxml2)
2326 ("zlib" ,zlib)
b94a6ca0 2327 ("gettext" ,gettext-minimal)))
0e534e74 2328 (native-inputs
8394619b
LC
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))
0e534e74 2339 (arguments
e881752c 2340 `(#:configure-flags (list "--with-no-aegis-configured"
8c1d7c85
JM
2341 "--sharedstatedir=/var/com/aegis"
2342 ;; Uses the old 'throw()' specifier with 'new'
2343 ;; which changed in C++11.
2344 "CXXFLAGS=-std=c++03")
0e534e74 2345 #:parallel-build? #f ; There are some nasty racy rules in the Makefile.
e881752c 2346 #:phases
8ef843c7
EF
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")))
923e2d24
TGR
2364 (setenv "SH" (which "sh"))
2365 #t))
8ef843c7
EF
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
923e2d24 2373 ;; This test assumes that flex has been symlinked to "lex".
8ef843c7
EF
2374 (substitute* "test/00/t0011a.sh"
2375 (("type lex") "type flex"))
2376
0b6be05e
TGR
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
8ef843c7 2385 ;; The author decided to call the check rule "sure".
923e2d24 2386 (invoke "make" "sure")))))))
812dad08 2387 (home-page "https://sourceforge.net/projects/aegis/")
0e534e74
JD
2388 (synopsis "Project change supervisor")
2389 (description "Aegis is a project change supervisor, and performs some of
35b9e423 2390the Software Configuration Management needed in a CASE environment. Aegis
0e534e74
JD
2391provides a framework within which a team of developers may work on many
2392changes to a program independently, and Aegis coordinates integrating these
2393changes back into the master source of the program, with as little disruption
35b9e423 2394as possible. Resolution of contention for source files, a major headache for
0e534e74 2395any project with more than one developer, is one of Aegis's major functions.")
369387b6 2396 (license license:gpl3+)))
2459141e 2397
62063d85
ML
2398(define-public reposurgeon
2399 (package
2400 (name "reposurgeon")
218b94f3 2401 (version "3.43")
62063d85
ML
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
218b94f3
TGR
2408 "1af0z14wcm4bk5a9ysinbwq2fp3lf5f7i8mvwh7286hr3fnagcaz"))
2409 (patches (search-patches
2410 "reposurgeon-add-missing-docbook-files.patch"))))
62063d85
ML
2411 (build-system gnu-build-system)
2412 (arguments
33ecc7a4
TGR
2413 `(#:make-flags
2414 (list "ECHO=echo"
2415 (string-append "target=" (assoc-ref %outputs "out")))
62063d85
ML
2416 #:phases
2417 (modify-phases %standard-phases
218b94f3
TGR
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")))
33ecc7a4
TGR
2424 (substitute* "test/svn-to-svn"
2425 (("/bin/echo") "echo"))
218b94f3 2426 #t)))
33ecc7a4 2427 (delete 'configure) ; no configure script
62063d85
ML
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))
33ecc7a4
TGR
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)))
62063d85
ML
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")
443c432e
TGR
2444 "/share/emacs/site-lisp"))
2445 #t)))))
62063d85 2446 (inputs
218b94f3
TGR
2447 `(("python" ,python-wrapper)
2448 ("tzdata" ,tzdata)))
62063d85 2449 (native-inputs
8394619b
LC
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))
62063d85
ML
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
2464systems don't want to let you do, such as editing past comments and metadata
2465and removing commits. It works with any version control system that can
2466export and import Git fast-import streams, including Git, Mercurial, Fossil,
2467Bazaar, CVS, RCS, and Src. It can also read Subversion dump files directly
2468and can thus be used to script production of very high-quality conversions
2469from 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.
369387b6 2472 (license (list license:bsd-2 license:bsd-3))))
62063d85 2473
2459141e
2474(define-public tig
2475 (package
2476 (name "tig")
9583cbf2 2477 (version "2.5.7")
2459141e
2478 (source (origin
2479 (method url-fetch)
2480 (uri (string-append
73f71bc9
EF
2481 "https://github.com/jonas/tig/releases/download/tig-"
2482 version "/tig-" version ".tar.gz"))
2459141e
2483 (sha256
2484 (base32
9583cbf2 2485 "0xna55y1r1jssdmrzpinv96p7w00w9hn39q5l3d8l299dg4bmiyv"))
548b7b18
EF
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$"))))))
2459141e 2491 (build-system gnu-build-system)
2203e4c2 2492 (native-inputs
8394619b 2493 (list asciidoc xmlto))
2459141e 2494 (inputs
8394619b 2495 (list ncurses readline))
2459141e 2496 (arguments
2203e4c2
EF
2497 `(#:phases
2498 (modify-phases %standard-phases
2499 (add-after 'install 'install-doc
2500 (lambda _
4ca19e88
EF
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"))))))
b10bf8e3
TGR
2512 #:test-target "test"
2513 #:tests? #f)) ; tests require access to /dev/tty
73f71bc9 2514 (home-page "https://jonas.github.io/tig/")
2459141e
2515 (synopsis "Ncurses-based text user interface for Git")
2516 (description
2517 "Tig is an ncurses text user interface for Git, primarily intended as
2518a history browser. It can also stage hunks for commit, or colorize the
5416e40f 2519output of the @code{git} command.")
369387b6 2520 (license license:gpl2+)))
df7393b9
LC
2521
2522(define-public findnewest
2523 (package
2524 (name "findnewest")
9c7e7ead 2525 (version "0.3")
395ee951
TGR
2526 (source
2527 (origin
2528 (method git-fetch)
2529 (uri (git-reference
b0e7b699 2530 (url "https://github.com/0-wiz-0/findnewest")
395ee951
TGR
2531 (commit (string-append "findnewest-" version))))
2532 (file-name (git-file-name name version))
2533 (sha256
2534 (base32 "1x1cbn2b27h5r0ah5xc06fkalfdci2ngrgd4wibxjw0h88h0nvgq"))))
df7393b9 2535 (build-system gnu-build-system)
8394619b 2536 (native-inputs (list autoconf automake))
df7393b9
LC
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
2541modification time.")
369387b6 2542 (license license:bsd-2)))
e92b8599
KM
2543
2544(define-public myrepos
2545 (package
2546 (name "myrepos")
c16913d3 2547 (version "1.20180726")
e92b8599
KM
2548 (source
2549 (origin
d46e9fcb
EF
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"))
e92b8599 2555 (sha256
c16913d3 2556 (base32 "0jphw61plm8cgklja6hs639xhdvxgvjwbr6jpvjwpp7hc5gmhms5"))))
e92b8599 2557 (build-system gnu-build-system)
e92b8599 2558 (arguments
d46e9fcb 2559 '(#:test-target "test"
30012b74
EF
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
8394619b
LC
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))
d46e9fcb 2584 (home-page "https://myrepos.branchable.com/")
e92b8599
KM
2585 (synopsis "Multiple repository management tool")
2586 (description
2587 "Myrepos provides the @code{mr} command, which maps an operation (e.g.,
2588fetching updates) over a collection of version control repositories. It
2589supports a large number of version control systems: Git, Subversion,
2590Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
369387b6 2591 (license license:gpl2+)))
e8d2168c 2592
ee4f9c2c
KM
2593(define-public grokmirror
2594 (package
2595 (name "grokmirror")
885c46a7 2596 (version "2.0.11")
ee4f9c2c
KM
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
885c46a7 2606 (base32 "0c6nnfzzyl247r1dcjnsyx16d34nyra9ikjjhi0xzlrbiwnb0w32"))))
ee4f9c2c
KM
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))
885c46a7 2618 (find-files "." "\\.1$"))))))))
ee4f9c2c 2619 (propagated-inputs
8394619b 2620 (list python-packaging python-requests))
ee4f9c2c
KM
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
2625collections efficiently. Mirrors decide to clone and update repositories
2626based on a manifest file published by servers.")
2627 (license license:gpl3+)))
2628
7cc707b4
KM
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
2646of patches sent via mail. It does so by adapting the DKIM email signature
2647standard to include cryptographic signatures via the X-Developer-Signature
2648email header.")
2649 (license license:expat-0)))
2650
3b77ba78
KM
2651(define-public b4
2652 (package
2653 (name "b4")
0780164f 2654 (version "0.8.0")
3b77ba78
KM
2655 (source
2656 (origin
5cac753d
KM
2657 (method url-fetch)
2658 (uri (pypi-uri "b4" version))
3b77ba78 2659 (sha256
c7b62565 2660 (base32 "115ysciq15sxc8fd9hf7p0f4wnd5xapcfkmq8g33y1c8nbdxclbx"))))
3b77ba78 2661 (build-system python-build-system)
16701a3c
MB
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))))
3b77ba78 2670 (inputs
8394619b 2671 (list python-dkimpy python-dnspython python-requests))
ca53f7eb
KM
2672 (propagated-inputs
2673 (list patatt))
3b77ba78
KM
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
2678patch-based workflows for projects that have public-inbox archives.
2679
2680Features 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
623d4b46
AG
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
b0e7b699 2697 (url "https://github.com/DanielDent/git-annex-remote-rclone")
623d4b46
AG
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))
2dffe476
LC
2709 (let ((bash (search-input-file %build-inputs "/bin/bash"))
2710 (rclone (search-input-file %build-inputs "/bin/rclone")))
623d4b46
AG
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
8394619b 2721 (list bash rclone))
623d4b46
AG
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
2725by rclone usable with git-annex.")
2726 (license license:gpl3+)))
2727
f36a1eba
EB
2728(define-public fossil
2729 (package
2730 (name "fossil")
c8f33b61 2731 (version "2.18")
f36a1eba
EB
2732 (source
2733 (origin
2734 (method url-fetch)
8a4608b4 2735 (uri (string-append
e1dc580b 2736 "https://www.fossil-scm.org/home/tarball/"
c8f33b61 2737 "84f25d7eb10c0714109d69bb2809abfa8b4b5c3d73b151a5b10df724dacd46d8"
e1dc580b 2738 "/fossil-src-" version ".tar.gz"))
c8f33b61 2739 ;; XXX: Currently the above hash must be manually updated.
f36a1eba 2740 (sha256
c8f33b61 2741 (base32 "0cq7677p84nnbfvk2dsh3c3y900gslw3zaw8iipfq932vmf1s31h"))
0b1fb0aa
EF
2742 (modules '((guix build utils)))
2743 (snippet
2744 '(begin
c8f33b61
MB
2745 (delete-file-recursively "compat")
2746 ;; Disable obsolete SQLite feature check; remove for 2.19.
2747 (substitute* "tools/sqlcompattest.c"
2748 ((".*\"ENABLE_JSON1\".*")
2749 ""))))))
f36a1eba
EB
2750 (build-system gnu-build-system)
2751 (native-inputs
e1dc580b
MB
2752 (list tcl ;for configuration only
2753 which ;for tests only
2754 ed)) ;ditto
f36a1eba 2755 (inputs
e1dc580b 2756 (list openssl zlib sqlite-next)) ;SQLite 3.37 or later
f36a1eba
EB
2757 (arguments
2758 `(#:configure-flags (list "--with-openssl=auto"
2759 "--disable-internal-sqlite")
2760 #:test-target "test"
2761 #:phases (modify-phases %standard-phases
66d05055
JL
2762 (add-after 'patch-source-shebangs 'patch-sh
2763 (lambda _
2764 (substitute* '("auto.def")
e1dc580b 2765 (("/bin/sh") (which "sh")))))
f36a1eba
EB
2766 (replace 'configure
2767 (lambda* (#:key outputs (configure-flags '())
5c0f68e8 2768 #:allow-other-keys)
f36a1eba
EB
2769 ;; The 'configure' script is not an autoconf script and
2770 ;; chokes on unrecognized options.
5c0f68e8
TGR
2771 (apply invoke
2772 "./configure"
2773 (string-append "--prefix="
2774 (assoc-ref outputs "out"))
e1dc580b 2775 configure-flags)))
f36a1eba
EB
2776 (add-before 'check 'test-setup
2777 (lambda _
2778 (setenv "USER" "guix")
e1dc580b 2779 (setenv "TZ" "UTC"))))))
f36a1eba
EB
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
2784access and administration over HTTP CGI or via a built-in HTTP server. It has
2785a built-in wiki, built-in file browsing, built-in tickets system, etc.")
12efb1d3
MB
2786 (properties
2787 '((release-monitoring-url
2788 . "https://fossil-scm.org/home/uv/latest-release.md")))
369387b6 2789 (license (list license:public-domain ;src/miniz.c, src/shell.c
2790 license:bsd-2))))
1062f245 2791
2792(define-public stagit
2793 (package
2794 (name "stagit")
e64eb964 2795 (version "1.0")
1062f245 2796 (source (origin
e6a9e7d3 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))
1062f245 2802 (sha256
2803 (base32
e64eb964 2804 "0j2242vx5pbwdv79gcjxdbrwii48qphr8gk1lk7szj2irxdql171"))))
1062f245 2805 (build-system gnu-build-system)
2806 (arguments
2807 `(#:tests? #f ; No tests
56dcaff8 2808 #:make-flags (list (string-append "CC=" ,(cc-for-target))
1062f245 2809 (string-append "PREFIX=" %output))
2810 #:phases
2811 (modify-phases %standard-phases
2812 (delete 'configure)))) ; No configure script
2813 (inputs
8394619b 2814 (list libgit2))
e6a9e7d3 2815 (home-page "https://git.codemadness.org/stagit/")
1062f245 2816 (synopsis "Static git page generator")
2817 (description "Stagit creates static pages for git repositories, the results can
2818be served with a HTTP file server of your choice.")
2819 (license license:expat)))
d81f131f 2820
ca3c1439
OP
2821(define-public gource
2822 (package
2823 (name "gource")
8dc94375 2824 (version "0.51")
ca3c1439
OP
2825 (source (origin
2826 (method url-fetch)
2827 (uri (string-append
45b48698
OP
2828 "https://github.com/acaudwell/Gource/releases/download"
2829 "/gource-" version "/gource-" version ".tar.gz"))
ca3c1439
OP
2830 (sha256
2831 (base32
8dc94375 2832 "16p7b1x4r0915w883lp374jcdqqja37fnb7m8vnsfnl2n64gi8qr"))))
ca3c1439
OP
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
8394619b 2840 (list pkg-config))
ca3c1439 2841 (inputs
8394619b
LC
2842 (list boost
2843 ftgl
2844 glew
2845 glm
2846 glu
2847 libpng
2848 mesa
2849 pcre
2850 (sdl-union (list sdl2 sdl2-image))))
a3228917 2851 (home-page "https://gource.io/")
ca3c1439
OP
2852 (synopsis "3D visualisation tool for source control repositories")
2853 (description "@code{gource} provides a software version control
2854visualization. The repository is displayed as a tree where the root of the
2855repository is the centre, directories are branches and files are leaves.
2856Contributors to the source code appear and disappear as they contribute to
2857specific files and directories.")
2858 (license license:gpl3+)))
0ed7498a
SB
2859
2860(define-public src
2861 (package
2862 (name "src")
d675a28c 2863 (version "1.29")
0ed7498a
SB
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
d675a28c 2870 "0ha287gc95vz6bdvn42pi3qibc56h1w5dshsvjvdn2zd283amksd"))))
0ed7498a
SB
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.
8394619b 2894 (list git perl))
0ed7498a 2895 (inputs
d675a28c
GH
2896 `(("cssc" ,cssc)
2897 ("python" ,python-wrapper)
0ed7498a
SB
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
2903single-file projects by solo developers and authors. It modernizes the
2904venerable RCS, hence the anagrammatic acronym. The design is tuned for use
2905cases like all those little scripts in your @file{~/bin} directory, or a
2906directory full of HOWTOs.")
2907 (license license:bsd-2)))
a078a6ec 2908
243bdcc1
KM
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)
bc64d955 2939 (let ((git (search-input-file inputs "/bin/git")))
243bdcc1
KM
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")
d42245d4 2947 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
243bdcc1
KM
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
2956given commit into the specified ref(s). It has various options that control
2957how information about the merge is displayed.")
887437ee 2958 (license license:gpl2+))))
3855506f
KM
2959
2960(define-public git-imerge
2961 (package
2962 (name "git-imerge")
2963 (version "1.1.0")
5c54debc
TGR
2964 (source
2965 (origin
2966 (method git-fetch)
2967 (uri (git-reference
b0e7b699 2968 (url "https://github.com/mhagger/git-imerge")
5c54debc
TGR
2969 (commit (string-append "v" version))))
2970 (file-name (git-file-name name version))
2971 (sha256
2972 (base32 "0vi1w3f0yk4gqhxj2hzqafqq28rihyhyfnp8x7xzib96j2si14a4"))))
3855506f
KM
2973 (build-system gnu-build-system)
2974 (arguments
5c54debc 2975 `(#:tests? #f ; only manual test scripts
3855506f
KM
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)
bc64d955 2983 (let ((git (search-input-file inputs "/bin/git")))
3855506f
KM
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")
d42245d4 2991 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
3855506f
KM
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},
2999which performs an incremental merge between two branches. Its two primary
3000design goals are to reduce the pain of resolving merge conflicts by finding
3001the smallest possible conflicts and to allow a merge to be saved, tested,
3002interrupted, published, and collaborated on while in progress.")
3003 (license license:gpl2+)))
a3e6cf98
KK
3004
3005(define-public git-lfs
3006 (package
3007 (name "git-lfs")
6a2c7828 3008 (version "2.13.3")
a3e6cf98
KK
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
6a2c7828 3017 "0r7dmqhkhz91d3n7qfpny483x8f1n88yya22j2fvx75rgg33z2sg"))))
a3e6cf98
KK
3018 (build-system go-build-system)
3019 (arguments
8b760279 3020 `(#:import-path "github.com/git-lfs/git-lfs"
a5ccf1b5 3021 #:install-source? #f
8b760279
PG
3022 #:phases
3023 (modify-phases %standard-phases
bf19d5e4
PG
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"))))
8b760279
PG
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
aa916f34 3036 (lambda* (#:key outputs #:allow-other-keys)
8b760279 3037 (with-directory-excursion "src/github.com/git-lfs/git-lfs/man"
aa916f34 3038 (let ((out (assoc-ref outputs "out")))
8b760279
PG
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
8394619b 3045 (native-inputs (list ronn-ng))
a3e6cf98
KK
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,
3050videos, datasets, and graphics with text pointers inside Git, while storing the
3051file contents on a remote server.")
3052 (license license:expat)))
d3fecbab 3053
d6d5a67e
E
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"))))
4cf3734c
E
3067 (build-system copy-build-system)
3068 (inputs
8394619b 3069 (list xdg-utils))
d6d5a67e 3070 (arguments
4cf3734c
E
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"))))
d6d5a67e
E
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,
3085guessing the URL pattern from the @code{origin} remote.")
3086 (license license:expat)))
3087
d3fecbab
LC
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
8394619b 3135 (list which))
d3fecbab
LC
3136 (synopsis "Historical distributed version-control system")
3137 (description
3138 "GNU Arch, aka. @code{tla}, was one of the first free distributed
3139version-control systems (DVCS). It saw its last release in 2006. This
3140package is provided for users who need to recover @code{tla} repositories and
3141for historians.")
3142 (home-page "https://www.gnu.org/software/gnu-arch/")
3143 (license license:gpl2))) ;version 2 only
c7452d23 3144
32a33679
E
3145(define-public diff-so-fancy
3146 (package
3147 (name "diff-so-fancy")
cfee80cc 3148 (version "1.4.3")
32a33679
E
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
cfee80cc 3157 "11vkq5njjlvjipic7db44ga875n61drszw1qrdzwxmmfmnz425zz"))))
32a33679 3158 (inputs
8394619b 3159 (list perl ncurses))
32a33679
E
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.*$")
cfee80cc 3169 (string-append "use lib '" lib "';\n"))))))
32a33679
E
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")
cfee80cc 3177 ,(string-append perl "/bin"))))))))
32a33679
E
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
3185of machine readable. This helps improve code quality and helps you spot
3186defects faster.")
3187 (license license:expat)))
3188
c7452d23
OP
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)))
608113c0
OP
3242
3243(define-public gita
c0c652e0 3244 (let ((commit "e41b504dca90a25e9be27f296da7ce22e5782893")
9bc00fb9
OP
3245 (revision "1"))
3246 (package
3247 (name "gita")
c0c652e0 3248 (version (git-version "0.12.9" revision commit))
9bc00fb9
OP
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
c0c652e0 3257 "1k03zgcbhl91cgyh4k7ywyjp00y63q4bqbimncqh5b3lni8l8j5l"))))
9bc00fb9
OP
3258 (build-system python-build-system)
3259 (native-inputs
8394619b
LC
3260 (list git ;for tests
3261 python-pytest))
9bc00fb9 3262 (propagated-inputs
8394619b 3263 (list python-pyyaml))
9bc00fb9
OP
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'"))
bc64d955 3272 (invoke (search-input-file inputs "/bin/git")
9bc00fb9
OP
3273 "init")
3274 (add-installed-pythonpath inputs outputs)
bc64d955 3275 (invoke (search-input-file inputs "/bin/pytest")
9bc00fb9
OP
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
608113c0
OP
3291multiple Git repos.
3292
3293This tool does two things:
3294@itemize
3295@item display the status of multiple Git repos such as branch, modification,
3296commit message side by side
3297@item (batch) delegate Git commands/aliases from any working directory
3298@end itemize
3299
3300If several repos are related, it helps to see their status together.")
9bc00fb9 3301 (license license:expat))))
2cb5ebf7
JL
3302
3303(define-public ghq
3304 (package
3305 (name "ghq")
1135b347 3306 (version "1.1.7")
2cb5ebf7
JL
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
1135b347 3316 "155sfmhmh4ia3iinm1s8fk7fxyn5dxdryad9xkbg7mr3i3ikqjwh"))))
2cb5ebf7
JL
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
3350makes a directory under a specific root directory (by default @file{~/ghq})
3351using the remote repository URL's host and path.")
3352 (license license:expat)))
cd95cb28 3353
b2ec14a7
FCW
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,
3394Subversion and Git configuration management systems. It will also help with
3395RCS. It shows the status of the files in the current working directory, and
3396has tools for tagging, merging, checking in/out, and other user operations.
3397TkDiff is included for browsing and merging your changes.")
3398 (license license:gpl2+)))
3399
cd95cb28
F
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 ()))))
8394619b 3422 (inputs (list python)) ;for the shebang
cd95cb28
F
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,
3427which roughly falls into the same space of tool like git filter-branch but
3428with more capabilities. @command{git filter-repo} is now recommended by the
3429Git project instead of @command{git filter-branch}.")
3430 (license (list license:expat ;; Main license.
3431 license:gpl2)))) ;; For test harness.
ce127607
BK
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
3467commit messages for style.")
3468 (license license:expat)))
c20d684c
DG
3469
3470(define-public hut
3471 (package
3472 (name "hut")
8b0e8601 3473 (version "0.2.0")
c20d684c
DG
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
8b0e8601 3482 (base32 "0ybngrwwmkm00dlkdhvkfcvcjhp5xzs8fh90zqr0h12ssqx9pll3"))))
c20d684c
DG
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
3513sr.ht's public services:
3514@table @asis
3515@item builds
3516submit and manage build jobs
3517@item git
3518create, and manage git repositories and artifacts
3519@item hg
3520list Mercurial repositories
3521@item lists
3522manage mailing lists and patches
3523@item meta
3524manage PGP, and SSH keys
3525@item pages
3526publish and manage hosted websites
3527@item paste
3528create and manage pastes
3529@item todo
3530create and manage trackers, tickets
3531@item graphql
3532interact with GraphQL APIs directly
3533@end table")
3534 (license license:agpl3)))