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