gnu: git: Do not retain reference from "out" to Subversion.
[jackhill/guix/guix.git] / gnu / packages / version-control.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
4 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
5 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages version-control)
23 #:use-module ((guix licenses) #:select (asl2.0 gpl1+ gpl2 gpl2+ gpl3+))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system python)
28 #:use-module (guix build utils)
29 #:use-module ((gnu packages gettext)
30 #:renamer (symbol-prefix-proc 'guix:))
31 #:use-module (gnu packages apr)
32 #:use-module (gnu packages curl)
33 #:use-module (gnu packages nano)
34 #:use-module (gnu packages openssl)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages sqlite)
38 #:use-module (gnu packages system)
39 #:use-module (gnu packages xml)
40 #:use-module (gnu packages emacs)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages swig))
43
44 (define-public bazaar
45 (package
46 (name "bazaar")
47 (version "2.5.1")
48 (source
49 (origin
50 (method url-fetch)
51 (uri (string-append "https://launchpad.net/bzr/2.5/" version
52 "/+download/bzr-" version ".tar.gz"))
53 (sha256
54 (base32
55 "10krjbzia2avn09p0cdlbx2wya0r5v11w5ymvyl72af5dkx4cwwn"))))
56 (build-system python-build-system)
57 (inputs
58 ;; Note: 'tools/packaging/lp-upload-release' and 'tools/weavemerge.sh'
59 ;; require Zsh.
60 `(("gettext" ,guix:gettext)))
61 (arguments
62 `(#:tests? #f ; no test target
63 #:python ,python-2)) ; Python 3 apparently not yet supported, see
64 ; https://answers.launchpad.net/bzr/+question/229048
65 (home-page "https://gnu.org/software/bazaar")
66 (synopsis "Decentralized revision control system")
67 (description
68 "GNU Bazaar is a distributed version control system, which supports both
69 central version control and distributed version control. Developers can
70 organize their workspace in whichever way they want. It is possible to work
71 from a command line or use a GUI application.")
72 (license gpl2+)))
73
74 (define-public git
75 (package
76 (name "git")
77 (version "1.8.4")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append "http://git-core.googlecode.com/files/git-"
81 version ".tar.gz"))
82 (sha256
83 (base32
84 "156bwqqgaw65rsvbb4wih5jfg94bxyf6p16mdwf0ky3f4ln55s2i"))))
85 (build-system gnu-build-system)
86 (inputs
87 `(("curl" ,curl)
88 ("expat" ,expat)
89 ("gettext" ,guix:gettext)
90 ("openssl" ,openssl)
91 ("perl" ,perl)
92 ("python" ,python-2) ; CAVEAT: incompatible with python-3 according to INSTALL
93 ("zlib" ,zlib)
94
95 ;; For 'git-svn'.
96 ("subversion" ,subversion)))
97 (outputs '("out" "svn"))
98 (arguments
99 `(#:make-flags `("V=1") ; more verbose compilation
100 #:test-target "test"
101 #:tests? #f ; FIXME: Many tests are failing
102 #:phases
103 (alist-replace
104 'configure
105 (lambda* (#:key #:allow-other-keys #:rest args)
106 (let ((configure (assoc-ref %standard-phases 'configure)))
107 (and (apply configure args)
108 (substitute* "Makefile"
109 (("/bin/sh") (which "sh"))
110 (("/usr/bin/perl") (which "perl"))
111 (("/usr/bin/python") (which "python"))))))
112 (alist-cons-after
113 'install 'split
114 (lambda* (#:key inputs outputs #:allow-other-keys)
115 (let* ((out (assoc-ref outputs "out"))
116 (svn (assoc-ref outputs "svn"))
117 (git-svn (string-append out "/libexec/git-core/git-svn"))
118 (git-svn* (string-append svn "/libexec/git-core/git-svn")))
119 (mkdir-p (string-append svn "/libexec/git-core"))
120 (copy-file git-svn git-svn*)
121 (delete-file git-svn)
122 (chmod git-svn* #o555)
123
124 ;; Tell 'git-svn' where Subversion is.
125 (wrap-program git-svn*
126 `("PATH" ":" prefix
127 (,(string-append (assoc-ref inputs "subversion")
128 "/bin")))
129 `("PERL5LIB" ":" prefix
130 (,(string-append (assoc-ref inputs "subversion")
131 "/lib/perl5/site_perl")))
132
133 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
134 ;; help it find 'libsvn_client-1.so'.
135 `("LD_LIBRARY_PATH" ":" prefix
136 (,(string-append (assoc-ref inputs "subversion")
137 "/lib"))))
138
139 ;; Tell 'git' to look for core programs in the user's profile.
140 ;; This allows user to install other outputs of this package and
141 ;; have them transparently taken into account. There's a
142 ;; 'GIT_EXEC_PATH' environment variable, but it's supposed to
143 ;; specify a single directory, not a search path.
144 (wrap-program (string-append out "/bin/git")
145 `("PATH" ":" prefix
146 ("$HOME/.guix-profile/libexec/git-core")))))
147 %standard-phases))))
148 (synopsis "Distributed version control system")
149 (description
150 "Git is a free distributed version control system designed to handle
151 everything from small to very large projects with speed and efficiency.")
152 (license gpl2)
153 (home-page "http://git-scm.com/")))
154
155 (define-public subversion
156 (package
157 (name "subversion")
158 (version "1.7.8")
159 (source (origin
160 (method url-fetch)
161 (uri (string-append "http://archive.apache.org/dist/subversion/subversion-"
162 version ".tar.bz2"))
163 (sha256
164 (base32
165 "11inl9n1riahfnbk1fax0dysm2swakzhzhpmm2zvga6fikcx90zw"))))
166 (build-system gnu-build-system)
167 (arguments
168 '(#:phases (alist-cons-after
169 'install 'instal-perl-bindings
170 (lambda* (#:key outputs #:allow-other-keys)
171 ;; Follow the instructions from
172 ;; 'subversion/bindings/swig/INSTALL'.
173 (let ((out (assoc-ref outputs "out")))
174 (and (zero? (system* "make" "swig-pl-lib"))
175 ;; FIXME: Test failures.
176 ;; (zero? (system* "make" "check-swig-pl"))
177 (zero? (system* "make" "install-swig-pl-lib"))
178
179 ;; Set the right installation prefix.
180 (with-directory-excursion
181 "subversion/bindings/swig/perl/native"
182 (and (zero?
183 (system* "perl" "Makefile.PL"
184 (string-append "PREFIX=" out)))
185 (zero?
186 (system* "make" "install")))))))
187 %standard-phases)))
188 (native-inputs
189 ;; For the Perl bindings.
190 `(("swig" ,swig)))
191 (inputs
192 `(("apr" ,apr)
193 ("apr-util" ,apr-util)
194 ("perl" ,perl)
195 ("python" ,python-2) ; incompatible with Python 3 (print syntax)
196 ("sqlite" ,sqlite)
197 ("zlib" ,zlib)))
198 (home-page "http://subversion.apache.org/")
199 (synopsis "Subversion, a revision control system")
200 (description
201 "Subversion exists to be universally recognized and adopted as an
202 open-source, centralized version control system characterized by its
203 reliability as a safe haven for valuable data; the simplicity of its model and
204 usage; and its ability to support the needs of a wide variety of users and
205 projects, from individuals to large-scale enterprise operations.")
206 (license asl2.0)))
207
208 (define-public rcs
209 (package
210 (name "rcs")
211 (version "5.9.0")
212 (source (origin
213 (method url-fetch)
214 (uri (string-append "mirror://gnu/rcs/rcs-"
215 version ".tar.xz"))
216 (sha256
217 (base32
218 "0w26vsx732dcmb5qfhlkkzvrk1sx6d74qibrn914n14j0ci90jcq"))))
219 (build-system gnu-build-system)
220 (home-page "http://www.gnu.org/software/rcs/")
221 (synopsis "Per-file local revision control system")
222 (description
223 "The GNU Revision Control System (RCS) manages multiple revisions of
224 files. RCS automates the storing, retrieval, logging, identification, and
225 merging of revisions. RCS is useful for text that is revised frequently,
226 including source code, programs, documentation, graphics, papers, and form
227 letters.")
228 (license gpl3+)))
229
230 (define-public cvs
231 (package
232 (name "cvs")
233 (version "1.12.13")
234 (source (origin
235 (method url-fetch)
236 (uri (string-append
237 "http://ftp.gnu.org/non-gnu/cvs/source/feature/"
238 version "/cvs-" version ".tar.bz2"))
239 (sha256
240 (base32
241 "0pjir8cwn0087mxszzbsi1gyfc6373vif96cw4q3m1x6p49kd1bq"))))
242 (build-system gnu-build-system)
243 (arguments
244 ;; XXX: The test suite looks flawed, and the package is obsolete anyway.
245 '(#:tests? #f))
246 (inputs `(("zlib" ,zlib)
247 ("nano" ,nano))) ; the default editor
248 (home-page "http://cvs.nongnu.org")
249 (synopsis "Historical centralized version control system")
250 (description
251 "CVS is a version control system, an important component of Source
252 Configuration Management (SCM). Using it, you can record the history of
253 sources files, and documents. It fills a similar role to the free software
254 RCS, PRCS, and Aegis packages.")
255 (license gpl1+)))
256
257 (define-public vc-dwim
258 (package
259 (name "vc-dwim")
260 (version "1.7")
261 (source (origin
262 (method url-fetch)
263 (uri (string-append "mirror://gnu/vc-dwim/vc-dwim-"
264 version ".tar.xz"))
265 (sha256
266 (base32
267 "094pjwshvazlgagc254in2xvrp93vhcj0kb5ms17qs7sch99x9z2"))))
268 (build-system gnu-build-system)
269 (inputs `(("perl" ,perl)
270 ("inetutils" ,inetutils) ; for `hostname', used in the tests
271 ("emacs" ,emacs))) ; for `ctags'
272 (home-page "http://www.gnu.org/software/vc-dwim/")
273 (synopsis "Version-control-agnostic ChangeLog diff and commit tool")
274 (description
275 "vc-dwim is a version-control-agnostic ChangeLog diff and commit
276 tool. vc-chlog is a helper tool for writing GNU-style ChangeLog entries.")
277 (license gpl3+)))