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