Merge branch 'master' into core-updates
[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 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 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2015, 2018 Kyle Meyer <kyle@kyleam.com>
11 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
12 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
13 ;;; Copyright © 2016, 2017, 2018 ng0 <ng0@n0.is>
14 ;;; Copyright © 2017, 2018, 2019 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 André <eu@euandre.org>
18 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
20 ;;; Copyright © 2017 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 Alex Griffin <a@ajgrf.com>
28 ;;;
29 ;;; This file is part of GNU Guix.
30 ;;;
31 ;;; GNU Guix is free software; you can redistribute it and/or modify it
32 ;;; under the terms of the GNU General Public License as published by
33 ;;; the Free Software Foundation; either version 3 of the License, or (at
34 ;;; your option) any later version.
35 ;;;
36 ;;; GNU Guix is distributed in the hope that it will be useful, but
37 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
38 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39 ;;; GNU General Public License for more details.
40 ;;;
41 ;;; You should have received a copy of the GNU General Public License
42 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
43
44 (define-module (gnu packages version-control)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix utils)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix build-system cmake)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system go)
53 #:use-module (guix build-system python)
54 #:use-module (guix build-system trivial)
55 #:use-module (gnu packages apr)
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages bash)
60 #:use-module (gnu packages bison)
61 #:use-module (gnu packages boost)
62 #:use-module (gnu packages check)
63 #:use-module (gnu packages cook)
64 #:use-module (gnu packages curl)
65 #:use-module (gnu packages docbook)
66 #:use-module (gnu packages ed)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages flex)
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages gl)
71 #:use-module (gnu packages groff)
72 #:use-module (gnu packages guile)
73 #:use-module (gnu packages image)
74 #:use-module (gnu packages linux)
75 #:use-module (gnu packages maths)
76 #:use-module (gnu packages nano)
77 #:use-module (gnu packages ncurses)
78 #:use-module (gnu packages ssh)
79 #:use-module (gnu packages web)
80 #:use-module (gnu packages openstack)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages perl-check)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages python)
86 #:use-module (gnu packages python-web)
87 #:use-module (gnu packages python-xyz)
88 #:use-module (gnu packages readline)
89 #:use-module (gnu packages rsync)
90 #:use-module (gnu packages sqlite)
91 #:use-module (gnu packages admin)
92 #:use-module (gnu packages xml)
93 #:use-module (gnu packages emacs)
94 #:use-module (gnu packages compression)
95 #:use-module (gnu packages sdl)
96 #:use-module (gnu packages swig)
97 #:use-module (gnu packages sync)
98 #:use-module (gnu packages tcl)
99 #:use-module (gnu packages textutils)
100 #:use-module (gnu packages time)
101 #:use-module (gnu packages tls)
102 #:use-module (gnu packages)
103 #:use-module (ice-9 match)
104 #:use-module (srfi srfi-1))
105
106 (define-public bazaar
107 (package
108 (name "bazaar")
109 (version "2.7.0")
110 (source
111 (origin
112 (method url-fetch)
113 (uri (string-append "https://launchpad.net/bzr/"
114 (version-major+minor version) "/" version
115 "/+download/bzr-" version ".tar.gz"))
116 (patches (search-patches "bazaar-CVE-2017-14176.patch"))
117 (sha256
118 (base32
119 "1cysix5k3wa6y7jjck3ckq3abls4gvz570s0v0hxv805nwki4i8d"))))
120 (build-system python-build-system)
121 (inputs
122 ;; Note: 'tools/packaging/lp-upload-release' and 'tools/weavemerge.sh'
123 ;; require Zsh.
124 `(("gettext" ,gettext-minimal)))
125 (arguments
126 `(#:tests? #f ; no test target
127 #:python ,python-2 ; Python 3 apparently not yet supported, see
128 ; https://answers.launchpad.net/bzr/+question/229048
129 #:phases
130 (modify-phases %standard-phases
131 (add-after 'unpack 'fix-mandir
132 (lambda _
133 (substitute* "setup.py"
134 (("man/man1") "share/man/man1"))
135 #t)))))
136 (home-page "https://gnu.org/software/bazaar")
137 (synopsis "Version control system supporting both distributed and centralized workflows")
138 (description
139 "GNU Bazaar is a version control system that allows you to record
140 changes to project files over time. It supports both a distributed workflow
141 as well as the classic centralized workflow.")
142 (license license:gpl2+)))
143
144 (define-public git
145 (package
146 (name "git")
147 ;; XXX When updating Git, check if the special 'git-source' input to cgit
148 ;; needs to be updated as well.
149 (version "2.23.0")
150 (source (origin
151 (method url-fetch)
152 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
153 version ".tar.xz"))
154 (sha256
155 (base32
156 "0rv0y45gcd3h191isppn77acih695v4pipdj031jvs9rd1ds0kr3"))))
157 (build-system gnu-build-system)
158 (native-inputs
159 `(("native-perl" ,perl)
160 ("gettext" ,gettext-minimal)
161 ("git-manpages"
162 ,(origin
163 (method url-fetch)
164 (uri (string-append
165 "mirror://kernel.org/software/scm/git/git-manpages-"
166 version ".tar.xz"))
167 (sha256
168 (base32
169 "0sllhyl0w29v4n303hqfmcc3apafnwk4sk78anyjjhpzd0zl6n4m"))))
170 ;; For subtree documentation.
171 ("asciidoc" ,asciidoc)
172 ("docbook-xsl" ,docbook-xsl)
173 ("xmlto" ,xmlto)))
174 (inputs
175 `(("curl" ,curl)
176 ("expat" ,expat)
177 ("openssl" ,openssl)
178 ("perl" ,perl)
179 ("python" ,python-2) ; CAVEAT: incompatible with python-3 according to INSTALL
180 ("zlib" ,zlib)
181
182 ;; Note: we keep this in inputs rather than native-inputs to work around
183 ;; a problem in 'patch-shebangs'; see <https://bugs.gnu.org/31952>.
184 ("bash-for-tests" ,bash)
185
186 ;; For 'gitweb.cgi'
187 ("perl-cgi" ,perl-cgi)
188
189 ;; For 'git-svn'.
190 ("subversion" ,subversion)
191 ("perl-term-readkey" ,perl-term-readkey)
192
193 ;; For 'git-send-email'
194 ("perl-authen-sasl" ,perl-authen-sasl)
195 ("perl-net-smtp-ssl" ,perl-net-smtp-ssl)
196 ("perl-io-socket-ssl" ,perl-io-socket-ssl)
197
198 ;; For 'git gui', 'gitk', and 'git citool'.
199 ("tcl" ,tcl)
200 ("tk" ,tk)))
201 (outputs '("out" ; the core
202 "send-email" ; for git-send-email
203 "svn" ; git-svn
204 "credential-netrc" ; git-credential-netrc
205 "subtree" ; git-subtree
206 "gui")) ; gitk, git gui
207 (arguments
208 `(#:make-flags `("V=1" ;more verbose compilation
209
210 ,(string-append "SHELL_PATH="
211 (assoc-ref %build-inputs "bash")
212 "/bin/sh")
213
214 ;; Tests require a bash with completion support.
215 ,(string-append "TEST_SHELL_PATH="
216 (assoc-ref %build-inputs "bash-for-tests")
217 "/bin/bash")
218
219 ;; By default 'make install' creates hard links for
220 ;; things in 'libexec/git-core', which leads to huge
221 ;; nars; see <https://bugs.gnu.org/21949>.
222 "NO_INSTALL_HARDLINKS=indeed")
223
224 ;; Make sure the full bash does not end up in the final closure.
225 #:disallowed-references (,bash)
226
227 #:test-target "test"
228
229 ;; Tests fail randomly when parallel: <https://bugs.gnu.org/29512>.
230 #:parallel-tests? #f
231
232 ;; The explicit --with-tcltk forces the build system to hardcode the
233 ;; absolute file name to 'wish'.
234 #:configure-flags (list (string-append "--with-tcltk="
235 (assoc-ref %build-inputs "tk")
236 "/bin/wish8.6")) ; XXX
237
238 #:modules ((srfi srfi-1)
239 (srfi srfi-26)
240 ,@%gnu-build-system-modules)
241 #:phases
242 (modify-phases %standard-phases
243 (add-after 'unpack 'modify-PATH
244 (lambda* (#:key inputs #:allow-other-keys)
245 (let ((path (string-split (getenv "PATH") #\:))
246 (bash-full (assoc-ref inputs "bash-for-tests")))
247 ;; Drop the test bash from PATH so that (which "sh") and
248 ;; similar does the right thing.
249 (setenv "PATH" (string-join
250 (remove (cut string-prefix? bash-full <>) path)
251 ":"))
252 #t)))
253 (add-after 'configure 'patch-makefiles
254 (lambda _
255 (substitute* "Makefile"
256 (("/usr/bin/perl") (which "perl"))
257 (("/usr/bin/python") (which "python")))
258 #t))
259 (add-after 'configure 'add-PM.stamp
260 (lambda _
261 ;; Add the "PM.stamp" to avoid "no rule to make target".
262 (call-with-output-file "perl/PM.stamp" (const #t))
263 #t))
264 (add-after 'build 'build-subtree
265 (lambda* (#:key inputs #:allow-other-keys)
266 (with-directory-excursion "contrib/subtree"
267 (substitute* "Makefile"
268 ;; Apparently `xmlto' does not bother to looks up the stylesheets
269 ;; specified in the XML, unlike the above substitution. Instead it
270 ;; uses a hard-coded URL. Work around it here, but if this is
271 ;; common perhaps we should hardcode this path in xmlto itself.
272 (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\) man")
273 (string-append "$(XMLTO) -x "
274 (string-append (assoc-ref inputs "docbook-xsl")
275 "/xml/xsl/docbook-xsl-"
276 ,(package-version docbook-xsl))
277 "/manpages/docbook.xsl -m $(MANPAGE_XSL) man")))
278 (invoke "make")
279 (invoke "make" "install")
280 (invoke "make" "install-doc")
281 (substitute* "git-subtree"
282 (("/bin/sh") (which "sh"))))
283 #t))
284 (add-before 'check 'patch-tests
285 (lambda _
286 (let ((store-directory (%store-directory)))
287 ;; These files contain some funny bytes that Guile is unable
288 ;; to decode for shebang patching. Just delete them.
289 (for-each delete-file '("t/t4201-shortlog.sh"
290 "t/t7813-grep-icase-iso.sh"))
291 ;; Many tests contain inline shell scripts (hooks etc).
292 (substitute* (find-files "t" "\\.sh$")
293 (("#!/bin/sh") (string-append "#!" (which "sh"))))
294 ;; Un-do shebang patching here to prevent checksum mismatch.
295 (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
296 (("^#!.*/bin/perl") "#!/usr/bin/perl"))
297 (substitute* "t/t5003-archive-zip.sh"
298 (("cp /bin/sh") (string-append "cp " (which "sh"))))
299 (substitute* "t/t6030-bisect-porcelain.sh"
300 (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
301 ;; FIXME: This test runs `git commit` with a bogus EDITOR
302 ;; and empty commit message, but does not fail the way it's
303 ;; expected to. The test passes when invoked interactively.
304 (substitute* "t/t7508-status.sh"
305 (("\tcommit_template_commented") "\ttrue"))
306 ;; More checksum mismatches due to odd shebangs.
307 (substitute* "t/t9100-git-svn-basic.sh"
308 (((string-append "\"#!" store-directory ".*/bin/sh")) "\"#!/bin/sh") )
309 (substitute* "t/t9300-fast-import.sh"
310 (((string-append "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh")
311 (((string-append "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh"))
312 ;; FIXME: Some hooks fail with "basename: command not found".
313 ;; See 't/trash directory.t9164.../svn-hook.log'.
314 (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
315
316 ;; XXX: These tests fail intermittently for unknown reasons:
317 ;; <https://bugs.gnu.org/29546>.
318 (for-each delete-file
319 '("t/t9128-git-svn-cmd-branch.sh"
320 "t/t9167-git-svn-cmd-branch-subproject.sh"
321 "t/t9141-git-svn-multiple-branches.sh"))
322 #t)))
323 (add-after 'install 'install-shell-completion
324 (lambda* (#:key outputs #:allow-other-keys)
325 (let* ((out (assoc-ref outputs "out"))
326 (completions (string-append out "/etc/bash_completion.d")))
327 ;; TODO: Install the tcsh and zsh completions in the right place.
328 (mkdir-p completions)
329 (copy-file "contrib/completion/git-completion.bash"
330 (string-append completions "/git"))
331 #t)))
332 (add-after 'install 'install-credential-netrc
333 (lambda* (#:key outputs #:allow-other-keys)
334 (let* ((netrc (assoc-ref outputs "credential-netrc")))
335 (install-file "contrib/credential/netrc/git-credential-netrc"
336 (string-append netrc "/bin"))
337 ;; Previously, Git.pm was automatically found by netrc.
338 ;; Perl 5.26 changed how it locates modules so that @INC no
339 ;; longer includes the current working directory (the Perl
340 ;; community calls this "dotless @INC").
341 (wrap-program (string-append netrc "/bin/git-credential-netrc")
342 `("PERL5LIB" ":" prefix
343 (,(string-append (assoc-ref outputs "out") "/share/perl5"))))
344 #t)))
345 (add-after 'install 'install-subtree
346 (lambda* (#:key outputs #:allow-other-keys)
347 (let ((subtree (assoc-ref outputs "subtree")))
348 (install-file "contrib/subtree/git-subtree"
349 (string-append subtree "/bin"))
350 (install-file "contrib/subtree/git-subtree.1"
351 (string-append subtree "/share/man/man1"))
352 #t)))
353 (add-after 'install 'split
354 (lambda* (#:key inputs outputs #:allow-other-keys)
355 ;; Split the binaries to the various outputs.
356 (let* ((out (assoc-ref outputs "out"))
357 (se (assoc-ref outputs "send-email"))
358 (svn (assoc-ref outputs "svn"))
359 (gui (assoc-ref outputs "gui"))
360 (gitk (string-append out "/bin/gitk"))
361 (gitk* (string-append gui "/bin/gitk"))
362 (git-gui (string-append out "/libexec/git-core/git-gui"))
363 (git-gui* (string-append gui "/libexec/git-core/git-gui"))
364 (git-cit (string-append out "/libexec/git-core/git-citool"))
365 (git-cit* (string-append gui "/libexec/git-core/git-citool"))
366 (git-se (string-append out "/libexec/git-core/git-send-email"))
367 (git-se* (string-append se "/libexec/git-core/git-send-email"))
368 (git-svn (string-append out "/libexec/git-core/git-svn"))
369 (git-svn* (string-append svn "/libexec/git-core/git-svn"))
370 (git-sm (string-append out
371 "/libexec/git-core/git-submodule")))
372 (mkdir-p (string-append gui "/bin"))
373 (mkdir-p (string-append gui "/libexec/git-core"))
374 (mkdir-p (string-append se "/libexec/git-core"))
375 (mkdir-p (string-append svn "/libexec/git-core"))
376
377 (for-each (lambda (old new)
378 (copy-file old new)
379 (delete-file old)
380 (chmod new #o555))
381 (list gitk git-gui git-cit git-se git-svn)
382 (list gitk* git-gui* git-cit* git-se* git-svn*))
383
384 ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
385 (wrap-program git-svn*
386 `("PATH" ":" prefix
387 (,(string-append (assoc-ref inputs "subversion")
388 "/bin")))
389 `("PERL5LIB" ":" prefix
390 ,(map (lambda (i) (string-append (assoc-ref inputs i)
391 "/lib/perl5/site_perl"))
392 '("subversion" "perl-term-readkey")))
393
394 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
395 ;; help it find 'libsvn_client-1.so'.
396 `("LD_LIBRARY_PATH" ":" prefix
397 (,(string-append (assoc-ref inputs "subversion")
398 "/lib"))))
399
400 ;; Tell 'git-send-email' where perl modules are.
401 (wrap-program git-se*
402 `("PERL5LIB" ":" prefix
403 ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
404 (list
405 ,@(transitive-input-references
406 'inputs
407 (map (lambda (l)
408 (assoc l (package-inputs this-package)))
409 '("perl-authen-sasl"
410 "perl-net-smtp-ssl"
411 "perl-io-socket-ssl")))))))
412
413 ;; Tell 'gitweb.cgi' where perl modules are.
414 (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
415 `("PERL5LIB" ":" prefix
416 ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
417 (list
418 ,@(transitive-input-references
419 'inputs
420 (map (lambda (l)
421 (assoc l (package-inputs this-package)))
422 '("perl-cgi")))))))
423
424 ;; Tell 'git-submodule' where Perl is.
425 (wrap-program git-sm
426 `("PATH" ":" prefix
427 (,(string-append (assoc-ref inputs "perl")
428 "/bin"))))
429
430 #t)))
431 (add-after 'split 'install-man-pages
432 (lambda* (#:key inputs outputs #:allow-other-keys)
433 (let* ((out (assoc-ref outputs "out"))
434 (man (string-append out "/share/man"))
435 (manpages (assoc-ref inputs "git-manpages")))
436 (mkdir-p man)
437 (with-directory-excursion man
438 (invoke "tar" "xvf" manpages))))))))
439
440 (native-search-paths
441 ;; For HTTPS access, Git needs a single-file certificate bundle, specified
442 ;; with $GIT_SSL_CAINFO.
443 (list (search-path-specification
444 (variable "GIT_SSL_CAINFO")
445 (file-type 'regular)
446 (separator #f) ;single entry
447 (files '("etc/ssl/certs/ca-certificates.crt")))
448 (search-path-specification
449 (variable "GIT_EXEC_PATH")
450 (separator #f) ;single entry
451 (files '("libexec/git-core")))))
452
453 (synopsis "Distributed version control system")
454 (description
455 "Git is a free distributed version control system designed to handle
456 everything from small to very large projects with speed and efficiency.")
457 (license license:gpl2)
458 (home-page "https://git-scm.com/")))
459
460 (define-public git-minimal
461 ;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
462 ;; Its test suite runs slightly faster and most importantly it doesn't
463 ;; depend on packages that are expensive to build such as Subversion.
464 (package
465 (inherit git)
466 (name "git-minimal")
467 (arguments
468 (substitute-keyword-arguments (package-arguments git)
469 ((#:phases phases)
470 `(modify-phases ,phases
471 (replace 'patch-makefiles
472 (lambda _
473 (substitute* "Makefile"
474 (("/usr/bin/perl") (which "perl")))
475 #t))
476 (delete 'build-subtree)
477 (delete 'split)
478 (delete 'install-man-pages)
479 (delete 'install-subtree)
480 (delete 'install-credential-netrc)
481 (add-before 'check 'delete-svn-test
482 (lambda _
483 ;; This test cannot run since we are not building 'git-svn'.
484 (delete-file "t/t9020-remote-svn.sh")
485 #t))
486 (add-after 'install 'remove-unusable-perl-commands
487 (lambda* (#:key outputs #:allow-other-keys)
488 (let* ((out (assoc-ref outputs "out"))
489 (bin (string-append out "/bin"))
490 (libexec (string-append out "/libexec")))
491 (for-each (lambda (file)
492 (delete-file (string-append libexec
493 "/git-core/" file)))
494 '("git-svn" "git-cvsimport" "git-archimport"
495 "git-cvsserver" "git-request-pull"
496 "git-add--interactive" "git-cvsexportcommit"
497 "git-instaweb" "git-send-email"))
498 (delete-file (string-append bin "/git-cvsserver"))
499
500 ;; These templates typically depend on Perl. Remove them.
501 (delete-file-recursively
502 (string-append out "/share/git-core/templates/hooks"))
503
504 ;; Gitweb depends on Perl as well.
505 (delete-file-recursively
506 (string-append out "/share/gitweb"))
507 #t)))))
508 ((#:configure-flags flags)
509 ''())
510 ((#:disallowed-references lst '())
511 `(,perl ,@lst))))
512 (outputs '("out"))
513 (native-inputs
514 `(("native-perl" ,perl)
515 ("gettext" ,gettext-minimal)))
516 (inputs
517 `(("curl" ,curl) ;for HTTP(S) access
518 ("expat" ,expat) ;for 'git push' over HTTP(S)
519 ("openssl" ,openssl)
520 ("perl" ,perl)
521 ("zlib" ,zlib)
522 ("bash-for-tests" ,bash)))))
523
524 (define-public libgit2
525 (package
526 (name "libgit2")
527 (version "0.28.2")
528 (source (origin
529 (method git-fetch)
530 (uri (git-reference
531 (url "https://github.com/libgit2/libgit2.git")
532 (commit (string-append "v" version))))
533 (file-name (git-file-name name version))
534 (sha256
535 (base32
536 "0cm8fvs05rj0baigs2133q5a0sm3pa234y8h6hmwhl2bz9xq3k4b"))
537 (patches (search-patches "libgit2-avoid-python.patch"
538 "libgit2-mtime-0.patch"))
539
540 ;; Remove bundled software.
541 (snippet '(begin
542 (delete-file-recursively "deps")
543 #t))
544 (modules '((guix build utils)))))
545 (build-system cmake-build-system)
546 (outputs '("out" "debug"))
547 (arguments
548 `(#:configure-flags
549 (list "-DUSE_SHA1DC=ON" ; SHA-1 collision detection
550 ,@(if (%current-target-system)
551 `((string-append
552 "-DPKG_CONFIG_EXECUTABLE="
553 (assoc-ref %build-inputs "pkg-config")
554 "/bin/" ,(%current-target-system) "-pkg-config"))
555 '()))
556 #:phases
557 (modify-phases %standard-phases
558 (add-after 'unpack 'fix-hardcoded-paths
559 (lambda _
560 (substitute* "tests/repo/init.c"
561 (("#!/bin/sh") (string-append "#!" (which "sh"))))
562 (substitute* "tests/clar/fs.h"
563 (("/bin/cp") (which "cp"))
564 (("/bin/rm") (which "rm")))
565 #t))
566 (add-after 'unpack 'make-git-checkout-writable
567 (lambda _
568 (for-each make-file-writable (find-files "."))
569 #t))
570 ;; Run checks more verbosely, unless we are cross-compiling.
571 (replace 'check
572 (lambda* (#:key (tests? #t) #:allow-other-keys)
573 (if tests?
574 (invoke "./libgit2_clar" "-v" "-Q")
575 ;; Tests may be disabled if cross-compiling.
576 (format #t "Test suite not run.~%")))))))
577 (inputs
578 `(("libssh2" ,libssh2)
579 ("http-parser" ,http-parser)))
580 (native-inputs
581 `(("guile" ,guile-2.2)
582 ("pkg-config" ,pkg-config)))
583 (propagated-inputs
584 ;; These two libraries are in 'Requires.private' in libgit2.pc.
585 `(("openssl" ,openssl)
586 ("zlib" ,zlib)))
587 (home-page "https://libgit2.github.com/")
588 (synopsis "Library providing Git core methods")
589 (description
590 "Libgit2 is a portable, pure C implementation of the Git core methods
591 provided as a re-entrant linkable library with a solid API, allowing you to
592 write native speed custom Git applications in any language with bindings.")
593 ;; GPLv2 with linking exception
594 (license license:gpl2)))
595
596 (define-public git-crypt
597 (package
598 (name "git-crypt")
599 (version "0.5.0")
600 (source
601 (origin
602 (method git-fetch)
603 (uri (git-reference
604 (url "https://github.com/AGWA/git-crypt.git")
605 (commit version)))
606 (file-name (git-file-name name version))
607 (sha256
608 (base32 "1x9209n3k49k998saadr2d0lmvs01smjinx7gzzyjdwj9l904sii"))))
609 (build-system gnu-build-system)
610 (inputs
611 `(("git" ,git)
612 ("openssl" ,openssl)))
613 (arguments
614 `(#:tests? #f ; No tests.
615 #:phases
616 (modify-phases %standard-phases
617 (delete 'configure)
618 (replace 'build
619 (lambda _
620 (invoke "make")))
621 (replace 'install
622 (lambda* (#:key outputs #:allow-other-keys)
623 (let ((out (assoc-ref outputs "out")))
624 (invoke "make" "install"
625 (string-append "PREFIX=" out))))))))
626 (home-page "https://www.agwa.name/projects/git-crypt")
627 (synopsis "Transparent encryption of files in a git repository")
628 (description "git-crypt enables transparent encryption and decryption of
629 files in a git repository. Files which you choose to protect are encrypted when
630 committed, and decrypted when checked out. git-crypt lets you freely share a
631 repository containing a mix of public and private content. git-crypt gracefully
632 degrades, so developers without the secret key can still clone and commit to a
633 repository with encrypted files. This lets you store your secret material (such
634 as keys or passwords) in the same repository as your code, without requiring you
635 to lock down your entire repository.")
636 (license license:gpl3+)))
637
638 (define-public git-remote-gcrypt
639 (package
640 (name "git-remote-gcrypt")
641 (version "1.0.3")
642 (source (origin
643 (method git-fetch)
644 (uri (git-reference
645 (url "https://git.spwhitton.name/git-remote-gcrypt")
646 (commit version)))
647 (file-name (string-append name "-" version "-checkout"))
648 (sha256
649 (base32
650 "1vay3204729c7wajgn3nxf0s0hzwpdrw14pl6kd8w2ss25gvw2k1"))))
651 (build-system trivial-build-system)
652 (arguments
653 `(#:modules ((guix build utils))
654 #:builder (begin
655 (use-modules (guix build utils))
656 (let* ((source (assoc-ref %build-inputs "source"))
657 (output (assoc-ref %outputs "out"))
658 (bindir (string-append output "/bin")))
659 (install-file (string-append source "/git-remote-gcrypt")
660 bindir)
661 #t))))
662 (home-page "https://spwhitton.name/tech/code/git-remote-gcrypt/")
663 (synopsis "Whole remote repository encryption")
664 (description "git-remote-gcrypt is a Git remote helper to push and pull from
665 repositories encrypted with GnuPG. It works with the standard Git transports,
666 including repository hosting services like GitLab.
667
668 Remote helper programs are invoked by Git to handle network transport. This
669 helper handles @code{gcrypt:} URLs that access a remote repository encrypted
670 with GPG, using our custom format.
671
672 Supported locations are local, @code{rsync://} and @code{sftp://}, where the
673 repository is stored as a set of files, or instead any Git URL where gcrypt
674 will store the same representation in a Git repository, bridged over arbitrary
675 Git transport.
676
677 The aim is to provide confidential, authenticated Git storage and
678 collaboration using typical untrusted file hosts or services.")
679 (license license:gpl3+)))
680
681 (define-public cgit
682 (package
683 (name "cgit")
684 (version "1.2.1")
685 (source (origin
686 (method url-fetch)
687 (uri (string-append
688 "https://git.zx2c4.com/cgit/snapshot/cgit-"
689 version ".tar.xz"))
690 (sha256
691 (base32
692 "1gw2j5xc5qdx2hwiwkr8h6kgya7v9d9ff9j32ga1dys0cca7qm1w"))))
693 (build-system gnu-build-system)
694 (arguments
695 '(#:tests? #f ; XXX: fail to build the in-source git.
696 #:test-target "test"
697 #:make-flags '("CC=gcc" "SHELL_PATH=sh")
698 #:phases
699 (modify-phases %standard-phases
700 (add-after 'unpack 'unpack-git
701 (lambda* (#:key inputs #:allow-other-keys)
702 ;; Unpack the source of git into the 'git' directory.
703 (invoke "tar" "--strip-components=1" "-C" "git" "-xf"
704 (assoc-ref inputs "git-source"))))
705 (add-after 'unpack 'patch-absolute-file-names
706 (lambda* (#:key inputs #:allow-other-keys)
707 (define (quoted-file-name input path)
708 (string-append "\"" input path "\""))
709 (substitute* "ui-snapshot.c"
710 (("\"gzip\"")
711 (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip"))
712 (("\"bzip2\"")
713 (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2"))
714 (("\"xz\"")
715 (quoted-file-name (assoc-ref inputs "xz") "/bin/xz")))
716
717 (substitute* "filters/about-formatting.sh"
718 (("$\\(dirname $0\\)") (string-append (assoc-ref outputs "out")
719 "/lib/cgit/filters"))
720 (("\\| tr") (string-append "| " (which "tr"))))
721
722 (substitute* "filters/html-converters/txt2html"
723 (("sed") (which "sed")))
724
725 (substitute* "filters/html-converters/man2html"
726 (("groff") (which "groff")))
727
728 (substitute* "filters/html-converters/rst2html"
729 (("rst2html\\.py") (which "rst2html.py")))
730
731 #t))
732 (delete 'configure) ; no configure script
733 (add-after 'build 'build-man
734 (lambda* (#:key make-flags #:allow-other-keys)
735 (apply invoke "make" "doc-man" make-flags)))
736 (replace 'install
737 (lambda* (#:key make-flags outputs #:allow-other-keys)
738 (let ((out (assoc-ref outputs "out")))
739 (apply invoke
740 "make" "install" "install-man"
741 (string-append "prefix=" out)
742 (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit")
743 make-flags)
744 ;; Move the platform-dependent 'cgit.cgi' into lib to get it
745 ;; stripped.
746 (rename-file (string-append out "/share/cgit/cgit.cgi")
747 (string-append out "/lib/cgit/cgit.cgi"))
748 #t)))
749 (add-after 'install 'wrap-python-scripts
750 (lambda* (#:key outputs #:allow-other-keys)
751 (for-each
752 (lambda (file)
753 (wrap-program (string-append (assoc-ref outputs "out")
754 "/lib/cgit/filters/" file)
755 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
756 '("syntax-highlighting.py"
757 "html-converters/md2html"))
758 #t)))))
759 (native-inputs
760 ;; For building manpage.
761 `(("asciidoc" ,asciidoc)
762 ("gzip" ,gzip)
763 ("bzip2" ,bzip2)
764 ("xz" ,xz)))
765 (inputs
766 `(;; Building cgit requires a Git source tree.
767 ("git-source"
768 ,(origin
769 (method url-fetch)
770 ;; XXX CGit is currently incompatible with Git > 2.18.
771 (uri "mirror://kernel.org/software/scm/git/git-2.18.0.tar.xz")
772 (sha256
773 (base32
774 "14hfwfkrci829a9316hnvkglnqqw1p03cw9k56p4fcb078wbwh4b"))))
775 ("openssl" ,openssl)
776 ("groff" ,groff)
777 ("python" ,python)
778 ("python-docutils" ,python-docutils)
779 ("python-markdown" ,python-markdown)
780 ("python-pygments" ,python-pygments)
781 ("zlib" ,zlib)))
782 (home-page "https://git.zx2c4.com/cgit/")
783 (synopsis "Web frontend for git repositories")
784 (description
785 "CGit is an attempt to create a fast web interface for the Git SCM, using
786 a built-in cache to decrease server I/O pressure.")
787 (license license:gpl2)))
788
789 (define-public python-ghp-import
790 (package
791 (name "python-ghp-import")
792 (version "0.5.5")
793 (source
794 (origin
795 (method git-fetch)
796 (uri (git-reference
797 (url "https://github.com/davisp/ghp-import.git")
798 (commit version)))
799 (file-name (git-file-name name version))
800 (sha256
801 (base32 "12pmw3zz3i57ljnm0rxdyjqdyhisbvy18mjwkb3bzp5pgzs2f45c"))))
802 (build-system python-build-system)
803 (arguments
804 `(#:phases (modify-phases %standard-phases
805 (add-after 'install 'install-documentation
806 (lambda* (#:key outputs #:allow-other-keys)
807 (let* ((out (assoc-ref outputs "out"))
808 (doc (string-append out "/share/doc"))
809 (licenses (string-append out "/share/licenses")))
810 (install-file "README.md" doc)
811 (install-file "LICENSE" licenses)))))))
812 (home-page "https://github.com/davisp/ghp-import")
813 (synopsis "Copy directory to the gh-pages branch")
814 (description "Script that copies a directory to the gh-pages branch (by
815 default) of the repository.")
816
817 ;; See <https://bugs.gnu.org/27913>.
818 (license (license:non-copyleft
819 "https://raw.githubusercontent.com/davisp/ghp-import/master/LICENSE"
820 "Tumbolia Public License"))))
821
822 (define-public python2-ghp-import
823 (package-with-python2
824 (strip-python2-variant python-ghp-import)))
825
826 (define-public python-gitdb
827 (package
828 (name "python-gitdb")
829 (version "2.0.4")
830 (source (origin
831 (method url-fetch)
832 (uri (pypi-uri "gitdb2" version))
833 (sha256
834 (base32
835 "0i608q9c47rdsmyac1cn6s0hzwwj7cb957y8fc9wacc5lnw8ak5v"))))
836 (build-system python-build-system)
837 (arguments
838 `(#:phases (modify-phases %standard-phases
839 (add-before 'check 'create-test-repository
840 (lambda _
841 (mkdir "/tmp/testrepo")
842 ;; Some tests require a git repository, so create one.
843 (with-directory-excursion "/tmp/testrepo"
844 (do ((filecount 1 (1+ filecount)))
845 ((> filecount 1000))
846 (call-with-output-file (string-append
847 "file" (number->string filecount))
848 (lambda (port)
849 (format port "~a" filecount))))
850 (begin
851 (invoke "git" "init")
852 (invoke "git" "config" "user.name" "Total Git")
853 (invoke "git" "config" "user.email" "git@localhost")
854 (invoke "git" "add" "-A")
855 (invoke "git" "commit" "-q" "-m" "dummy commit")))
856
857 ;; The repository checkout must be a "bare" clone.
858 (invoke "git" "clone" "--bare" "/tmp/testrepo"
859 "/tmp/testrepo.git")))
860 (replace 'check
861 (lambda _
862 (setenv "GITDB_TEST_GIT_REPO_BASE" "/tmp/testrepo.git")
863 ;; Skip tests that must be run from the gitdb repository.
864 (setenv "TRAVIS" "1")
865 (invoke "nosetests" "-v"))))))
866 (propagated-inputs
867 `(("python-smmap2" ,python-smmap2)))
868 (native-inputs
869 `(("git" ,git)
870 ("python-nose" ,python-nose)))
871 (home-page "https://github.com/gitpython-developers/gitdb")
872 (synopsis "Python implementation of the Git object database")
873 (description
874 "GitDB allows you to access @dfn{bare} Git repositories for reading and
875 writing. It aims at allowing full access to loose objects as well as packs
876 with performance and scalability in mind. It operates exclusively on streams,
877 allowing to handle large objects with a small memory footprint.")
878 (license license:bsd-3)))
879
880 (define-public python2-gitdb
881 (package-with-python2 python-gitdb))
882
883 (define-public python-gitpython
884 (package
885 (name "python-gitpython")
886 (version "2.1.11")
887 (source (origin
888 (method url-fetch)
889 (uri (pypi-uri "GitPython" version))
890 (sha256
891 (base32
892 "1a357c28dnhgvq3saia7v29r71ynp48l2qp5xsmnc4vgzmdxqdw2"))))
893 (build-system python-build-system)
894 (arguments
895 `(#:tests? #f ;XXX: Tests can only be run within the GitPython repository.
896 #:phases (modify-phases %standard-phases
897 (add-after 'unpack 'embed-git-reference
898 (lambda* (#:key inputs #:allow-other-keys)
899 (substitute* "git/cmd.py"
900 (("git_exec_name = \"git\"")
901 (string-append "git_exec_name = \""
902 (assoc-ref inputs "git")
903 "/bin/git\"")))
904 #t)))))
905 (inputs
906 `(("git" ,git)))
907 (propagated-inputs
908 `(("python-gitdb" ,python-gitdb)))
909 (native-inputs
910 `(("python-ddt" ,python-ddt)
911 ("python-nose" ,python-nose)))
912 (home-page "https://github.com/gitpython-developers/GitPython")
913 (synopsis "Python library for interacting with Git repositories")
914 (description
915 "GitPython is a python library used to interact with Git repositories,
916 high-level like git-porcelain, or low-level like git-plumbing.
917
918 It provides abstractions of Git objects for easy access of repository data,
919 and additionally allows you to access the Git repository more directly using
920 either a pure Python implementation, or the faster, but more resource intensive
921 @command{git} command implementation.")
922 (license license:bsd-3)))
923
924 (define-public python2-gitpython
925 (package-with-python2 python-gitpython))
926
927 (define-public shflags
928 (package
929 (name "shflags")
930 (version "1.2.3")
931 (source (origin
932 (method git-fetch)
933 (uri (git-reference
934 (url "https://github.com/kward/shflags.git")
935 (commit (string-append "v" version))))
936 (file-name (git-file-name name version))
937 (sha256
938 (base32
939 "1ydx0sb6vz9s2dgp5bd64y7fpzh9qvmlfjxrbmzac8saknijrlly"))))
940 (build-system gnu-build-system)
941 (arguments
942 `(#:tests? #f ; no tests
943 #:phases
944 (modify-phases %standard-phases
945 (delete 'configure) ; nothing to configure
946 (delete 'build) ; nothing to build
947 (replace 'install
948 (lambda* (#:key outputs #:allow-other-keys)
949 (let* ((out (assoc-ref outputs "out"))
950 (src (string-append out "/src")))
951 (install-file "shflags" src)
952 #t))))))
953 (home-page "https://github.com/kward/shflags")
954 (synopsis "Command-line flags library for shell scripts")
955 (description
956 "Shell Flags (shFlags) is a library written to greatly simplify the
957 handling of command-line flags in Bourne based Unix shell scripts (bash, dash,
958 ksh, sh, zsh). Most shell scripts use getopt for flags processing, but the
959 different versions of getopt on various OSes make writing portable shell
960 scripts difficult. shFlags instead provides an API that doesn't change across
961 shell and OS versions so the script writer can be confident that the script
962 will work.")
963 (license license:lgpl2.1)))
964
965 (define-public git-flow
966 (package
967 (name "git-flow")
968 ;; This version has not be officially released yet, so we build it
969 ;; directly from the git repository.
970 (version "0.4.2-pre")
971 (source (origin
972 (method git-fetch)
973 (uri (git-reference
974 (url "https://github.com/nvie/gitflow/")
975 (commit "15aab26490facf285acef56cb5d61025eacb3a69")))
976 (file-name (git-file-name name version))
977 (sha256
978 (base32
979 "01fs97q76fdfnvmrh2cyjhywcs3pykf1dg58sy0frflnsdzs6prx"))))
980 (build-system gnu-build-system)
981 (inputs `(("shflags" ,shflags)))
982 (arguments
983 '(#:tests? #f ; no tests
984 #:make-flags (list (string-append "prefix="
985 (assoc-ref %outputs "out")))
986 #:phases
987 (modify-phases %standard-phases
988 (add-after 'unpack 'reset-shFlags-link
989 (lambda* (#:key inputs #:allow-other-keys)
990 ;; The link points to a file in the shFlags submodule.
991 ;; Redirect it to point to our system shFlags.
992 (let ((shflags (assoc-ref inputs "shflags")))
993 (begin
994 (delete-file "gitflow-shFlags")
995 (symlink (string-append shflags "/src/shflags")
996 "gitflow-shFlags")))))
997 (delete 'configure)
998 (delete 'build))))
999 (home-page "http://nvie.com/posts/a-successful-git-branching-model/")
1000 (synopsis "Git extensions for Vincent Driessen's branching model")
1001 (description
1002 "Vincent Driessen's branching model is a git branching and release
1003 management strategy that helps developers keep track of features, hotfixes,
1004 and releases in bigger software projects. The git-flow library of git
1005 subcommands helps automate some parts of the flow to make working with it a
1006 lot easier.")
1007 (license license:bsd-2)))
1008
1009 (define-public stgit
1010 (package
1011 (name "stgit")
1012 (version "0.18")
1013 (source
1014 (origin
1015 (method git-fetch)
1016 (uri (git-reference
1017 (url "https://github.com/ctmarinas/stgit.git")
1018 (commit (string-append "v" version))))
1019 (file-name (git-file-name name version))
1020 (sha256
1021 (base32 "0ydgg744m671nkhg7h4q2z3b9vpbc9914rbc0wcgimqfqsxkxx2y"))))
1022 (build-system python-build-system)
1023 (inputs
1024 `(("git" ,git)))
1025 (arguments
1026 `(#:python ,python-2
1027 #:phases
1028 (modify-phases %standard-phases
1029 (replace 'check
1030 (lambda _
1031 ;; Two tests will fail -> disable them. TODO: fix the failing tests
1032 (delete-file "t/t3300-edit.sh")
1033 (delete-file "t/t7504-commit-msg-hook.sh")
1034 (invoke "make" "test"))))))
1035 (home-page "http://procode.org/stgit/")
1036 (synopsis "Stacked Git")
1037 (description
1038 "StGit is a command-line application that provides functionality similar
1039 to Quilt (i.e., pushing/popping patches to/from a stack), but using Git
1040 instead of @command{diff} and @command{patch}. StGit stores its patches in a
1041 Git repository as normal Git commits, and provides a number of commands to
1042 manipulate them in various ways.")
1043 (license license:gpl2)))
1044
1045 (define-public vcsh
1046 (package
1047 (name "vcsh")
1048 (version "1.20151229")
1049 (source
1050 (origin
1051 (method git-fetch)
1052 (uri (git-reference
1053 (url "https://github.com/RichiH/vcsh.git")
1054 (commit (string-append "v" version))))
1055 (file-name (git-file-name name version))
1056 (sha256
1057 (base32 "1grpj45nbpv4j60vd2kg4rj53zrm0bc0h9l4pfd3c2mwbvywm6ab"))))
1058 (build-system gnu-build-system)
1059 (native-inputs
1060 `(("which" ,which)))
1061 (inputs
1062 `(("git" ,git)
1063 ("perl" ,perl)
1064 ("perl-test-harness" ,perl-test-harness)
1065 ("perl-shell-command" ,perl-shell-command)
1066 ("perl-test-most" ,perl-test-most)))
1067 (arguments
1068 '(#:phases (modify-phases %standard-phases
1069 (delete 'configure)
1070 (delete 'build))
1071 #:make-flags (list (string-append "PREFIX="
1072 (assoc-ref %outputs "out")))
1073 #:test-target "test"))
1074 (home-page "https://github.com/RichiH/vcsh")
1075 (synopsis "Version control system for @code{$HOME}")
1076 (description
1077 "vcsh version-controls configuration files in several Git repositories,
1078 all in one single directory. They all maintain their working trees without
1079 clobbering each other or interfering otherwise. By default, all Git
1080 repositories maintained via vcsh store the actual files in @code{$HOME},
1081 though this can be overridden.")
1082 (license license:gpl2+)))
1083
1084 (define-public git-test-sequence
1085 (let ((commit "48e5a2f5a13a5f30452647237e23362b459b9c76"))
1086 (package
1087 (name "git-test-sequence")
1088 (version (string-append "20140312." (string-take commit 7)))
1089 (source (origin
1090 (method git-fetch)
1091 (uri (git-reference
1092 ;; There are many other scripts in this directory; we
1093 ;; are interested in just one for this package.
1094 (url "https://github.com/dustin/bindir")
1095 (commit commit)))
1096 (file-name (git-file-name name version))
1097 (sha256
1098 (base32
1099 "1dcq0y16yznbv4k9h8gg90kv1gkn8r8dbvl4m2rpfd7q5nqhn617"))))
1100 (build-system trivial-build-system)
1101 (arguments
1102 `(#:modules ((guix build utils))
1103 #:builder (begin
1104 (use-modules (guix build utils))
1105 (let* ((source (assoc-ref %build-inputs "source"))
1106 (output (assoc-ref %outputs "out"))
1107 (bindir (string-append output "/bin"))
1108 (script "git-test-sequence"))
1109 (install-file (string-append source "/" script)
1110 bindir)
1111 #t))))
1112 (home-page "http://dustin.sallings.org/2010/03/28/git-test-sequence.html")
1113 (synopsis "Run a command over a sequence of commits")
1114 (description
1115 "git-test-sequence is similar to an automated git bisect except it’s
1116 linear. It will test every change between two points in the DAG. It will
1117 also walk each side of a merge and test those changes individually.")
1118 (license (license:x11-style "file://LICENSE")))))
1119
1120 (define-public gitolite
1121 (package
1122 (name "gitolite")
1123 (version "3.6.7")
1124 (source
1125 (origin
1126 (method git-fetch)
1127 (uri (git-reference
1128 (url "https://github.com/sitaramc/gitolite.git")
1129 (commit (string-append "v" version))))
1130 (file-name (git-file-name name version))
1131 (sha256
1132 (base32 "0rmyzr66lxh2ildf3h1nh3hh2ndwk21rjdin50r5vhwbdd7jg8vb"))))
1133 (build-system gnu-build-system)
1134 (arguments
1135 '(#:tests? #f ; no tests
1136 #:phases (modify-phases %standard-phases
1137 (delete 'configure)
1138 (delete 'build)
1139 (add-before 'install 'patch-scripts
1140 (lambda* (#:key inputs #:allow-other-keys)
1141 (let ((perl (string-append (assoc-ref inputs "perl")
1142 "/bin/perl")))
1143 ;; This seems to take care of every shell script that
1144 ;; invokes Perl.
1145 (substitute* (find-files "." ".*")
1146 ((" perl -")
1147 (string-append " " perl " -")))
1148
1149 (substitute* (find-files "src/triggers" ".*")
1150 ((" sed ")
1151 (string-append " " (which "sed") " ")))
1152
1153 (substitute*
1154 '("src/triggers/post-compile/update-gitweb-access-list"
1155 "src/triggers/post-compile/ssh-authkeys-split"
1156 "src/triggers/upstream")
1157 ((" grep ")
1158 (string-append " " (which "grep") " ")))
1159
1160 ;; Avoid references to the store in authorized_keys.
1161 ;; This works because gitolite-shell is in the PATH.
1162 (substitute* "src/triggers/post-compile/ssh-authkeys"
1163 (("\\$glshell \\$user")
1164 "gitolite-shell $user"))
1165 #t)))
1166 (add-before 'install 'patch-source
1167 (lambda* (#:key inputs #:allow-other-keys)
1168 ;; Gitolite uses cat to test the readability of the
1169 ;; pubkey
1170 (substitute* "src/lib/Gitolite/Setup.pm"
1171 (("\"cat ")
1172 (string-append "\"" (which "cat") " "))
1173 (("\"ssh-keygen")
1174 (string-append "\"" (which "ssh-keygen"))))
1175
1176 (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
1177 "src/lib/Gitolite/Hooks/Update.pm")
1178 (("/usr/bin/perl")
1179 (string-append (assoc-ref inputs "perl")
1180 "/bin/perl")))
1181
1182 (substitute* "src/lib/Gitolite/Common.pm"
1183 (("\"ssh-keygen")
1184 (string-append "\"" (which "ssh-keygen")))
1185 (("\"logger\"")
1186 (string-append "\""
1187 (assoc-ref inputs "inetutils")
1188 "/bin/logger\"")))
1189
1190 #t))
1191 (replace 'install
1192 (lambda* (#:key outputs #:allow-other-keys)
1193 (let* ((output (assoc-ref outputs "out"))
1194 (sharedir (string-append output "/share/gitolite"))
1195 (bindir (string-append output "/bin")))
1196 (mkdir-p sharedir)
1197 (mkdir-p bindir)
1198 (invoke "./install" "-to" sharedir)
1199 ;; Create symlinks for executable scripts in /bin.
1200 (for-each (lambda (script)
1201 (symlink (string-append sharedir "/" script)
1202 (string-append bindir "/" script)))
1203 '("gitolite" "gitolite-shell"))
1204 #t)))
1205 (add-after 'install 'wrap-scripts
1206 (lambda* (#:key inputs outputs #:allow-other-keys)
1207 (let ((out (assoc-ref outputs "out"))
1208 (coreutils (assoc-ref inputs "coreutils"))
1209 (findutils (assoc-ref inputs "findutils"))
1210 (git (assoc-ref inputs "git")))
1211 (wrap-program (string-append out "/bin/gitolite")
1212 `("PATH" ":" prefix
1213 ,(map (lambda (dir)
1214 (string-append dir "/bin"))
1215 (list out coreutils findutils git))))
1216 #t))))))
1217 (inputs
1218 `(("perl" ,perl)
1219 ("coreutils" ,coreutils)
1220 ("findutils" ,findutils)
1221 ("inetutils" ,inetutils)))
1222 ;; git and openssh are propagated because trying to patch the source via
1223 ;; regexp matching is too brittle and prone to false positives.
1224 (propagated-inputs
1225 `(("git" ,git)
1226 ("openssh" ,openssh)))
1227 (home-page "http://gitolite.com")
1228 (synopsis "Git access control layer")
1229 (description
1230 "Gitolite is an access control layer on top of Git, providing fine access
1231 control to Git repositories.")
1232 (license license:gpl2)))
1233
1234 (define-public mercurial
1235 (package
1236 (name "mercurial")
1237 (version "5.0.2")
1238 (source (origin
1239 (method url-fetch)
1240 (uri (string-append "https://www.mercurial-scm.org/"
1241 "release/mercurial-" version ".tar.gz"))
1242 (sha256
1243 (base32
1244 "1y60hfc8gh4ha9sw650qs7hndqmvbn0qxpmqwpn4q18z5xwm1f19"))))
1245 (build-system python-build-system)
1246 (arguments
1247 `(;; Restrict to Python 2, as Python 3 would require
1248 ;; the argument --c2to3.
1249 #:python ,python-2
1250 ;; FIXME: Disabled tests because they require the nose unit
1251 ;; testing framework: https://nose.readthedocs.org/en/latest/ .
1252 #:tests? #f))
1253 (home-page "https://www.mercurial-scm.org/")
1254 (synopsis "Decentralized version control system")
1255 (description
1256 "Mercurial is a free, distributed source control management tool.
1257 It efficiently handles projects of any size
1258 and offers an easy and intuitive interface.")
1259 (license license:gpl2+)))
1260
1261 (define-public neon
1262 (package
1263 (name "neon")
1264 (version "0.30.2")
1265 (source (origin
1266 (method url-fetch)
1267 (uri (string-append "http://www.webdav.org/neon/neon-"
1268 version ".tar.gz"))
1269 (sha256
1270 (base32
1271 "1jpvczcx658vimqm7c8my2q41fnmjaf1j03g7bsli6rjxk6xh2yv"))))
1272 (build-system gnu-build-system)
1273 (native-inputs
1274 `(("perl" ,perl)
1275 ("pkg-config" ,pkg-config)))
1276 (inputs
1277 `(("libxml2" ,libxml2)
1278 ("openssl" ,openssl)
1279 ("zlib" ,zlib)))
1280 (arguments
1281 `(;; FIXME: Add tests once reverse address lookup is fixed in glibc, see
1282 ;; https://sourceware.org/bugzilla/show_bug.cgi?id=16475
1283 #:tests? #f
1284 #:configure-flags '("--enable-shared"
1285 ;; requires libgnutils-config, deprecated
1286 ;; in gnutls 2.8.
1287 ; "--with-ssl=gnutls")))
1288 "--with-ssl=openssl")))
1289 (home-page "http://www.webdav.org/neon/")
1290 (synopsis "HTTP and WebDAV client library")
1291 (description
1292 "Neon is an HTTP and WebDAV client library, with a C interface and the
1293 following features:
1294 @enumerate
1295 @item High-level wrappers for common HTTP and WebDAV operations (GET, MOVE,
1296 DELETE, etc.);
1297 @item low-level interface to the HTTP request/response engine, allowing the use
1298 of arbitrary HTTP methods, headers, etc.;
1299 @item authentication support including Basic and Digest support, along with
1300 GSSAPI-based Negotiate on Unix, and SSPI-based Negotiate/NTLM on Win32;
1301 @item SSL/TLS support using OpenSSL or GnuTLS, exposing an abstraction layer for
1302 verifying server certificates, handling client certificates, and examining
1303 certificate properties, smartcard-based client certificates are also
1304 supported via a PKCS#11 wrapper interface;
1305 @item abstract interface to parsing XML using libxml2 or expat, and wrappers for
1306 simplifying handling XML HTTP response bodies;
1307 @item WebDAV metadata support, wrappers for PROPFIND and PROPPATCH to simplify
1308 property manipulation.
1309 @end enumerate\n")
1310 (license license:gpl2+))) ; for documentation and tests; source under lgpl2.0+
1311
1312 (define-public subversion
1313 (package
1314 (name "subversion")
1315 (version "1.10.6")
1316 (source (origin
1317 (method url-fetch)
1318 (uri
1319 (list
1320 (string-append "https://archive.apache.org/dist/subversion/"
1321 "subversion-" version ".tar.bz2")
1322 (string-append "https://www-eu.apache.org/dist/subversion/"
1323 "subversion-" version ".tar.bz2")))
1324 (sha256
1325 (base32
1326 "19zc215mhpnm92mlyl5jbv57r5zqp6cavr3s2g9yglp6j4kfgj0q"))))
1327 (build-system gnu-build-system)
1328 (arguments
1329 '(#:phases
1330 (modify-phases %standard-phases
1331 (add-after 'configure 'patch-libtool-wrapper-ls
1332 (lambda* (#:key inputs #:allow-other-keys)
1333 ;; This substitution allows tests svnauthz_tests and svnlook_tests
1334 ;; to pass. These tests execute svnauthz and svnlook through
1335 ;; their libtool wrapper scripts from svn hooks, whose empty
1336 ;; environments cause "ls: command not found" errors. It would be
1337 ;; nice if this fix ultimately made its way into libtool.
1338 (let ((coreutils (assoc-ref inputs "coreutils")))
1339 (substitute* "libtool"
1340 (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls")))
1341 #t)))
1342 (add-before 'build 'patch-test-sh
1343 (lambda _
1344 (substitute* "subversion/tests/libsvn_repos/repos-test.c"
1345 (("#!/bin/sh") (string-append "#!" (which "sh"))))
1346 #t))
1347 (add-after 'install 'install-perl-bindings
1348 (lambda* (#:key outputs #:allow-other-keys)
1349 ;; Follow the instructions from 'subversion/bindings/swig/INSTALL'.
1350 (let ((out (assoc-ref outputs "out")))
1351 (invoke "make" "swig-pl-lib")
1352 ;; FIXME: Test failures.
1353 ;; (invoke "make" "check-swig-pl")
1354 (invoke "make" "install-swig-pl-lib")
1355
1356 ;; Set the right installation prefix.
1357 (with-directory-excursion
1358 "subversion/bindings/swig/perl/native"
1359 (invoke "perl" "Makefile.PL"
1360 "NO_PERLLOCAL=1"
1361 (string-append "PREFIX=" out))
1362 (invoke "make" "install"
1363 (string-append "OTHERLDFLAGS="
1364 "-Wl,-rpath="
1365 out "/lib")))))))))
1366 (native-inputs
1367 `(("pkg-config" ,pkg-config)
1368 ;; For the Perl bindings.
1369 ("swig" ,swig)))
1370 (inputs
1371 `(("apr" ,apr)
1372 ("apr-util" ,apr-util)
1373 ("lz4" ,lz4)
1374 ("serf" ,serf)
1375 ("perl" ,perl)
1376 ("python" ,python-wrapper)
1377 ("sqlite" ,sqlite)
1378 ("utf8proc" ,utf8proc)
1379 ("zlib" ,zlib)))
1380 (home-page "https://subversion.apache.org/")
1381 (synopsis "Revision control system")
1382 (description
1383 "@dfn{Subversion} (svn) exists to be recognized and adopted as a
1384 centralized version control system characterized by its
1385 reliability as a safe haven for valuable data; the simplicity of its model and
1386 usage; and its ability to support the needs of a wide variety of users and
1387 projects, from individuals to large-scale enterprise operations.")
1388 (license license:asl2.0)))
1389
1390 (define-public rcs
1391 (package
1392 (name "rcs")
1393 (version "5.9.4")
1394 (source (origin
1395 (method url-fetch)
1396 (uri (string-append "mirror://gnu/rcs/rcs-"
1397 version ".tar.xz"))
1398 (sha256
1399 (base32
1400 "1zsx7bb0rgvvvisiy4zlixf56ay8wbd9qqqcp1a1g0m1gl6mlg86"))
1401 (patches (search-patches "rcs-5.9.4-noreturn.patch"))))
1402 (build-system gnu-build-system)
1403 (native-inputs `(("ed" ,ed)))
1404 (arguments
1405 `(#:phases (modify-phases %standard-phases
1406 (add-before 'check 'disable-t810
1407 ;; See https://savannah.gnu.org/bugs/index.php?52288
1408 ;; Back-porting the fix is non-trivial, so disable for now.
1409 (lambda _
1410 (substitute* "tests/Makefile"
1411 ((" t810 \\\\\n") ""))
1412 #t)))))
1413 (home-page "https://www.gnu.org/software/rcs/")
1414 (synopsis "Per-file local revision control system")
1415 (description
1416 "RCS is the original Revision Control System. It works on a
1417 file-by-file basis, in contrast to subsequent version control systems such as
1418 CVS, Subversion, and Git. This can make it suitable for system
1419 administration files, for example, which are often inherently local to one
1420 machine.")
1421 (license license:gpl3+)))
1422
1423 (define-public cvs
1424 (package
1425 (name "cvs")
1426 (version "1.12.13")
1427 (source (origin
1428 (method url-fetch)
1429 (uri (string-append
1430 "https://ftp.gnu.org/non-gnu/cvs/source/feature/"
1431 version "/cvs-" version ".tar.bz2"))
1432 (patches (search-patches "cvs-CVE-2017-12836.patch"))
1433 (sha256
1434 (base32
1435 "0pjir8cwn0087mxszzbsi1gyfc6373vif96cw4q3m1x6p49kd1bq"))))
1436 (build-system gnu-build-system)
1437 (arguments
1438 ;; XXX: The test suite looks flawed, and the package is obsolete anyway.
1439 '(#:tests? #f
1440 #:configure-flags (list "--with-external-zlib")))
1441 (inputs `(("zlib" ,zlib)
1442 ("nano" ,nano))) ; the default editor
1443 (home-page "http://cvs.nongnu.org")
1444 (synopsis "Historical centralized version control system")
1445 (description
1446 "CVS is a version control system, an important component of Source
1447 Configuration Management (SCM). Using it, you can record the history of
1448 sources files, and documents. It fills a similar role to the free software
1449 RCS, PRCS, and Aegis packages.")
1450 (license license:gpl1+)))
1451
1452 (define-public cvs-fast-export
1453 (package
1454 (name "cvs-fast-export")
1455 (version "1.45")
1456 (source (origin
1457 (method url-fetch)
1458 (uri (string-append "http://www.catb.org/~esr/cvs-fast-export/"
1459 "cvs-fast-export-" version ".tar.gz"))
1460 (sha256
1461 (base32
1462 "19pxg6p0pcgyd2fbnh3wy1kazv6vcfi5lzc2whhdi1w9kj4r9c4z"))))
1463 (build-system gnu-build-system)
1464 (arguments
1465 '(#:phases
1466 (modify-phases %standard-phases
1467 (delete 'configure) ; no configure script
1468 (add-after 'unpack 'remove-optimizations
1469 (lambda _
1470 ;; Don't optimize for a specific processor architecture.
1471 (substitute* "Makefile"
1472 (("CFLAGS \\+= -march=native") ""))
1473 #t)))
1474 #:parallel-build? #f ; parallel a2x commands fail spectacularly
1475 #:make-flags
1476 (list "CC=gcc" (string-append "prefix?=" (assoc-ref %outputs "out")))))
1477 (inputs `(("git" ,git)))
1478 (native-inputs `(("asciidoc" ,asciidoc)
1479 ;; These are needed for the tests.
1480 ("cvs" ,cvs)
1481 ("python" ,python-2)
1482 ("rcs" ,rcs)))
1483 (home-page "http://www.catb.org/esr/cvs-fast-export/")
1484 (synopsis "Export an RCS or CVS history as a fast-import stream")
1485 (description "This program analyzes a collection of RCS files in a CVS
1486 repository (or outside of one) and, when possible, emits an equivalent history
1487 in the form of a fast-import stream. Not all possible histories can be
1488 rendered this way; the program tries to emit useful warnings when it can't.
1489
1490 The program can also produce a visualization of the resulting commit directed
1491 acyclic graph (DAG) in the input format of @uref{http://www.graphviz.org,
1492 Graphviz}. The package also includes @command{cvssync}, a tool for mirroring
1493 masters from remote CVS hosts.")
1494 (license license:gpl2+)))
1495
1496 (define-public vc-dwim
1497 (package
1498 (name "vc-dwim")
1499 (version "1.8")
1500 (source (origin
1501 (method url-fetch)
1502 (uri (string-append "mirror://gnu/vc-dwim/vc-dwim-"
1503 version ".tar.xz"))
1504 (sha256
1505 (base32
1506 "0d5sqafc40l878m8wjr35jxmalj4kam1m6ph60v08ng4ml5g7931"))))
1507 (build-system gnu-build-system)
1508 (inputs `(("perl" ,perl)
1509 ("inetutils" ,inetutils))) ; for `hostname', used in the tests
1510 (native-inputs `(("emacs" ,emacs-minimal))) ; for `ctags'
1511 (home-page "https://www.gnu.org/software/vc-dwim/")
1512 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
1513 (description
1514 "The vc-dwim package contains two tools, \"vc-dwim\" and \"vc-chlog\".
1515 vc-dwim is a tool that simplifies the task of maintaining a ChangeLog and
1516 using version control at the same time, for example by printing a reminder
1517 when a file change has been described in the ChangeLog but the file has not
1518 been added to the VC. vc-chlog scans changed files and generates
1519 standards-compliant ChangeLog entries based on the changes that it detects.")
1520 (license license:gpl3+)))
1521
1522 (define-public diffstat
1523 (package
1524 (name "diffstat")
1525 (version "1.62")
1526 (source (origin
1527 (method url-fetch)
1528 (uri
1529 (list
1530 (string-append "ftp://invisible-island.net/diffstat/"
1531 name "-" version ".tgz")
1532 (string-append "http://invisible-mirror.net/archives/diffstat/"
1533 name "-" version ".tgz")))
1534 (sha256
1535 (base32
1536 "07sr482y6iw7n7ddkba0w51kbjc99snvnijkn5ba2xzd8hv1h2bz"))))
1537 (build-system gnu-build-system)
1538 (home-page "https://invisible-island.net/diffstat/")
1539 (synopsis "Make histograms from the output of @command{diff}")
1540 (description
1541 "Diffstat reads the output of @command{diff} and displays a histogram of
1542 the insertions, deletions, and modifications per file. It is useful for
1543 reviewing large, complex patch files.")
1544 (license (license:x11-style "file://COPYING"))))
1545
1546 (define-public cssc
1547 (package
1548 (name "cssc")
1549 (version "1.4.1")
1550 (source (origin
1551 (method url-fetch)
1552 (uri (string-append "mirror://gnu/" name "/CSSC-"
1553 version ".tar.gz"))
1554 (sha256
1555 (base32
1556 "1vsisqq573xjr2qpn19iwmpqgl3mq03m790akpa4rvj60b4d1gni"))))
1557 (build-system gnu-build-system)
1558 (arguments
1559 `(#:phases
1560 (modify-phases %standard-phases
1561 (add-before 'check 'precheck
1562 (lambda _
1563 (begin
1564 (substitute* "tests/common/test-common"
1565 (("/bin/pwd") (which "pwd")))
1566
1567 (substitute* "tests/prt/all-512.sh"
1568 (("/bin/sh") (which "sh")))
1569
1570 ;; XXX: This test has no hope of passing until there is a "nogroup"
1571 ;; entry (or at least some group to which the guix builder does
1572 ;; not belong) in the /etc/group file of the build environment.
1573 ;; Currently we do not have such a group. Disable this test for now.
1574 (substitute* "tests/Makefile"
1575 (("test-delta ") ""))))))))
1576 ;; These are needed for the tests
1577 (native-inputs `(("git" ,git)
1578 ("cvs" ,cvs)))
1579 (home-page "https://www.gnu.org/software/cssc/")
1580 (synopsis "File-based version control like SCCS")
1581 (description "GNU CSSC provides a replacement for the legacy Unix source
1582 code control system SCCS. This allows old code still under that system to be
1583 accessed and migrated on modern systems.")
1584 (license license:gpl3+)))
1585
1586 ;; This package can unfortunately work only in -TEST mode, since Aegis
1587 ;; requires that it is installed setuid root.
1588 (define-public aegis
1589 (package
1590 (name "aegis")
1591 (version "4.24")
1592 (source (origin
1593 (method url-fetch)
1594 (uri (string-append "mirror://sourceforge/aegis/aegis/" version
1595 "/aegis-" version ".tar.gz"))
1596 (sha256
1597 (base32
1598 "18s86ssarfmc4l17gbpzybca29m5wa37cbaimdji8czlcry3mcjl"))
1599 (patches (search-patches "aegis-perl-tempdir1.patch"
1600 "aegis-perl-tempdir2.patch"
1601 "aegis-test-fixup-1.patch"
1602 "aegis-test-fixup-2.patch"
1603 "aegis-constness-error.patch"))))
1604 (build-system gnu-build-system)
1605 (inputs
1606 `(("e2fsprogs" ,e2fsprogs)
1607 ("curl" ,curl)
1608 ("file" ,file)
1609 ("libxml2" ,libxml2)
1610 ("zlib" ,zlib)
1611 ("gettext" ,gettext-minimal)))
1612 (native-inputs
1613 `(("bison" ,bison)
1614 ("groff" ,groff)
1615 ("perl" ,perl)
1616 ;; Various tests require the following:
1617 ("cvs" ,cvs)
1618 ("flex" ,flex)
1619 ("cook" ,cook)
1620 ("subversion" ,subversion)
1621 ("rcs" ,rcs)
1622 ("ed" ,ed)))
1623 (arguments
1624 `(#:configure-flags (list "--with-no-aegis-configured"
1625 "--sharedstatedir=/var/com/aegis")
1626 #:parallel-build? #f ; There are some nasty racy rules in the Makefile.
1627 #:phases
1628 (modify-phases %standard-phases
1629 (add-before 'configure 'pre-conf
1630 (lambda _
1631 (substitute* (append '("configure"
1632 "etc/check-tar-gz.sh"
1633 "etc/patches.sh"
1634 "etc/test.sh"
1635 "script/aexver.in"
1636 "script/aebisect.in"
1637 "script/aeintegratq.in"
1638 "script/tkaegis.in"
1639 "script/test_funcs.in"
1640 "web/eg_oss_templ.sh"
1641 "web/webiface.html"
1642 "libaegis/getpw_cache.cc")
1643 (find-files "test" "\\.sh"))
1644 (("/bin/sh") (which "sh")))
1645 (setenv "SH" (which "sh"))
1646 #t))
1647 (replace 'check
1648 (lambda _
1649 (let ((home (string-append (getcwd) "/my-new-home")))
1650 ;; Some tests need to write to $HOME.
1651 (mkdir home)
1652 (setenv "HOME" home)
1653
1654 ;; This test assumes that flex has been symlinked to "lex".
1655 (substitute* "test/00/t0011a.sh"
1656 (("type lex") "type flex"))
1657
1658 ;; XXX Disable tests that fail, for unknown reasons, ‘for now’.
1659 (for-each
1660 (lambda (test) (substitute* "Makefile"
1661 (((string-append "test/" test "\\.ES ")) "")))
1662 (list "00/t0011a"
1663 "00/t0049a"
1664 "01/t0196a"))
1665
1666 ;; The author decided to call the check rule "sure".
1667 (invoke "make" "sure")))))))
1668 (home-page "http://aegis.sourceforge.net")
1669 (synopsis "Project change supervisor")
1670 (description "Aegis is a project change supervisor, and performs some of
1671 the Software Configuration Management needed in a CASE environment. Aegis
1672 provides a framework within which a team of developers may work on many
1673 changes to a program independently, and Aegis coordinates integrating these
1674 changes back into the master source of the program, with as little disruption
1675 as possible. Resolution of contention for source files, a major headache for
1676 any project with more than one developer, is one of Aegis's major functions.")
1677 (license license:gpl3+)))
1678
1679 (define-public reposurgeon
1680 (package
1681 (name "reposurgeon")
1682 (version "3.43")
1683 (source (origin
1684 (method url-fetch)
1685 (uri (string-append "http://www.catb.org/~esr/" name "/"
1686 name "-" version ".tar.xz"))
1687 (sha256
1688 (base32
1689 "1af0z14wcm4bk5a9ysinbwq2fp3lf5f7i8mvwh7286hr3fnagcaz"))
1690 (patches (search-patches
1691 "reposurgeon-add-missing-docbook-files.patch"))))
1692 (build-system gnu-build-system)
1693 (arguments
1694 `(#:make-flags
1695 (list "ECHO=echo"
1696 (string-append "target=" (assoc-ref %outputs "out")))
1697 #:phases
1698 (modify-phases %standard-phases
1699 (add-after 'unpack 'patch-inputs
1700 (lambda* (#:key inputs #:allow-other-keys)
1701 (let ((tzdata (assoc-ref inputs "tzdata")))
1702 (substitute* "reposurgeon"
1703 (("/usr/share/zoneinfo")
1704 (string-append tzdata "/share/zoneinfo")))
1705 (substitute* "test/svn-to-svn"
1706 (("/bin/echo") "echo"))
1707 #t)))
1708 (delete 'configure) ; no configure script
1709 (add-before 'build 'fix-docbook
1710 (lambda* (#:key inputs #:allow-other-keys)
1711 (substitute* (find-files "." "\\.xml$")
1712 (("docbook/docbookx.dtd")
1713 (string-append (assoc-ref inputs "docbook-xml")
1714 "/xml/dtd/docbook/docbookx.dtd")))
1715 #t))
1716 (add-before 'check 'set-up-test-environment
1717 (lambda* (#:key inputs #:allow-other-keys)
1718 (let ((tzdata (assoc-ref inputs "tzdata")))
1719 (setenv "TZDIR" (string-append tzdata "/share/zoneinfo"))
1720 #t)))
1721 (add-after 'install 'install-emacs-data
1722 (lambda* (#:key outputs #:allow-other-keys)
1723 (install-file "reposurgeon-mode.el"
1724 (string-append (assoc-ref outputs "out")
1725 "/share/emacs/site-lisp"))
1726 #t)))))
1727 (inputs
1728 `(("python" ,python-wrapper)
1729 ("tzdata" ,tzdata)))
1730 (native-inputs
1731 `( ;; For building documentation.
1732 ("asciidoc" ,asciidoc)
1733 ("docbook-xml" ,docbook-xml)
1734 ("docbook-xsl" ,docbook-xsl)
1735 ("libxml2" ,libxml2)
1736 ("xmlto" ,xmlto)
1737
1738 ;; For tests.
1739 ("cvs" ,cvs)
1740 ("git" ,git)
1741 ("mercurial" ,mercurial)
1742 ("subversion" ,subversion)))
1743 (home-page "http://www.catb.org/~esr/reposurgeon/")
1744 (synopsis "Edit version-control repository history")
1745 (description "Reposurgeon enables risky operations that version-control
1746 systems don't want to let you do, such as editing past comments and metadata
1747 and removing commits. It works with any version control system that can
1748 export and import Git fast-import streams, including Git, Mercurial, Fossil,
1749 Bazaar, CVS, RCS, and Src. It can also read Subversion dump files directly
1750 and can thus be used to script production of very high-quality conversions
1751 from Subversion to any supported Distributed Version Control System (DVCS).")
1752 ;; Most files are distributed under bsd-2, except 'repocutter' which is
1753 ;; under bsd-3.
1754 (license (list license:bsd-2 license:bsd-3))))
1755
1756 (define-public tig
1757 (package
1758 (name "tig")
1759 (version "2.4.1")
1760 (source (origin
1761 (method url-fetch)
1762 (uri (string-append
1763 "https://github.com/jonas/tig/releases/download/tig-"
1764 version "/tig-" version ".tar.gz"))
1765 (sha256
1766 (base32
1767 "1f2qhpzbl7f35lsjcnx8lxzskha24m4frczsw78284jp7qcamdmn"))))
1768 (build-system gnu-build-system)
1769 (native-inputs
1770 `(("asciidoc" ,asciidoc)
1771 ("xmlto" ,xmlto)))
1772 (inputs
1773 `(("ncurses" ,ncurses)
1774 ("readline" ,readline)))
1775 (arguments
1776 `(#:phases
1777 (modify-phases %standard-phases
1778 (add-after 'install 'install-doc
1779 (lambda _
1780 (invoke "make" "install-doc"))))
1781 #:tests? #f)) ; tests require access to /dev/tty
1782 ;; #:test-target "test"))
1783 (home-page "https://jonas.github.io/tig/")
1784 (synopsis "Ncurses-based text user interface for Git")
1785 (description
1786 "Tig is an ncurses text user interface for Git, primarily intended as
1787 a history browser. It can also stage hunks for commit, or colorize the
1788 output of the @code{git} command.")
1789 (license license:gpl2+)))
1790
1791 (define-public findnewest
1792 (package
1793 (name "findnewest")
1794 (version "0.3")
1795 (source
1796 (origin
1797 (method git-fetch)
1798 (uri (git-reference
1799 (url "https://github.com/0-wiz-0/findnewest.git")
1800 (commit (string-append "findnewest-" version))))
1801 (file-name (git-file-name name version))
1802 (sha256
1803 (base32 "1x1cbn2b27h5r0ah5xc06fkalfdci2ngrgd4wibxjw0h88h0nvgq"))))
1804 (build-system gnu-build-system)
1805 (native-inputs `(("autoconf" ,autoconf)
1806 ("automake" ,automake)))
1807 (home-page "https://github.com/0-wiz-0/findnewest/releases")
1808 (synopsis "Print the modification time of the latest file")
1809 (description
1810 "Recursively find the newest file in a file tree and print its
1811 modification time.")
1812 (license license:bsd-2)))
1813
1814 (define-public myrepos
1815 (package
1816 (name "myrepos")
1817 (version "1.20180726")
1818 (source
1819 (origin
1820 (method git-fetch)
1821 (uri (git-reference
1822 (url "git://myrepos.branchable.com/myrepos")
1823 (commit version)))
1824 (file-name (string-append name "-" version "-checkout"))
1825 (sha256
1826 (base32 "0jphw61plm8cgklja6hs639xhdvxgvjwbr6jpvjwpp7hc5gmhms5"))))
1827 (build-system gnu-build-system)
1828 (arguments
1829 '(#:test-target "test"
1830 #:make-flags (list (string-append "PREFIX=" %output))
1831 #:phases
1832 (modify-phases %standard-phases
1833 (delete 'configure)
1834 (add-after 'install 'wrap-webcheckout
1835 (lambda* (#:key inputs outputs #:allow-other-keys)
1836 (let ((out (assoc-ref outputs "out")))
1837 (wrap-program (string-append out "/bin/webcheckout")
1838 `("PERL5LIB" ":" prefix
1839 ,(map (lambda (i) (string-append (assoc-ref inputs i)
1840 "/lib/perl5/site_perl"))
1841 '("perl-encode-locale" "perl-http-date"
1842 "perl-http-message" "perl-html-parser" "perl-libwww"
1843 "perl-uri" "perl-try-tiny"))))
1844 #t))))))
1845 (inputs
1846 `(("perl" ,perl)
1847 ("perl-encode-locale" ,perl-encode-locale)
1848 ("perl-html-parser" ,perl-html-parser)
1849 ("perl-http-date" ,perl-http-date)
1850 ("perl-http-message" ,perl-http-message)
1851 ("perl-libwww" ,perl-libwww)
1852 ("perl-try-tiny" ,perl-try-tiny)
1853 ("perl-uri" ,perl-uri)))
1854 (home-page "https://myrepos.branchable.com/")
1855 (synopsis "Multiple repository management tool")
1856 (description
1857 "Myrepos provides the @code{mr} command, which maps an operation (e.g.,
1858 fetching updates) over a collection of version control repositories. It
1859 supports a large number of version control systems: Git, Subversion,
1860 Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
1861 (license license:gpl2+)))
1862
1863 (define-public git-annex-remote-hubic
1864 (package
1865 (name "git-annex-remote-hubic")
1866 (version "0.3.1")
1867 (source
1868 (origin
1869 (method git-fetch)
1870 (uri (git-reference
1871 (url "https://github.com/Schnouki/git-annex-remote-hubic.git")
1872 (commit (string-append "v" version))))
1873 (file-name (git-file-name name version))
1874 (sha256
1875 (base32 "16y9sk67hfi17h9n2kkffyabfccksh5rab40hhk69v6cxmbpn2sx"))))
1876 (build-system python-build-system)
1877 (arguments `(#:python ,python-2))
1878 (native-inputs
1879 `(;; for the tests
1880 ("python2-six" ,python2-six)))
1881 (propagated-inputs
1882 `(("python2-dateutil" ,python2-dateutil)
1883 ("python2-futures" ,python2-futures)
1884 ("python2-rauth" ,python2-rauth)
1885 ("python2-swiftclient" ,python2-swiftclient)))
1886 (home-page "https://github.com/Schnouki/git-annex-remote-hubic/")
1887 (synopsis "Use hubic as a git-annex remote")
1888 (description
1889 "This package allows you to use your hubic account as a \"special
1890 repository\" with git-annex.")
1891 (license license:gpl3+)))
1892
1893 (define-public git-annex-remote-rclone
1894 (package
1895 (name "git-annex-remote-rclone")
1896 (version "0.6")
1897 (source
1898 (origin
1899 (method git-fetch)
1900 (uri (git-reference
1901 (url "https://github.com/DanielDent/git-annex-remote-rclone.git")
1902 (commit (string-append "v" version))))
1903 (file-name (git-file-name name version))
1904 (sha256
1905 (base32
1906 "0j0hlxji8d974fq7zd4xc02n0jpi31ylhxc7z4zp8iiwad5mkpxp"))))
1907 (build-system trivial-build-system)
1908 (arguments
1909 `(#:modules ((guix build utils))
1910 #:builder
1911 (begin
1912 (use-modules (guix build utils))
1913 (let ((bash (string-append (assoc-ref %build-inputs "bash")
1914 "/bin/bash"))
1915 (rclone (string-append (assoc-ref %build-inputs "rclone")
1916 "/bin/rclone")))
1917 (copy-file (string-append (assoc-ref %build-inputs "source")
1918 "/git-annex-remote-rclone")
1919 "git-annex-remote-rclone")
1920 (substitute* "git-annex-remote-rclone"
1921 (("/bin/bash") bash)
1922 (("runcmd rclone") (string-append "runcmd " rclone)))
1923 (install-file "git-annex-remote-rclone"
1924 (string-append %output "/bin"))
1925 #t))))
1926 (inputs
1927 `(("bash" ,bash)
1928 ("rclone" ,rclone)))
1929 (home-page "https://github.com/DanielDent/git-annex-remote-rclone")
1930 (synopsis "Use rclone-supported cloud storage providers with git-annex")
1931 (description "This wrapper around rclone makes any destination supported
1932 by rclone usable with git-annex.")
1933 (license license:gpl3+)))
1934
1935 (define-public fossil
1936 (package
1937 (name "fossil")
1938 (version "2.8")
1939 (source
1940 (origin
1941 (method url-fetch)
1942 ;; Older downloads are moved to another URL.
1943 (uri (list
1944 (string-append
1945 "https://www.fossil-scm.org/index.html/uv/download/"
1946 "fossil-src-" version ".tar.gz")
1947 (string-append
1948 "https://www.fossil-scm.org/index.html/uv/"
1949 "fossil-src-" version ".tar.gz")))
1950 (sha256
1951 (base32
1952 "0pbinf8d2kj1j7niblhzjd2l2khg6r2pn2xvig6gavz27p3vwcka"))
1953 (modules '((guix build utils)))
1954 (snippet
1955 '(begin
1956 (delete-file-recursively "compat") #t))))
1957 (build-system gnu-build-system)
1958 (native-inputs
1959 `(("tcl" ,tcl) ;for configuration only
1960 ("which" ,which) ;for tests only
1961 ("ed" ,ed))) ;ditto
1962 (inputs
1963 `(("openssl" ,openssl)
1964 ("zlib" ,zlib)
1965 ("sqlite" ,sqlite)))
1966 (arguments
1967 `(#:configure-flags (list "--with-openssl=auto"
1968 "--disable-internal-sqlite")
1969 #:test-target "test"
1970 #:phases (modify-phases %standard-phases
1971 (add-after 'patch-source-shebangs 'patch-sh
1972 (lambda _
1973 (substitute* '("auto.def")
1974 (("/bin/sh") (which "sh")))
1975 #t))
1976 (replace 'configure
1977 (lambda* (#:key outputs (configure-flags '())
1978 #:allow-other-keys)
1979 ;; The 'configure' script is not an autoconf script and
1980 ;; chokes on unrecognized options.
1981 (apply invoke
1982 "./configure"
1983 (string-append "--prefix="
1984 (assoc-ref outputs "out"))
1985 configure-flags)
1986 #t))
1987 (add-before 'check 'test-setup
1988 (lambda _
1989 (setenv "USER" "guix")
1990 (setenv "TZ" "UTC")
1991 #t)))))
1992 (home-page "https://fossil-scm.org")
1993 (synopsis "Software configuration management system")
1994 (description
1995 "Fossil is a distributed source control management system which supports
1996 access and administration over HTTP CGI or via a built-in HTTP server. It has
1997 a built-in wiki, built-in file browsing, built-in tickets system, etc.")
1998 (license (list license:public-domain ;src/miniz.c, src/shell.c
1999 license:bsd-2))))
2000
2001 (define-public stagit
2002 (package
2003 (name "stagit")
2004 (version "0.7.2")
2005 (source (origin
2006 (method url-fetch)
2007 (uri (string-append "https://dl.2f30.org/releases/"
2008 name "-" version ".tar.gz"))
2009 (sha256
2010 (base32
2011 "1m3s9g1z9szbjrhm8sic91xh6f2bfpi56rskdkqd5wc4wdycpyi5"))))
2012 (build-system gnu-build-system)
2013 (arguments
2014 `(#:tests? #f ; No tests
2015 #:make-flags (list "CC=gcc"
2016 (string-append "PREFIX=" %output))
2017 #:phases
2018 (modify-phases %standard-phases
2019 (delete 'configure)))) ; No configure script
2020 (inputs
2021 `(("libgit2" ,libgit2)))
2022 (home-page "https://2f30.org/")
2023 (synopsis "Static git page generator")
2024 (description "Stagit creates static pages for git repositories, the results can
2025 be served with a HTTP file server of your choice.")
2026 (license license:expat)))
2027
2028 (define-public gource
2029 (package
2030 (name "gource")
2031 (version "0.49")
2032 (source (origin
2033 (method url-fetch)
2034 (uri (string-append
2035 "https://github.com/acaudwell/Gource/releases/download"
2036 "/gource-" version "/gource-" version ".tar.gz"))
2037 (sha256
2038 (base32
2039 "12hf5ipcsp9dxsqn84n4kr63xaiskrnf5a084wr29qk171lj7pd9"))))
2040 (build-system gnu-build-system)
2041 (arguments
2042 `(#:configure-flags
2043 (list (string-append "--with-boost-libdir="
2044 (assoc-ref %build-inputs "boost")
2045 "/lib"))))
2046 (native-inputs
2047 `(("pkg-config" ,pkg-config)))
2048 (inputs
2049 `(("boost" ,boost)
2050 ("ftgl" ,ftgl)
2051 ("glew" ,glew)
2052 ("glm" ,glm)
2053 ("glu" ,glu)
2054 ("libpng" ,libpng)
2055 ("mesa" ,mesa)
2056 ("pcre" ,pcre)
2057 ("sdl-union" ,(sdl-union (list sdl2 sdl2-image)))))
2058 (home-page "http://gource.io/")
2059 (synopsis "3D visualisation tool for source control repositories")
2060 (description "@code{gource} provides a software version control
2061 visualization. The repository is displayed as a tree where the root of the
2062 repository is the centre, directories are branches and files are leaves.
2063 Contributors to the source code appear and disappear as they contribute to
2064 specific files and directories.")
2065 (license license:gpl3+)))
2066
2067 (define-public src
2068 (package
2069 (name "src")
2070 (version "1.18")
2071 (source (origin
2072 (method url-fetch)
2073 (uri (string-append
2074 "http://www.catb.org/~esr/src/src-" version ".tar.gz"))
2075 (sha256
2076 (base32
2077 "0n0skhvya8w2az45h2gsafxy8m2mvqas64nrgxifcmrzfv0rf26c"))))
2078 (build-system gnu-build-system)
2079 (arguments
2080 '(#:make-flags
2081 (list (string-append "prefix=" (assoc-ref %outputs "out")))
2082 #:phases
2083 (modify-phases %standard-phases
2084 (delete 'configure) ; no 'configure' script
2085 (add-after 'install 'wrap-program
2086 (lambda* (#:key inputs outputs #:allow-other-keys)
2087 (let* ((out (assoc-ref outputs "out"))
2088 (prog (string-append out "/bin/src"))
2089 (rcs (assoc-ref inputs "rcs")))
2090 (wrap-program prog
2091 `("PATH" ":" prefix (,(string-append rcs "/bin"))))
2092 #t)))
2093 (replace 'check
2094 (lambda _
2095 (setenv "HOME" (getenv "TMPDIR"))
2096 (invoke "git" "config" "--global" "user.name" "guix")
2097 (invoke "git" "config" "--global" "user.email" "guix")
2098 (invoke "./srctest"))))))
2099 (native-inputs
2100 ;; For testing.
2101 `(("git" ,git)
2102 ("perl" ,perl)))
2103 (inputs
2104 `(("python" ,python-wrapper)
2105 ("rcs" ,rcs)))
2106 (synopsis "Simple revision control")
2107 (home-page "http://www.catb.org/~esr/src/")
2108 (description
2109 "SRC (or src) is simple revision control, a version-control system for
2110 single-file projects by solo developers and authors. It modernizes the
2111 venerable RCS, hence the anagrammatic acronym. The design is tuned for use
2112 cases like all those little scripts in your @file{~/bin} directory, or a
2113 directory full of HOWTOs.")
2114 (license license:bsd-2)))
2115
2116 (define-public git-when-merged
2117 ;; Use an unreleased version to get a PY3 compatibility fix.
2118 (let ((commit "ab6af7865a0ba55ba364a6c507e0be6f84f31c6d"))
2119 (package
2120 (name "git-when-merged")
2121 (version (string-append "1.2.0-" (string-take commit 7)))
2122 (source (origin
2123 (method git-fetch)
2124 (uri (git-reference
2125 (url "https://github.com/mhagger/git-when-merged/")
2126 (commit commit)))
2127 (file-name (git-file-name name version))
2128 (sha256
2129 (base32
2130 "0iyk2psf97bc9h43m89p3xjmm79fsx99i7px29g4lcnmdy5kmz0p"))))
2131 (build-system gnu-build-system)
2132 (arguments
2133 `(#:tests? #f ; there are no tests
2134 #:phases
2135 (modify-phases %standard-phases
2136 (delete 'configure)
2137 (delete 'build)
2138 (replace 'install
2139 (lambda* (#:key outputs #:allow-other-keys)
2140 (install-file "bin/git-when-merged"
2141 (string-append (assoc-ref outputs "out")
2142 "/bin"))
2143 #t))
2144 (add-before 'install 'patch-git
2145 (lambda* (#:key inputs #:allow-other-keys)
2146 (let ((git (string-append (assoc-ref inputs "git")
2147 "/bin/git")))
2148 (substitute* "bin/git-when-merged"
2149 (("'git'") (string-append "'" git "'")))
2150 #t)))
2151 (add-after 'install 'wrap-script
2152 (lambda* (#:key outputs #:allow-other-keys)
2153 (wrap-program (string-append (assoc-ref outputs "out")
2154 "/bin/git-when-merged")
2155 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
2156 #t)))))
2157 (inputs
2158 `(("git" ,git)
2159 ("python" ,python-wrapper)))
2160 (home-page "https://github.com/mhagger/git-when-merged")
2161 (synopsis "Determine when a commit was merged into a Git branch")
2162 (description "This Git extension defines a subcommand,
2163 @code{when-merged}, whose core operation is to find the merge that brought a
2164 given commit into the specified ref(s). It has various options that control
2165 how information about the merge is displayed.")
2166 (license license:gpl2+))))
2167
2168 (define-public git-imerge
2169 (package
2170 (name "git-imerge")
2171 (version "1.1.0")
2172 (source
2173 (origin
2174 (method git-fetch)
2175 (uri (git-reference
2176 (url "https://github.com/mhagger/git-imerge.git")
2177 (commit (string-append "v" version))))
2178 (file-name (git-file-name name version))
2179 (sha256
2180 (base32 "0vi1w3f0yk4gqhxj2hzqafqq28rihyhyfnp8x7xzib96j2si14a4"))))
2181 (build-system gnu-build-system)
2182 (arguments
2183 `(#:tests? #f ; only manual test scripts
2184 #:make-flags (list (string-append "DESTDIR=" %output)
2185 "PREFIX=")
2186 #:phases
2187 (modify-phases %standard-phases
2188 (delete 'configure)
2189 (add-before 'install 'patch-git
2190 (lambda* (#:key inputs #:allow-other-keys)
2191 (let ((git (string-append (assoc-ref inputs "git")
2192 "/bin/git")))
2193 (substitute* "git-imerge"
2194 (("'git'") (string-append "'" git "'")))
2195 #t)))
2196 (add-after 'install 'wrap-script
2197 (lambda* (#:key outputs #:allow-other-keys)
2198 (wrap-program (string-append (assoc-ref outputs "out")
2199 "/bin/git-imerge")
2200 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))))
2201 #t)))))
2202 (inputs
2203 `(("git" ,git)
2204 ("python" ,python-wrapper)))
2205 (home-page "https://github.com/mhagger/git-imerge")
2206 (synopsis "Incremental merge for Git")
2207 (description "This Git extension defines a subcommand, @code{imerge},
2208 which performs an incremental merge between two branches. Its two primary
2209 design goals are to reduce the pain of resolving merge conflicts by finding
2210 the smallest possible conflicts and to allow a merge to be saved, tested,
2211 interrupted, published, and collaborated on while in progress.")
2212 (license license:gpl2+)))
2213
2214 (define-public git-lfs
2215 (package
2216 (name "git-lfs")
2217 (version "2.7.2")
2218 (source (origin
2219 (method git-fetch)
2220 (uri (git-reference
2221 (url "https://github.com/git-lfs/git-lfs")
2222 (commit (string-append "v" version))))
2223 (file-name (git-file-name name version))
2224 (sha256
2225 (base32
2226 "1nf40rbdz901vsahg5cm09pznpina6wimmxl0lmh8pn0mi51yzvc"))))
2227 (build-system go-build-system)
2228 (arguments
2229 '(#:import-path "github.com/git-lfs/git-lfs"))
2230 (home-page "https://git-lfs.github.com/")
2231 (synopsis "Git extension for versioning large files")
2232 (description
2233 "Git Large File Storage (LFS) replaces large files such as audio samples,
2234 videos, datasets, and graphics with text pointers inside Git, while storing the
2235 file contents on a remote server.")
2236 (license license:expat)))