gnu: guix: Update development snapshot to 71e2065.
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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 build-system python)
27 #:use-module ((guix licenses) #:select (gpl2+ gpl3+ lgpl2.1+ asl2.0))
28 #:use-module (gnu packages)
29 #:use-module (gnu packages guile)
30 #:use-module (gnu packages file)
31 #:use-module (gnu packages backup)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages graphviz)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages gettext)
39 #:use-module (gnu packages texinfo)
40 #:use-module (gnu packages nettle)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages curl)
43 #:use-module (gnu packages web)
44 #:use-module (gnu packages man)
45 #:use-module (gnu packages emacs)
46 #:use-module (gnu packages bdw-gc)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages popt)
49 #:use-module (gnu packages gnuzilla)
50 #:use-module (gnu packages cpio)
51 #:use-module (gnu packages tls))
52
53 (define (boot-guile-uri arch)
54 "Return the URI for the bootstrap Guile tarball for ARCH."
55 (if (string=? "armhf" arch)
56 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
57 arch "-linux"
58 "/20150101/guile-2.0.11.tar.xz")
59 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
60 arch "-linux"
61 "/20131110/guile-2.0.9.tar.xz")))
62
63 (define-public guix-0.9.0
64 (package
65 (name "guix")
66 (version "0.9.0")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-"
70 version ".tar.gz"))
71 (sha256
72 (base32
73 "0h573z2br0bf43sxyzia9xlm03n3y43zg1snds3c2piq2m6kabrn"))))
74 (build-system gnu-build-system)
75 (arguments
76 `(#:configure-flags (list
77 "--localstatedir=/var"
78 "--sysconfdir=/etc"
79 (string-append "--with-bash-completion-dir="
80 (assoc-ref %outputs "out")
81 "/etc/bash_completion.d")
82 (string-append "--with-libgcrypt-prefix="
83 (assoc-ref %build-inputs
84 "libgcrypt")))
85 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
86 #:phases (modify-phases %standard-phases
87 (add-before
88 'configure 'copy-bootstrap-guile
89 (lambda* (#:key system inputs #:allow-other-keys)
90 (define (boot-guile-version arch)
91 (if (string=? "armhf" arch)
92 "2.0.11"
93 "2.0.9"))
94
95 (define (copy arch)
96 (let ((guile (assoc-ref inputs
97 (string-append "boot-guile/"
98 arch)))
99 (target (string-append "gnu/packages/bootstrap/"
100 arch "-linux/"
101 "/guile-"
102 (boot-guile-version arch)
103 ".tar.xz")))
104 (copy-file guile target)))
105
106 (copy "i686")
107 (copy "x86_64")
108 (copy "mips64el")
109 (copy "armhf")
110 #t))
111 (add-after
112 'unpack 'disable-container-tests
113 ;; XXX FIXME: These tests fail within the build container.
114 (lambda _
115 (substitute* "tests/syscalls.scm"
116 (("^\\(test-assert \"(clone|setns|pivot-root)\"" all)
117 (string-append "(test-skip 1)\n" all)))
118 (substitute* "tests/containers.scm"
119 (("^\\(test-assert" all)
120 (string-append "(test-skip 1)\n" all)))
121 (when (file-exists? "tests/guix-environment-container.sh")
122 (substitute* "tests/guix-environment-container.sh"
123 (("guix environment --version")
124 "exit 77\n")))
125 #t))
126 (add-before 'check 'set-SHELL
127 (lambda _
128 ;; 'guix environment' tests rely on 'SHELL' having a
129 ;; correct value, so set it.
130 (setenv "SHELL" (which "sh"))
131 #t))
132 (add-after
133 'install 'wrap-program
134 (lambda* (#:key inputs outputs #:allow-other-keys)
135 ;; Make sure the 'guix' command finds GnuTLS and
136 ;; Guile-JSON automatically.
137 (let* ((out (assoc-ref outputs "out"))
138 (json (assoc-ref inputs "guile-json"))
139 (gnutls (assoc-ref inputs "gnutls"))
140 (path (string-append
141 json "/share/guile/site/2.0:"
142 gnutls "/share/guile/site/2.0")))
143 (wrap-program (string-append out "/bin/guix")
144 `("GUILE_LOAD_PATH" ":" prefix (,path))
145 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,path)))
146 #t))))))
147 (native-inputs `(("pkg-config" ,pkg-config)
148 ("emacs" ,emacs-no-x))) ;for guix.el
149 (inputs
150 (let ((boot-guile (lambda (arch hash)
151 (origin
152 (method url-fetch)
153 (uri (boot-guile-uri arch))
154 (sha256 hash)))))
155 `(("bzip2" ,bzip2)
156 ("gzip" ,gzip)
157
158 ("sqlite" ,sqlite)
159 ("libgcrypt" ,libgcrypt)
160 ("guile" ,guile-2.0)
161
162 ("boot-guile/i686"
163 ,(boot-guile "i686"
164 (base32
165 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
166 ("boot-guile/x86_64"
167 ,(boot-guile "x86_64"
168 (base32
169 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
170 ("boot-guile/mips64el"
171 ,(boot-guile "mips64el"
172 (base32
173 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
174 ("boot-guile/armhf"
175 ,(boot-guile "armhf"
176 (base32
177 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))))))
178 (propagated-inputs
179 `(("gnutls" ,gnutls) ;for 'guix download' & co.
180 ("guile-json" ,guile-json)
181 ("geiser" ,geiser))) ;for guix.el
182
183 (home-page "http://www.gnu.org/software/guix")
184 (synopsis "Functional package manager for installed software packages and versions")
185 (description
186 "GNU Guix is a functional package manager for the GNU system, and is
187 also a distribution thereof. It includes a virtual machine image. Besides
188 the usual package management features, it also supports transactional
189 upgrades and roll-backs, per-user profiles, and much more. It is based on
190 the Nix package manager.")
191 (license gpl3+)))
192
193 (define guix-devel
194 ;; Development version of Guix.
195 ;;
196 ;; Note: use a short commit id; when using the long one, the limit on socket
197 ;; file names is exceeded while running the tests.
198 (let ((commit "71e2065a38cf2641b7eb8c557b0f043f5a42a649"))
199 (package (inherit guix-0.9.0)
200 (version (string-append "0.9.0." (string-take commit 7)))
201 (source (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "git://git.sv.gnu.org/guix.git")
205 (commit commit)))
206 (sha256
207 (base32
208 "0wrrywfdc27yxjns55qdz5si49c8zcb9q5557g2kx48dbm7p0dzw"))
209 (file-name (string-append "guix-" version "-checkout"))))
210 (arguments
211 (substitute-keyword-arguments (package-arguments guix-0.9.0)
212 ((#:configure-flags flags)
213 ;; Set 'DOT_USER_PROGRAM' to the empty string so we don't keep a
214 ;; reference to Graphviz, whose closure is pretty big (too big for
215 ;; the GuixSD installation image.)
216 `(cons "ac_cv_path_DOT_USER_PROGRAM=dot" ,flags))
217 ((#:phases phases)
218 `(modify-phases ,phases
219 (add-after
220 'unpack 'bootstrap
221 (lambda _
222 ;; Make sure 'msgmerge' can modify the PO files.
223 (for-each (lambda (po)
224 (chmod po #o666))
225 (find-files "." "\\.po$"))
226
227 (zero? (system* "sh" "bootstrap"))))))))
228 (native-inputs
229 `(("autoconf" ,(autoconf-wrapper))
230 ("automake" ,automake)
231 ("gettext" ,gnu-gettext)
232 ("texinfo" ,texinfo)
233 ("graphviz" ,graphviz)
234 ("help2man" ,help2man)
235 ,@(package-native-inputs guix-0.9.0))))))
236
237 (define-public guix guix-devel)
238
239 (define-public nix
240 (package
241 (name "nix")
242 (version "1.11.2")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append "http://nixos.org/releases/nix/nix-"
246 version "/nix-" version ".tar.xz"))
247 (sha256
248 (base32
249 "1mk9z75gklxcv6kzwwz1h5r2ci5kjy6bh7qwk4m5lf5v9s0k64pw"))))
250 (build-system gnu-build-system)
251 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
252 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
253 ;; instead of /var/guix. So in the end, we do nothing special.
254 (arguments
255 '(#:configure-flags
256 ;; Set the prefixes of Perl libraries to avoid propagation.
257 (let ((perl-libdir (lambda (p)
258 (string-append
259 (assoc-ref %build-inputs p)
260 "/lib/perl5/site_perl"))))
261 (list (string-append "--with-dbi="
262 (perl-libdir "perl-dbi"))
263 (string-append "--with-dbd-sqlite="
264 (perl-libdir "perl-dbd-sqlite"))
265 (string-append "--with-www-curl="
266 (perl-libdir "perl-www-curl"))))))
267 (native-inputs `(("perl" ,perl)
268 ("pkg-config" ,pkg-config)))
269 (inputs `(("curl" ,curl)
270 ("openssl" ,openssl)
271 ("libgc" ,libgc)
272 ("sqlite" ,sqlite)
273 ("bzip2" ,bzip2)
274 ("perl-www-curl" ,perl-www-curl)
275 ("perl-dbi" ,perl-dbi)
276 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
277 (home-page "http://nixos.org/nix/")
278 (synopsis "The Nix package manager")
279 (description
280 "Nix is a purely functional package manager. This means that it treats
281 packages like values in purely functional programming languages such as
282 Haskell—they are built by functions that don't have side-effects, and they
283 never change after they have been built. Nix stores packages in the Nix
284 store, usually the directory /nix/store, where each package has its own unique
285 sub-directory.")
286 (license lgpl2.1+)))
287
288 (define-public stow
289 (package
290 (name "stow")
291 (version "2.2.2")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "mirror://gnu/stow/stow-"
295 version ".tar.gz"))
296 (sha256
297 (base32
298 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
299 (build-system gnu-build-system)
300 (inputs
301 `(("perl" ,perl)))
302 (native-inputs
303 `(("perl-test-simple" ,perl-test-simple)
304 ("perl-test-output" ,perl-test-output)
305 ("perl-capture-tiny" ,perl-capture-tiny)
306 ("perl-io-stringy" ,perl-io-stringy)))
307 (home-page "https://www.gnu.org/software/stow/")
308 (synopsis "Managing installed software packages")
309 (description
310 "GNU Stow is a symlink manager. It generates symlinks to directories
311 of data and makes them appear to be merged into the same directory. It is
312 typically used for managing software packages installed from source, by
313 letting you install them apart in distinct directories and then create
314 symlinks to the files in a common directory such as /usr/local.")
315 (license gpl2+)))
316
317 (define-public rpm
318 (package
319 (name "rpm")
320 (version "4.12.0")
321 (source (origin
322 (method url-fetch)
323 (uri (string-append "http://rpm.org/releases/rpm-4.12.x/rpm-"
324 version ".tar.bz2"))
325 (sha256
326 (base32
327 "18hk47hc755nslvb7xkq4jb095z7va0nlcyxdpxayc4lmb8mq3bp"))))
328 (build-system gnu-build-system)
329 (arguments
330 '(#:configure-flags '("--with-external-db" ;use the system's bdb
331 "--enable-python"
332 "--without-lua")
333 #:phases (modify-phases %standard-phases
334 (add-before 'configure 'set-nspr-search-path
335 (lambda* (#:key inputs #:allow-other-keys)
336 ;; nspr.pc contains the right -I flag pointing to
337 ;; 'include/nspr', but unfortunately 'configure' doesn't
338 ;; use 'pkg-config'. Thus, augment CPATH.
339 ;; Likewise for NSS.
340 (let ((nspr (assoc-ref inputs "nspr"))
341 (nss (assoc-ref inputs "nss")))
342 (setenv "CPATH"
343 (string-append (getenv "C_INCLUDE_PATH") ":"
344 nspr "/include/nspr:"
345 nss "/include/nss"))
346 (setenv "LIBRARY_PATH"
347 (string-append (getenv "LIBRARY_PATH") ":"
348 nss "/lib/nss"))
349 #t)))
350 (add-after 'install 'fix-rpm-symlinks
351 (lambda* (#:key outputs #:allow-other-keys)
352 ;; 'make install' gets these symlinks wrong. Fix them.
353 (let* ((out (assoc-ref outputs "out"))
354 (bin (string-append out "/bin")))
355 (with-directory-excursion bin
356 (for-each (lambda (file)
357 (delete-file file)
358 (symlink "rpm" file))
359 '("rpmquery" "rpmverify"))
360 #t)))))))
361 (native-inputs
362 `(("pkg-config" ,pkg-config)))
363 (inputs
364 `(("python" ,python-2)
365 ("xz" ,xz)
366 ("bdb" ,bdb)
367 ("popt" ,popt)
368 ("nss" ,nss)
369 ("nspr" ,nspr)
370 ("libarchive" ,libarchive)
371 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
372 ("file" ,file)
373 ("bzip2" ,bzip2)
374 ("zlib" ,zlib)
375 ("cpio" ,cpio)))
376 (home-page "http://www.rpm.org/")
377 (synopsis "The RPM Package Manager")
378 (description
379 "The RPM Package Manager (RPM) is a command-line driven package
380 management system capable of installing, uninstalling, verifying, querying,
381 and updating computer software packages. Each software package consists of an
382 archive of files along with information about the package like its version, a
383 description. There is also a library permitting developers to manage such
384 transactions from C or Python.")
385
386 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
387 (license gpl2+)))
388
389 (define-public diffoscope
390 (package
391 (name "diffoscope")
392 (version "49")
393 (source (origin
394 (method url-fetch)
395 (uri (pypi-uri name version))
396 (sha256
397 (base32
398 "1mf6b7j82ckn90ggz6bp6c2jydz87xj8r8jmfl4hg7jcmf7dxmim"))))
399 (build-system python-build-system)
400 (arguments
401 `(#:phases (modify-phases %standard-phases
402 ;; setup.py mistakenly requires python-magic from PyPi, even
403 ;; though the Python bindings of `file` are sufficient.
404 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
405 (add-after 'unpack 'dependency-on-python-magic
406 (lambda _
407 (substitute* "setup.py"
408 (("'python-magic',") ""))))
409 (add-before 'build 'disable-egg-zipping
410 (lambda _
411 ;; Leave the .egg file uncompressed.
412 (let ((port (open-file "setup.cfg" "a")))
413 (display "\n[easy_install]\nzip_ok = 0\n"
414 port)
415 (close-port port)
416 #t))))))
417 (inputs `(("rpm" ,rpm) ;for rpm-python
418 ("python-file" ,python-file)
419 ("python-debian" ,python-debian)
420 ("python-libarchive-c" ,python-libarchive-c)
421 ("python-tlsh" ,python-tlsh)
422
423 ;; Below are modules used for tests.
424 ("python-pytest" ,python-pytest)
425 ("python-chardet" ,python-chardet)))
426 (home-page "http://diffoscope.org/")
427 (synopsis "Compare files, archives, and directories in depth")
428 (description
429 "Diffoscope tries to get to the bottom of what makes files or directories
430 different. It recursively unpacks archives of many kinds and transforms
431 various binary formats into more human readable forms to compare them. It can
432 compare two tarballs, ISO images, or PDFs just as easily.")
433 (license gpl3+)))