1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
6 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages version-control)
25 #:use-module ((guix licenses)
26 #:select (asl2.0 bsd-2
27 gpl1+ gpl2 gpl2+ gpl3+ lgpl2.1
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system python)
34 #:use-module (guix build-system trivial)
35 #:use-module (guix build utils)
36 #:use-module (gnu packages apr)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages cook)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages ed)
42 #:use-module (gnu packages file)
43 #:use-module (gnu packages flex)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages groff)
46 #:use-module (gnu packages linux)
47 ;; #:use-module (gnu packages gnutls)
48 #:use-module (gnu packages nano)
49 #:use-module (gnu packages openssl)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages pkg-config)
52 #:use-module (gnu packages python)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages admin)
55 #:use-module (gnu packages xml)
56 #:use-module (gnu packages emacs)
57 #:use-module (gnu packages compression)
58 #:use-module (gnu packages swig)
59 #:use-module (gnu packages tcl)
60 #:use-module (gnu packages))
69 (uri (string-append "https://launchpad.net/bzr/2.6/" version
70 "/+download/bzr-" version ".tar.gz"))
73 "1c6sj77h5f97qimjc14kr532kgc0jk3wq778xrkqi0pbh9qpk509"))))
74 (build-system python-build-system)
76 ;; Note: 'tools/packaging/lp-upload-release' and 'tools/weavemerge.sh'
78 `(("gettext" ,gnu-gettext)))
80 `(#:tests? #f ; no test target
81 #:python ,python-2 ; Python 3 apparently not yet supported, see
82 ; https://answers.launchpad.net/bzr/+question/229048
83 #:phases (alist-cons-after
86 (substitute* "setup.py"
87 (("man/man1") "share/man/man1")))
89 (home-page "https://gnu.org/software/bazaar")
90 (synopsis "Version control system supporting both distributed and centralized workflows")
92 "GNU Bazaar is a version control system that allows you to record
93 changes to project files over time. It supports both a distributed workflow
94 as well as the classic centralized workflow.")
103 (uri (string-append "mirror://kernel.org/software/scm/git/git-"
107 "12x1qycc0rii6fqpiizp9v9ysdmj6lpi9imqqbrkdx6cifbwh9vv"))))
108 (build-system gnu-build-system)
110 `(("native-perl" ,perl)
111 ("gettext" ,gnu-gettext)))
117 ("python" ,python-2) ; CAVEAT: incompatible with python-3 according to INSTALL
121 ("subversion" ,subversion)
123 ;; For 'git gui', 'gitk', and 'git citool'.
126 (outputs '("out" ; the core
128 "gui")) ; gitk, git gui
130 `(#:make-flags `("V=1") ; more verbose compilation
132 #:tests? #f ; FIXME: Many tests are failing
134 ;; The explicit --with-tcltk forces the build system to hardcode the
135 ;; absolute file name to 'wish'.
136 #:configure-flags (list (string-append "--with-tcltk="
137 (assoc-ref %build-inputs "tk")
138 "/bin/wish8.6")) ; XXX
142 'configure 'patch-makefile-shebangs
144 (substitute* "Makefile"
145 (("/bin/sh") (which "sh"))
146 (("/usr/bin/perl") (which "perl"))
147 (("/usr/bin/python") (which "python"))))
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 ;; Split the binaries to the various outputs.
152 (let* ((out (assoc-ref outputs "out"))
153 (svn (assoc-ref outputs "svn"))
154 (gui (assoc-ref outputs "gui"))
155 (gitk (string-append out "/bin/gitk"))
156 (gitk* (string-append gui "/bin/gitk"))
157 (git-gui (string-append out "/libexec/git-core/git-gui"))
158 (git-gui* (string-append gui "/libexec/git-core/git-gui"))
159 (git-cit (string-append out "/libexec/git-core/git-citool"))
160 (git-cit* (string-append gui "/libexec/git-core/git-citool"))
161 (git-svn (string-append out "/libexec/git-core/git-svn"))
162 (git-svn* (string-append svn "/libexec/git-core/git-svn"))
163 (git-sm (string-append out
164 "/libexec/git-core/git-submodule")))
165 (mkdir-p (string-append gui "/bin"))
166 (mkdir-p (string-append gui "/libexec/git-core"))
167 (mkdir-p (string-append svn "/libexec/git-core"))
169 (for-each (lambda (old new)
173 (list gitk git-gui git-cit git-svn)
174 (list gitk* git-gui* git-cit* git-svn*))
176 ;; Tell 'git-svn' where Subversion is.
177 (wrap-program git-svn*
179 (,(string-append (assoc-ref inputs "subversion")
181 `("PERL5LIB" ":" prefix
182 (,(string-append (assoc-ref inputs "subversion")
183 "/lib/perl5/site_perl")))
185 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
186 ;; help it find 'libsvn_client-1.so'.
187 `("LD_LIBRARY_PATH" ":" prefix
188 (,(string-append (assoc-ref inputs "subversion")
191 ;; Tell 'git-submodule' where Perl is.
194 (,(string-append (assoc-ref inputs "perl")
197 ;; Tell 'git' to look for core programs in the user's profile.
198 ;; This allows user to install other outputs of this package and
199 ;; have them transparently taken into account. There's a
200 ;; 'GIT_EXEC_PATH' environment variable, but it's supposed to
201 ;; specify a single directory, not a search path.
202 (wrap-program (string-append out "/bin/git")
204 ("$HOME/.guix-profile/libexec/git-core")))))
206 (synopsis "Distributed version control system")
208 "Git is a free distributed version control system designed to handle
209 everything from small to very large projects with speed and efficiency.")
211 (home-page "http://git-scm.com/")))
213 (define-public shflags
219 (uri (string-append "https://shflags.googlecode.com/files/"
220 "shflags-" version ".tgz"))
223 "08laxhf1hifh3w4j0hri5ppcklaqz0mnkmbaz8j0wxih29vi8slm"))))
224 (build-system trivial-build-system)
225 (native-inputs `(("tar" ,tar)
228 `(#:modules ((guix build utils))
230 (use-modules (guix build utils))
231 (let* ((source (assoc-ref %build-inputs "source"))
232 (tar (assoc-ref %build-inputs "tar"))
233 (gzip (assoc-ref %build-inputs "gzip"))
234 (output (assoc-ref %outputs "out"))
235 (srcdir (string-append output "/src")))
237 (setenv "PATH" (string-append gzip "/bin"))
238 (system* (string-append tar "/bin/tar") "xzf"
240 (chdir ,(string-append name "-" version))
242 (copy-file "src/shflags"
243 (string-append srcdir "/shflags"))
245 (home-page "https://code.google.com/p/shflags/")
246 (synopsis "Command-line flags library for shell scripts")
248 "Shell Flags (shFlags) is a library written to greatly simplify the
249 handling of command-line flags in Bourne based Unix shell scripts (bash, dash,
250 ksh, sh, zsh). Most shell scripts use getopt for flags processing, but the
251 different versions of getopt on various OSes make writing portable shell
252 scripts difficult. shFlags instead provides an API that doesn't change across
253 shell and OS versions so the script writer can be confident that the script
257 (define-public git-flow
260 ;; This version has not be officially released yet, so we build it
261 ;; directly from the git repository.
262 (version "0.4.2-pre")
266 (url "https://github.com/nvie/gitflow/")
270 "01fs97q76fdfnvmrh2cyjhywcs3pykf1dg58sy0frflnsdzs6prx"))))
271 (build-system gnu-build-system)
272 (inputs `(("shflags" ,shflags)))
274 '(#:tests? #f ; no tests
275 #:make-flags (list (string-append "prefix="
276 (assoc-ref %outputs "out")))
277 #:phases (alist-cons-after
278 'unpack 'reset-shFlags-link
279 (lambda* (#:key inputs #:allow-other-keys)
280 ;; The link points to a file in the shFlags submodule.
281 ;; Redirect it to point to our system shFlags.
282 (let ((shflags (assoc-ref inputs "shflags")))
284 (delete-file "gitflow-shFlags")
285 (symlink (string-append shflags "/src/shflags")
286 "gitflow-shFlags"))))
289 (alist-delete 'build %standard-phases)))))
290 (home-page "http://nvie.com/posts/a-successful-git-branching-model/")
291 (synopsis "Git extensions for Vincent Driessen's branching model")
293 "Vincent Driessen's branching model is a git branching and release
294 management strategy that helps developers keep track of features, hotfixes,
295 and releases in bigger software projects. The git-flow library of git
296 subcommands helps automate some parts of the flow to make working with it a
300 (define-public git-test-sequence
301 (let ((commit "48e5a2f"))
303 (name "git-test-sequence")
304 (version (string-append "20140312." commit))
308 ;; There are many other scripts in this directory; we
309 ;; are interested in just one for this package.
310 (url "https://github.com/dustin/bindir")
314 "1dcq0y16yznbv4k9h8gg90kv1gkn8r8dbvl4m2rpfd7q5nqhn617"))))
315 (build-system trivial-build-system)
317 `(#:modules ((guix build utils))
319 (use-modules (guix build utils))
320 (let* ((source (assoc-ref %build-inputs "source"))
321 (output (assoc-ref %outputs "out"))
322 (bindir (string-append output "/bin"))
323 (script "git-test-sequence"))
326 (copy-file (string-append source "/" script)
327 (string-append bindir "/" script))
329 (home-page "http://dustin.sallings.org/2010/03/28/git-test-sequence.html")
330 (synopsis "Run a command over a sequence of commits")
332 "git-test-sequence is similar to an automated git bisect except it’s
333 linear. It will test every change between two points in the DAG. It will
334 also walk each side of a merge and test those changes individually.")
335 (license (x11-style "file://LICENSE")))))
337 (define-public mercurial
343 (uri (string-append "http://mercurial.selenic.com/release/mercurial-"
347 "121m8f7vmipmdg00cnzdz2rjkgydh28mwfirqkrbs5fv089vywl4"))))
348 (build-system python-build-system)
350 `(;; Restrict to Python 2, as Python 3 would require
351 ;; the argument --c2to3.
353 ;; FIXME: Disabled tests because they require the nose unit
354 ;; testing framework: https://nose.readthedocs.org/en/latest/ .
356 (home-page "http://mercurial.selenic.com")
357 (synopsis "Decentralized version control system")
359 "Mercurial is a free, distributed source control management tool.
360 It efficiently handles projects of any size
361 and offers an easy and intuitive interface.")
370 (uri (string-append "http://www.webdav.org/neon/neon-"
374 "1hlhg5w505jxdvaf7bq17057f6a48dry981g7lp2gwrhbp5wyqi9"))))
375 (build-system gnu-build-system)
378 ("pkg-config" ,pkg-config)))
380 `(("libxml2" ,libxml2)
384 `(;; FIXME: Add tests once reverse address lookup is fixed in glibc, see
385 ;; https://sourceware.org/bugzilla/show_bug.cgi?id=16475
387 #:configure-flags '("--enable-shared"
388 ;; requires libgnutils-config, deprecated
390 ; "--with-ssl=gnutls")))
391 "--with-ssl=openssl")))
392 (home-page "http://www.webdav.org/neon/")
393 (synopsis "HTTP and WebDAV client library")
394 (description "Neon is an HTTP and WebDAV client library, with a
395 C interface. Features:
396 High-level wrappers for common HTTP and WebDAV operations (GET, MOVE,
398 low-level interface to the HTTP request/response engine, allowing the use
399 of arbitrary HTTP methods, headers, etc.;
400 authentication support including Basic and Digest support, along with
401 GSSAPI-based Negotiate on Unix, and SSPI-based Negotiate/NTLM on Win32;
402 SSL/TLS support using OpenSSL or GnuTLS, exposing an abstraction layer for
403 verifying server certificates, handling client certificates, and examining
404 certificate properties, smartcard-based client certificates are also
405 supported via a PKCS#11 wrapper interface;
406 abstract interface to parsing XML using libxml2 or expat, and wrappers for
407 simplifying handling XML HTTP response bodies;
408 WebDAV metadata support, wrappers for PROPFIND and PROPPATCH to simplify
409 property manipulation.")
410 (license gpl2+))) ; for documentation and tests; source under lgpl2.0+
412 (define-public neon-0.29.6
413 (package (inherit neon)
418 (uri (string-append "http://www.webdav.org/neon/neon-"
422 "0hzbjqdx1z8zw0vmbknf159wjsxbcq8ii0wgwkqhxj3dimr0nr4w"))))))
424 (define-public subversion
430 (uri (string-append "http://archive.apache.org/dist/subversion/"
431 "subversion-" version ".tar.bz2"))
434 "06nrqnn3qq1hhskkcdbm0ilk2xv6ay2gyf2c7qvxp6xncb782wzn"))))
435 (build-system gnu-build-system)
437 '(#:phases (alist-cons-after
438 'configure 'patch-libtool-wrapper-ls
439 (lambda* (#:key inputs #:allow-other-keys)
440 ;; This substitution allows tests svnauthz_tests and
441 ;; svnlook_tests to pass. These tests execute svnauthz and
442 ;; svnlook through their libtool wrapper scripts from svn
443 ;; hooks, whose empty environments cause "ls: command not
444 ;; found" errors. It would be nice if this fix ultimately
445 ;; made its way into libtool.
446 (let ((coreutils (assoc-ref inputs "coreutils")))
447 (substitute* "libtool"
448 (("\\\\`ls") (string-append "\\`" coreutils "/bin/ls")))))
450 'install 'instal-perl-bindings
451 (lambda* (#:key outputs #:allow-other-keys)
452 ;; Follow the instructions from
453 ;; 'subversion/bindings/swig/INSTALL'.
454 (let ((out (assoc-ref outputs "out")))
455 (and (zero? (system* "make" "swig-pl-lib"))
456 ;; FIXME: Test failures.
457 ;; (zero? (system* "make" "check-swig-pl"))
458 (zero? (system* "make" "install-swig-pl-lib"))
460 ;; Set the right installation prefix.
461 (with-directory-excursion
462 "subversion/bindings/swig/perl/native"
464 (system* "perl" "Makefile.PL"
465 (string-append "PREFIX=" out)))
467 (system* "make" "install")))))))
470 `(("pkg-config" ,pkg-config)
471 ;; For the Perl bindings.
475 ("apr-util" ,apr-util)
476 ("neon" ,neon-0.29.6)
478 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
481 (home-page "http://subversion.apache.org/")
482 (synopsis "Revision control system")
484 "Subversion exists to be universally recognized and adopted as a
485 centralized version control system characterized by its
486 reliability as a safe haven for valuable data; the simplicity of its model and
487 usage; and its ability to support the needs of a wide variety of users and
488 projects, from individuals to large-scale enterprise operations.")
497 (uri (string-append "mirror://gnu/rcs/rcs-"
501 "0isvzwfvqkg7zcsznra6wqh650z49ib113n7gp6ncxv5p30x3c38"))))
502 (build-system gnu-build-system)
503 (native-inputs `(("ed" ,ed)))
504 (home-page "http://www.gnu.org/software/rcs/")
505 (synopsis "Per-file local revision control system")
507 "RCS is the original Revision Control System. It works on a
508 file-by-file basis, in contrast to subsequent version control systems such as
509 CVS, Subversion, and Git. This can make it suitable for system
510 administration files, for example, which are often inherently local to one
521 "http://ftp.gnu.org/non-gnu/cvs/source/feature/"
522 version "/cvs-" version ".tar.bz2"))
525 "0pjir8cwn0087mxszzbsi1gyfc6373vif96cw4q3m1x6p49kd1bq"))))
526 (build-system gnu-build-system)
528 ;; XXX: The test suite looks flawed, and the package is obsolete anyway.
530 (inputs `(("zlib" ,zlib)
531 ("nano" ,nano))) ; the default editor
532 (home-page "http://cvs.nongnu.org")
533 (synopsis "Historical centralized version control system")
535 "CVS is a version control system, an important component of Source
536 Configuration Management (SCM). Using it, you can record the history of
537 sources files, and documents. It fills a similar role to the free software
538 RCS, PRCS, and Aegis packages.")
541 (define-public vc-dwim
547 (uri (string-append "mirror://gnu/vc-dwim/vc-dwim-"
551 "094pjwshvazlgagc254in2xvrp93vhcj0kb5ms17qs7sch99x9z2"))))
552 (build-system gnu-build-system)
553 (inputs `(("perl" ,perl)
554 ("inetutils" ,inetutils) ; for `hostname', used in the tests
555 ("emacs" ,emacs))) ; for `ctags'
556 (home-page "http://www.gnu.org/software/vc-dwim/")
557 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
559 "The vc-dwim package contains two tools, \"vc-dwim\" and \"vc-chlog\".
560 vc-dwim is a tool that simplifies the task of maintaining a ChangeLog and
561 using version control at the same time, for example by printing a reminder
562 when a file change has been described in the ChangeLog but the file has not
563 been added to the VC. vc-chlog scans changed files and generates
564 standards-compliant ChangeLog entries based on the changes that it detects.")
567 (define-public diffstat
574 "ftp://invisible-island.net/diffstat/diffstat-"
578 "14rpf5c05ff30f6vn6pn6pzy0k4g4is5im656ahsxff3k58i7mgs"))))
579 (build-system gnu-build-system)
580 (home-page "http://invisible-island.net/diffstat/")
581 (synopsis "Make histograms from the output of 'diff'")
583 "Diffstat reads the output of 'diff' and displays a histogram of the
584 insertions, deletions, and modifications per-file. It is useful for reviewing
585 large, complex patch files.")
586 (license (x11-style "file://COPYING"))))
594 (uri (string-append "mirror://gnu/" name "/CSSC-"
598 "0bkw6fjh20ppvn54smv05461lm1vcwvn02avx941c4acafmkl1cm"))
599 (patches (list (search-patch "cssc-gets-undeclared.patch")
600 (search-patch "cssc-missing-include.patch")))))
601 (build-system gnu-build-system)
603 `(#:phases (alist-cons-before
607 (substitute* "tests/common/test-common"
608 (("/bin/pwd") (which "pwd")))
610 (substitute* "tests/prt/all-512.sh"
611 (("/bin/sh") (which "sh")))
613 ;; XXX: This test has no hope of passing until there is a "nogroup"
614 ;; entry (or at least some group to which the guix builder does
615 ;; not belong) in the /etc/group file of the build environment.
616 ;; Currently we do not have such a group. Disable this test for now.
617 (substitute* "tests/Makefile"
618 (("test-delta ") ""))))
620 ;; These are needed for the tests
621 (native-inputs `(("git" ,git)
623 (home-page "http://www.gnu.org/software/cssc/")
624 (synopsis "File-based version control like SCCS")
625 (description "GNU CSSC provides a replacement for the legacy Unix source
626 code control system SCCS. This allows old code still under that system to be
627 accessed and migrated on modern systems.")
630 ;; This package can unfortunately work only in -TEST mode, since Aegis
631 ;; requires that it is installed setuid root.
638 (uri (string-append "mirror://sourceforge/aegis/aegis-"
642 "18s86ssarfmc4l17gbpzybca29m5wa37cbaimdji8czlcry3mcjl"))
643 (patches (list (search-patch "aegis-perl-tempdir1.patch")
644 (search-patch "aegis-perl-tempdir2.patch")
645 (search-patch "aegis-test-fixup-1.patch")
646 (search-patch "aegis-test-fixup-2.patch")
647 (search-patch "aegis-constness-error.patch")))))
648 (build-system gnu-build-system)
650 `(("e2fsprogs" ,e2fsprogs)
655 ("gettext" ,gnu-gettext)))
660 ;; Various tests require the following:
664 ("subversion" ,subversion)
668 `(#:configure-flags (list "--with-no-aegis-configured"
669 "--sharedstatedir=/var/com/aegis")
670 #:parallel-build? #f ; There are some nasty racy rules in the Makefile.
675 (substitute* (append '("configure"
676 "etc/check-tar-gz.sh"
681 "script/aeintegratq.in"
683 "script/test_funcs.in"
684 "web/eg_oss_templ.sh"
686 "libaegis/getpw_cache.cc")
687 (find-files "test" "\\.sh"))
688 (("/bin/sh") (which "sh")))
689 (setenv "SH" (which "sh")))
693 (let ((home (string-append (getcwd) "/my-new-home")))
694 ;; Some tests need to write to $HOME.
698 ;; This test assumes that flex has been symlinked to "lex".
699 (substitute* "test/00/t0011a.sh"
700 (("type lex") "type flex"))
702 ;; The author decided to call the check rule "sure".
703 (zero? (system* "make" "sure"))))
705 (home-page "http://aegis.sourceforge.net")
706 (synopsis "Project change supervisor")
707 (description "Aegis is a project change supervisor, and performs some of
708 the Software Configuration Management needed in a CASE environment. Aegis
709 provides a framework within which a team of developers may work on many
710 changes to a program independently, and Aegis coordinates integrating these
711 changes back into the master source of the program, with as little disruption
712 as possible. Resolution of contention for source files, a major headache for
713 any project with more than one developer, is one of Aegis's major functions.")