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