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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
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/"
58 "/20150101/guile-2.0.11.tar.xz")
59 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
61 "/20131110/guile-2.0.9.tar.xz")))
63 (define-public guix-0.10.0
69 (uri (string-append "ftp://alpha.gnu.org/gnu/guix/guix-"
73 "0d4afwy7bpqi4k4bzvwc4ga4shwssis1nrvdw53qjyg9bw1a8lbn"))))
74 (build-system gnu-build-system)
76 `(#:configure-flags (list
77 "--localstatedir=/var"
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
85 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
86 #:phases (modify-phases %standard-phases
88 'configure 'copy-bootstrap-guile
89 (lambda* (#:key system inputs #:allow-other-keys)
90 (define (boot-guile-version arch)
91 (if (string=? "armhf" arch)
96 (let ((guile (assoc-ref inputs
97 (string-append "boot-guile/"
99 (target (string-append "gnu/packages/bootstrap/"
102 (boot-guile-version arch)
104 (copy-file guile target)))
112 'unpack 'disable-container-tests
113 ;; XXX FIXME: These tests fail within the build container.
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")
126 (add-before 'check 'set-SHELL
128 ;; 'guix environment' tests rely on 'SHELL' having a
129 ;; correct value, so set it.
130 (setenv "SHELL" (which "sh"))
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"))
141 json "/share/guile/site/2.0:"
142 gnutls "/share/guile/site/2.0")))
144 ;; Ignore user settings so that a bogus
145 ;; GUILE_LOAD_COMPILED_PATH does not prevent use of
146 ;; 'guix', notably when it contains entries pointing to
147 ;; incompatible .go files as reported at
148 ;; <https://lists.gnu.org/archive/html/guix-devel/2016-03/msg01261.html>.
149 (wrap-program (string-append out "/bin/guix")
150 `("GUILE_LOAD_PATH" ":" = (,path))
151 `("GUILE_LOAD_COMPILED_PATH" ":" = (,path)))
154 (native-inputs `(("pkg-config" ,pkg-config)
155 ("emacs" ,emacs-minimal))) ;for guix.el
157 (let ((boot-guile (lambda (arch hash)
160 (uri (boot-guile-uri arch))
166 ("libgcrypt" ,libgcrypt)
172 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
174 ,(boot-guile "x86_64"
176 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
177 ("boot-guile/mips64el"
178 ,(boot-guile "mips64el"
180 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
184 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))))))
186 `(("gnutls" ,gnutls) ;for 'guix download' & co.
187 ("guile-json" ,guile-json)
188 ("geiser" ,geiser))) ;for guix.el
190 (home-page "http://www.gnu.org/software/guix")
191 (synopsis "Functional package manager for installed software packages and versions")
193 "GNU Guix is a functional package manager for the GNU system, and is
194 also a distribution thereof. It includes a virtual machine image. Besides
195 the usual package management features, it also supports transactional
196 upgrades and roll-backs, per-user profiles, and much more. It is based on
197 the Nix package manager.")
199 (properties '((ftp-server . "alpha.gnu.org")))))
202 ;; Development version of Guix.
204 ;; Note: use a very short commit id; with a longer one, the limit on
205 ;; hash-bang lines would be exceeded while running the tests.
206 (let ((commit "e9017c98d61f305b624bacaa30e8891ec0100980"))
207 (package (inherit guix-0.10.0)
208 (version (string-append "0.10.0-0." (string-take commit 4)))
212 ;; "git://git.sv.gnu.org/guix.git" temporarily
213 ;; unavailable (XXX).
214 (url "http://git.savannah.gnu.org/r/guix.git")
218 "13mfk10cw6fk4diclzld56xwabshanxjcczdrjlj0wisaz32h3nl"))
219 (file-name (string-append "guix-" version "-checkout"))))
221 (substitute-keyword-arguments (package-arguments guix-0.10.0)
222 ((#:configure-flags flags)
223 ;; Set 'DOT_USER_PROGRAM' to the empty string so we don't keep a
224 ;; reference to Graphviz, whose closure is pretty big (too big for
225 ;; the GuixSD installation image.)
226 `(cons "ac_cv_path_DOT_USER_PROGRAM=dot" ,flags))
228 `(modify-phases ,phases
232 ;; Make sure 'msgmerge' can modify the PO files.
233 (for-each (lambda (po)
235 (find-files "." "\\.po$"))
237 (zero? (system* "sh" "bootstrap"))))))))
239 `(("autoconf" ,(autoconf-wrapper))
240 ("automake" ,automake)
241 ("gettext" ,gnu-gettext)
243 ("graphviz" ,graphviz)
244 ("help2man" ,help2man)
245 ,@(package-native-inputs guix-0.10.0))))))
247 (define-public guix guix-devel)
255 (uri (string-append "http://nixos.org/releases/nix/nix-"
256 version "/nix-" version ".tar.xz"))
259 "1mk9z75gklxcv6kzwwz1h5r2ci5kjy6bh7qwk4m5lf5v9s0k64pw"))))
260 (build-system gnu-build-system)
261 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
262 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
263 ;; instead of /var/guix. So in the end, we do nothing special.
266 ;; Set the prefixes of Perl libraries to avoid propagation.
267 (let ((perl-libdir (lambda (p)
269 (assoc-ref %build-inputs p)
270 "/lib/perl5/site_perl"))))
271 (list (string-append "--with-dbi="
272 (perl-libdir "perl-dbi"))
273 (string-append "--with-dbd-sqlite="
274 (perl-libdir "perl-dbd-sqlite"))
275 (string-append "--with-www-curl="
276 (perl-libdir "perl-www-curl"))))))
277 (native-inputs `(("perl" ,perl)
278 ("pkg-config" ,pkg-config)))
279 (inputs `(("curl" ,curl)
284 ("perl-www-curl" ,perl-www-curl)
285 ("perl-dbi" ,perl-dbi)
286 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
287 (home-page "http://nixos.org/nix/")
288 (synopsis "The Nix package manager")
290 "Nix is a purely functional package manager. This means that it treats
291 packages like values in purely functional programming languages such as
292 Haskell—they are built by functions that don't have side-effects, and they
293 never change after they have been built. Nix stores packages in the Nix
294 store, usually the directory /nix/store, where each package has its own unique
304 (uri (string-append "mirror://gnu/stow/stow-"
308 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
309 (build-system gnu-build-system)
313 `(("perl-test-simple" ,perl-test-simple)
314 ("perl-test-output" ,perl-test-output)
315 ("perl-capture-tiny" ,perl-capture-tiny)
316 ("perl-io-stringy" ,perl-io-stringy)))
317 (home-page "https://www.gnu.org/software/stow/")
318 (synopsis "Managing installed software packages")
320 "GNU Stow is a symlink manager. It generates symlinks to directories
321 of data and makes them appear to be merged into the same directory. It is
322 typically used for managing software packages installed from source, by
323 letting you install them apart in distinct directories and then create
324 symlinks to the files in a common directory such as /usr/local.")
333 (uri (string-append "http://rpm.org/releases/rpm-4.12.x/rpm-"
337 "0a82ym8phx7g0f3k6smvxnvzh7yv857l42xafk49689kzhld5pbp"))))
338 (build-system gnu-build-system)
340 '(#:configure-flags '("--with-external-db" ;use the system's bdb
343 #:phases (modify-phases %standard-phases
344 (add-before 'configure 'set-nspr-search-path
345 (lambda* (#:key inputs #:allow-other-keys)
346 ;; nspr.pc contains the right -I flag pointing to
347 ;; 'include/nspr', but unfortunately 'configure' doesn't
348 ;; use 'pkg-config'. Thus, augment CPATH.
350 (let ((nspr (assoc-ref inputs "nspr"))
351 (nss (assoc-ref inputs "nss")))
353 (string-append (getenv "C_INCLUDE_PATH") ":"
354 nspr "/include/nspr:"
356 (setenv "LIBRARY_PATH"
357 (string-append (getenv "LIBRARY_PATH") ":"
360 (add-after 'install 'fix-rpm-symlinks
361 (lambda* (#:key outputs #:allow-other-keys)
362 ;; 'make install' gets these symlinks wrong. Fix them.
363 (let* ((out (assoc-ref outputs "out"))
364 (bin (string-append out "/bin")))
365 (with-directory-excursion bin
366 (for-each (lambda (file)
368 (symlink "rpm" file))
369 '("rpmquery" "rpmverify"))
372 `(("pkg-config" ,pkg-config)))
374 `(("python" ,python-2)
380 ("libarchive" ,libarchive)
381 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
386 (home-page "http://www.rpm.org/")
387 (synopsis "The RPM Package Manager")
389 "The RPM Package Manager (RPM) is a command-line driven package
390 management system capable of installing, uninstalling, verifying, querying,
391 and updating computer software packages. Each software package consists of an
392 archive of files along with information about the package like its version, a
393 description. There is also a library permitting developers to manage such
394 transactions from C or Python.")
396 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
399 (define-public diffoscope
405 (uri (pypi-uri name version))
408 "18rn6rrwh586228vnaf1nq0wayh19zbvfc0qmnbys6ln2pv2v007"))))
409 (build-system python-build-system)
411 `(#:phases (modify-phases %standard-phases
412 ;; setup.py mistakenly requires python-magic from PyPi, even
413 ;; though the Python bindings of `file` are sufficient.
414 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
415 (add-after 'unpack 'dependency-on-python-magic
417 (substitute* "setup.py"
418 (("'python-magic',") ""))))
419 (add-before 'build 'disable-egg-zipping
421 ;; Leave the .egg file uncompressed.
422 (let ((port (open-file "setup.cfg" "a")))
423 (display "\n[easy_install]\nzip_ok = 0\n"
427 (inputs `(("rpm" ,rpm) ;for rpm-python
428 ("python-file" ,python-file)
429 ("python-debian" ,python-debian)
430 ("python-libarchive-c" ,python-libarchive-c)
431 ("python-tlsh" ,python-tlsh)
433 ;; Below are modules used for tests.
434 ("python-pytest" ,python-pytest)
435 ("python-chardet" ,python-chardet)))
436 (home-page "http://diffoscope.org/")
437 (synopsis "Compare files, archives, and directories in depth")
439 "Diffoscope tries to get to the bottom of what makes files or directories
440 different. It recursively unpacks archives of many kinds and transforms
441 various binary formats into more human readable forms to compare them. It can
442 compare two tarballs, ISO images, or PDFs just as easily.")