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