Merge branch 'version-0.8.3'
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages package-management)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix git-download)
24 #:use-module (guix utils)
25 #:use-module (guix build-system gnu)
26 #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+))
27 #:use-module (gnu packages)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages gnupg)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages graphviz)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages gettext)
36 #:use-module (gnu packages texinfo)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages web)
40 #:use-module (gnu packages man)
41 #:use-module (gnu packages emacs)
42 #:use-module (gnu packages bdw-gc)
43 #:use-module (gnu packages tls))
44
45 (define (boot-guile-uri arch)
46 "Return the URI for the bootstrap Guile tarball for ARCH."
47 (if (string=? "armhf" arch)
48 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
49 arch "-linux"
50 "/20150101/guile-2.0.11.tar.xz")
51 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
52 arch "-linux"
53 "/20131110/guile-2.0.9.tar.xz")))
54
55 (define-public guix-0.8.3
56 (package
57 (name "guix")
58 (version "0.8.3")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-"
62 version ".tar.gz"))
63 (sha256
64 (base32
65 "14n0nkj0ckhdwhghx1pml99hbjr1xdkn8x145j0xp1357vqlisnz"))))
66 (build-system gnu-build-system)
67 (arguments
68 `(#:configure-flags (list
69 "--localstatedir=/var"
70 "--sysconfdir=/etc"
71 (string-append "--with-bash-completion-dir="
72 (assoc-ref %outputs "out")
73 "/etc/bash_completion.d")
74 (string-append "--with-libgcrypt-prefix="
75 (assoc-ref %build-inputs
76 "libgcrypt")))
77 #:phases (modify-phases %standard-phases
78 (add-before
79 'configure 'copy-bootstrap-guile
80 (lambda* (#:key system inputs #:allow-other-keys)
81 (define (boot-guile-version arch)
82 (if (string=? "armhf" arch)
83 "2.0.11"
84 "2.0.9"))
85
86 (define (copy arch)
87 (let ((guile (assoc-ref inputs
88 (string-append "boot-guile/"
89 arch)))
90 (target (string-append "gnu/packages/bootstrap/"
91 arch "-linux/"
92 "/guile-"
93 (boot-guile-version arch)
94 ".tar.xz")))
95 (copy-file guile target)))
96
97 (copy "i686")
98 (copy "x86_64")
99 (copy "mips64el")
100 (copy "armhf")
101 #t))
102 (add-after
103 'unpack 'disable-container-tests
104 ;; XXX FIXME: These tests fail within the build container.
105 (lambda _
106 (substitute* "tests/syscalls.scm"
107 (("^\\(test-assert \"(clone|setns|pivot-root)\"" all)
108 (string-append "(test-skip 1)\n" all)))
109 (substitute* "tests/containers.scm"
110 (("^\\(test-assert" all)
111 (string-append "(test-skip 1)\n" all)))
112 #t))
113 (add-after
114 'install 'wrap-program
115 (lambda* (#:key inputs outputs #:allow-other-keys)
116 ;; Make sure the 'guix' command finds GnuTLS and
117 ;; Guile-JSON automatically.
118 (let* ((out (assoc-ref outputs "out"))
119 (json (assoc-ref inputs "guile-json"))
120 (gnutls (assoc-ref inputs "gnutls"))
121 (path (string-append
122 json "/share/guile/site/2.0:"
123 gnutls "/share/guile/site/2.0")))
124 (wrap-program (string-append out "/bin/guix")
125 `("GUILE_LOAD_PATH" ":" prefix (,path))
126 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path)))
127 #t))))))
128 (native-inputs `(("pkg-config" ,pkg-config)
129 ("emacs" ,emacs-no-x))) ;for guix.el
130 (inputs
131 (let ((boot-guile (lambda (arch hash)
132 (origin
133 (method url-fetch)
134 (uri (boot-guile-uri arch))
135 (sha256 hash)))))
136 `(("bzip2" ,bzip2)
137 ("gzip" ,gzip)
138
139 ("sqlite" ,sqlite)
140 ("libgcrypt" ,libgcrypt)
141 ("guile" ,guile-2.0)
142
143 ("boot-guile/i686"
144 ,(boot-guile "i686"
145 (base32
146 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
147 ("boot-guile/x86_64"
148 ,(boot-guile "x86_64"
149 (base32
150 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
151 ("boot-guile/mips64el"
152 ,(boot-guile "mips64el"
153 (base32
154 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
155 ("boot-guile/armhf"
156 ,(boot-guile "armhf"
157 (base32
158 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))))))
159 (propagated-inputs
160 `(("gnutls" ,gnutls) ;for 'guix download' & co.
161 ("guile-json" ,guile-json)
162 ("geiser" ,geiser))) ;for guix.el
163
164 (home-page "http://www.gnu.org/software/guix")
165 (synopsis "Functional package manager for installed software packages and versions")
166 (description
167 "GNU Guix is a functional package manager for the GNU system, and is
168 also a distribution thereof. It includes a virtual machine image. Besides
169 the usual package management features, it also supports transactional
170 upgrades and roll-backs, per-user profiles, and much more. It is based on
171 the Nix package manager.")
172 (license gpl3+)))
173
174 (define guix-devel
175 ;; Development version of Guix.
176 ;;
177 ;; Note: use a short commit id; when using the long one, the limit on socket
178 ;; file names is exceeded while running the tests.
179 (let ((commit "5d09263"))
180 (package (inherit guix-0.8.3)
181 (version (string-append "0.8.3." commit))
182 (source (origin
183 (method git-fetch)
184 (uri (git-reference
185 (url "git://git.sv.gnu.org/guix.git")
186 (commit commit)))
187 (sha256
188 (base32
189 "0v5g90di91j218x620shib7xjrjd5dkk4h1zrlg98hdmbgxq5s3j"))
190 (file-name (string-append "guix-" version "-checkout"))))
191 (arguments
192 (substitute-keyword-arguments (package-arguments guix-0.8.3)
193 ((#:phases phases)
194 `(modify-phases ,phases
195 (add-after
196 'unpack 'bootstrap
197 (lambda _
198 ;; Make sure 'msgmerge' can modify the PO files.
199 (for-each (lambda (po)
200 (chmod po #o666))
201 (find-files "." "\\.po$"))
202
203 (zero? (system* "sh" "bootstrap"))))
204 (add-after
205 'unpack 'disable-container-tests
206 ;; XXX FIXME: These tests fail within the build container.
207 (lambda _
208 (substitute* "tests/syscalls.scm"
209 (("^\\(test-assert \"(clone|setns|pivot-root)\"" all)
210 (string-append "(test-skip 1)\n" all)))
211 (substitute* "tests/containers.scm"
212 (("^\\(test-assert" all)
213 (string-append "(test-skip 1)\n" all)))
214 #t))))))
215 (native-inputs
216 `(("autoconf" ,(autoconf-wrapper))
217 ("automake" ,automake)
218 ("gettext" ,gnu-gettext)
219 ("texinfo" ,texinfo)
220 ("graphviz" ,graphviz)
221 ("help2man" ,help2man)
222 ,@(package-native-inputs guix-0.8.3))))))
223
224 (define-public guix guix-devel)
225
226 (define-public nix
227 (package
228 (name "nix")
229 (version "1.8")
230 (source (origin
231 (method url-fetch)
232 (uri (string-append "http://nixos.org/releases/nix/nix-"
233 version "/nix-" version ".tar.xz"))
234 (sha256
235 (base32
236 "077hircacgi9y4n6kf48qp4laz1h3ab6sif3rcci1jy13f05w2m3"))))
237 (build-system gnu-build-system)
238 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
239 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
240 ;; instead of /var/guix. So in the end, we do nothing special.
241 (native-inputs `(("perl" ,perl)
242 ("pkg-config" ,pkg-config)))
243 (inputs `(("curl" ,curl)
244 ("openssl" ,openssl)
245 ("libgc" ,libgc)
246 ("sqlite" ,sqlite)
247 ("bzip2" ,bzip2)))
248 (propagated-inputs `(("perl-www-curl" ,perl-www-curl)
249 ("perl-dbi" ,perl-dbi)
250 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
251 (home-page "http://nixos.org/nix/")
252 (synopsis "The Nix package manager")
253 (description
254 "Nix is a purely functional package manager. This means that it treats
255 packages like values in purely functional programming languages such as
256 Haskell—they are built by functions that don't have side-effects, and they
257 never change after they have been built. Nix stores packages in the Nix
258 store, usually the directory /nix/store, where each package has its own unique
259 sub-directory.")
260 (license lgpl2.1+)))
261
262 (define-public stow
263 (package
264 (name "stow")
265 (version "2.2.0")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append "mirror://gnu/stow/stow-"
269 version ".tar.gz"))
270 (sha256
271 (base32
272 "0arw1nsdlcvd7javkbk2bdvnc31d7dmb6fr25xyyi6ng76cxg2cb"))))
273 (build-system gnu-build-system)
274 (inputs
275 `(("perl" ,perl)))
276 (native-inputs
277 `(("perl-test-simple" ,perl-test-simple)
278 ("perl-test-output" ,perl-test-output)
279 ("perl-capture-tiny" ,perl-capture-tiny)))
280 (home-page "https://www.gnu.org/software/stow/")
281 (synopsis "Managing installed software packages")
282 (description
283 "GNU Stow is a symlink manager. It generates symlinks to directories
284 of data and makes them appear to be merged into the same directory. It is
285 typically used for managing software packages installed from source, by
286 letting you install them apart in distinct directories and then create
287 symlinks to the files in a common directory such as /usr/local.")
288 (license gpl2+)))