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