Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
5 ;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Rutger Helling <rhelling@mykolab.com>
10 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages package-management)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages acl)
30 #:use-module (gnu packages attr)
31 #:use-module (gnu packages avahi)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages backup)
34 #:use-module (gnu packages bdw-gc)
35 #:use-module (gnu packages bison)
36 #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages cpio)
40 #:use-module (gnu packages crypto)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages docbook)
44 #:use-module (gnu packages emacs)
45 #:use-module (gnu packages file)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gnome)
49 #:use-module (gnu packages gnupg)
50 #:use-module (gnu packages gnuzilla)
51 #:use-module (gnu packages graphviz)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages lisp)
55 #:use-module (gnu packages man)
56 #:use-module (gnu packages nettle)
57 #:use-module (gnu packages patchutils)
58 #:use-module (gnu packages perl)
59 #:use-module (gnu packages perl-check)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages popt)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages python-web)
64 #:use-module (gnu packages serialization)
65 #:use-module (gnu packages ssh)
66 #:use-module (gnu packages texinfo)
67 #:use-module (gnu packages time)
68 #:use-module (gnu packages tls)
69 #:use-module (gnu packages vim)
70 #:use-module (gnu packages web)
71 #:use-module (gnu packages xml)
72 #:use-module (guix build-system emacs)
73 #:use-module (guix build-system gnu)
74 #:use-module (guix build-system meson)
75 #:use-module (guix build-system python)
76 #:use-module (guix download)
77 #:use-module (guix gexp)
78 #:use-module (guix git-download)
79 #:use-module ((guix licenses) #:prefix license:)
80 #:use-module (guix packages)
81 #:use-module (guix utils)
82 #:use-module (ice-9 match)
83 #:use-module (srfi srfi-1))
84
85 (define (boot-guile-uri arch)
86 "Return the URI for the bootstrap Guile tarball for ARCH."
87 (cond ((string=? "armhf" arch)
88 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
89 arch "-linux"
90 "/20150101/guile-2.0.11.tar.xz"))
91 ((string=? "aarch64" arch)
92 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
93 arch "-linux/20170217/guile-2.0.14.tar.xz"))
94 (else
95 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
96 arch "-linux"
97 "/20131110/guile-2.0.9.tar.xz"))))
98
99 (define-public guix
100 ;; Latest version of Guix, which may or may not correspond to a release.
101 ;; Note: the 'update-guix-package.scm' script expects this definition to
102 ;; start precisely like this.
103 (let ((version "0.15.0")
104 (commit "8bbb79cf95a07a40950448a8a09d888254404ed4")
105 (revision 2))
106 (package
107 (name "guix")
108
109 (version (if (zero? revision)
110 version
111 (string-append version "-"
112 (number->string revision)
113 "." (string-take commit 7))))
114 (source (origin
115 (method git-fetch)
116 (uri (git-reference
117 (url "https://git.savannah.gnu.org/r/guix.git")
118 (commit commit)))
119 (sha256
120 (base32
121 "0h83l91v2cg9bb78c7vqx9wj71ckz22jbjmm2fy4vqs9216jnvc0"))
122 (file-name (string-append "guix-" version "-checkout"))))
123 (build-system gnu-build-system)
124 (arguments
125 `(#:configure-flags (list
126 "--localstatedir=/var"
127 "--sysconfdir=/etc"
128 (string-append "--with-bash-completion-dir="
129 (assoc-ref %outputs "out")
130 "/etc/bash_completion.d")
131 (string-append "--with-libgcrypt-prefix="
132 (assoc-ref %build-inputs
133 "libgcrypt"))
134
135 ;; Set 'DOT_USER_PROGRAM' to the empty string so
136 ;; we don't keep a reference to Graphviz, whose
137 ;; closure is pretty big (too big for the GuixSD
138 ;; installation image.)
139 "ac_cv_path_DOT_USER_PROGRAM=dot"
140
141 ;; To avoid problems with the length of shebangs,
142 ;; choose a fixed-width and short directory name
143 ;; for tests.
144 "ac_cv_guix_test_root=/tmp/guix-tests")
145 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
146
147 #:modules ((guix build gnu-build-system)
148 (guix build utils)
149 (srfi srfi-26)
150 (ice-9 popen)
151 (ice-9 rdelim))
152
153 #:phases (modify-phases %standard-phases
154 (replace 'bootstrap
155 (lambda _
156 ;; Make sure 'msgmerge' can modify the PO files.
157 (for-each (lambda (po)
158 (chmod po #o666))
159 (find-files "." "\\.po$"))
160
161 (patch-shebang "build-aux/git-version-gen")
162
163 (call-with-output-file ".tarball-version"
164 (lambda (port)
165 (display ,version port)))
166
167 (invoke "sh" "bootstrap")))
168 (add-before 'check 'copy-bootstrap-guile
169 (lambda* (#:key system inputs #:allow-other-keys)
170 ;; Copy the bootstrap guile tarball in the store used
171 ;; by the test suite.
172 (define (intern tarball)
173 (let ((base (strip-store-file-name tarball)))
174 (copy-file tarball base)
175 (invoke "./test-env" "guix" "download"
176 (string-append "file://" (getcwd)
177 "/" base))
178 (delete-file base)))
179
180
181 (intern (assoc-ref inputs "boot-guile"))
182
183 ;; On x86_64 some tests need the i686 Guile.
184 ,@(if (and (not (%current-target-system))
185 (string=? (%current-system)
186 "x86_64-linux"))
187 '((intern (assoc-ref inputs "boot-guile/i686")))
188 '())
189 #t))
190 (add-after 'unpack 'disable-failing-tests
191 ;; XXX FIXME: These tests fail within the build container.
192 (lambda _
193 (substitute* "tests/syscalls.scm"
194 (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
195 (string-append "(test-skip 1)\n" all)))
196 (substitute* "tests/containers.scm"
197 (("^\\(test-(assert|equal)" all)
198 (string-append "(test-skip 1)\n" all)))
199 (when (file-exists? "tests/guix-environment-container.sh")
200 (substitute* "tests/guix-environment-container.sh"
201 (("guix environment --version")
202 "exit 77\n")))
203 #t))
204 (add-before 'check 'set-SHELL
205 (lambda _
206 ;; 'guix environment' tests rely on 'SHELL' having a
207 ;; correct value, so set it.
208 (setenv "SHELL" (which "sh"))
209 #t))
210 (add-after 'install 'wrap-program
211 (lambda* (#:key inputs outputs #:allow-other-keys)
212 ;; Make sure the 'guix' command finds GnuTLS,
213 ;; Guile-JSON, and Guile-Git automatically.
214 (let* ((out (assoc-ref outputs "out"))
215 (guile (assoc-ref inputs "guile"))
216 (json (assoc-ref inputs "guile-json"))
217 (sqlite (assoc-ref inputs "guile-sqlite3"))
218 (git (assoc-ref inputs "guile-git"))
219 (bs (assoc-ref inputs
220 "guile-bytestructures"))
221 (ssh (assoc-ref inputs "guile-ssh"))
222 (gnutls (assoc-ref inputs "gnutls"))
223 (deps (list json sqlite gnutls git bs ssh))
224 (effective
225 (read-line
226 (open-pipe* OPEN_READ
227 (string-append guile "/bin/guile")
228 "-c" "(display (effective-version))")))
229 (path (string-join
230 (map (cut string-append <>
231 "/share/guile/site/"
232 effective)
233 deps)
234 ":"))
235 (gopath (string-join
236 (map (cut string-append <>
237 "/lib/guile/" effective
238 "/site-ccache")
239 deps)
240 ":")))
241
242 (wrap-program (string-append out "/bin/guix")
243 `("GUILE_LOAD_PATH" ":" prefix (,path))
244 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath)))
245
246 #t))))))
247 (native-inputs `(("pkg-config" ,pkg-config)
248
249 ;; XXX: Keep the development inputs here even though
250 ;; they're unnecessary, just so that 'guix environment
251 ;; guix' always contains them.
252 ("autoconf" ,autoconf-wrapper)
253 ("automake" ,automake)
254 ("gettext" ,gettext-minimal)
255 ("texinfo" ,texinfo)
256 ("graphviz" ,graphviz)
257 ("help2man" ,help2man)
258 ("po4a" ,po4a)))
259 (inputs
260 `(("bzip2" ,bzip2)
261 ("gzip" ,gzip)
262 ("zlib" ,zlib) ;for 'guix publish'
263
264 ("sqlite" ,sqlite)
265 ("libgcrypt" ,libgcrypt)
266
267 ;; Use 2.2.4 to avoid various thread-safety issues while building
268 ;; code in parallel.
269 ("guile" ,guile-2.2.4)
270
271 ;; Many tests rely on the 'guile-bootstrap' package, which is why we
272 ;; have it here.
273 ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
274 ;; Some of the tests use "unshare" when it is available.
275 ("util-linux" ,util-linux)
276 ,@(if (and (not (%current-target-system))
277 (string=? (%current-system) "x86_64-linux"))
278 `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
279 '())))
280 (propagated-inputs
281 `(("gnutls" ,gnutls)
282 ("guile-json" ,guile-json)
283 ("guile-sqlite3" ,guile-sqlite3)
284 ("guile-ssh" ,guile-ssh)
285 ("guile-git" ,guile-git)))
286
287 (home-page "https://www.gnu.org/software/guix/")
288 (synopsis "Functional package manager for installed software packages and versions")
289 (description
290 "GNU Guix is a functional package manager for the GNU system, and is
291 also a distribution thereof. It includes a virtual machine image. Besides
292 the usual package management features, it also supports transactional
293 upgrades and roll-backs, per-user profiles, and much more. It is based on
294 the Nix package manager.")
295 (license license:gpl3+)
296 (properties '((ftp-server . "alpha.gnu.org"))))))
297
298 ;; Alias for backward compatibility.
299 (define-public guix-devel guix)
300
301 (define-public guix-daemon
302 ;; This package is for internal consumption: it allows us to quickly build
303 ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
304 ;; pull'.
305 (package
306 (inherit guix)
307 (properties `((hidden? . #t)))
308 (name "guix-daemon")
309
310 ;; Use a minimum set of dependencies.
311 (native-inputs
312 (fold alist-delete (package-native-inputs guix)
313 '("po4a" "graphviz" "help2man")))
314 (inputs
315 `(("gnutls" ,gnutls)
316 ("guile-git" ,guile-git)
317 ,@(fold alist-delete (package-inputs guix)
318 '("boot-guile" "boot-guile/i686" "util-linux"))))
319
320 (propagated-inputs '())
321
322 (arguments
323 (substitute-keyword-arguments (package-arguments guix)
324 ((#:configure-flags flags '())
325 ;; Pretend we have those libraries; we don't actually need them.
326 `(append ,flags
327 '("guix_cv_have_recent_guile_sqlite3=yes"
328 "guix_cv_have_recent_guile_ssh=yes")))
329 ((#:tests? #f #f)
330 #f)
331 ((#:phases phases '%standard-phases)
332 `(modify-phases ,phases
333 (replace 'build
334 (lambda _
335 (invoke "make" "nix/libstore/schema.sql.hh")
336 (invoke "make" "-j" (number->string
337 (parallel-job-count))
338 "guix-daemon")))
339 (delete 'copy-bootstrap-guile)
340 (replace 'install
341 (lambda* (#:key outputs #:allow-other-keys)
342 (invoke "make" "install-binPROGRAMS"
343 "install-nodist_pkglibexecSCRIPTS")
344
345 ;; We need to tell 'guix-daemon' which 'guix' command to use.
346 ;; Here we use a questionable hack where we hard-code
347 ;; "~root/.config", which could be wrong (XXX).
348 (let ((out (assoc-ref outputs "out")))
349 (substitute* (find-files (string-append out "/libexec"))
350 (("exec \".*/bin/guix\"")
351 "exec ~root/.config/guix/current/bin/guix"))
352 #t)))
353 (delete 'wrap-program)))))))
354
355 (define-public guile2.0-guix
356 (package
357 (inherit guix)
358 (name "guile2.0-guix")
359 (inputs
360 `(("guile" ,guile-2.0)
361 ,@(alist-delete "guile" (package-inputs guix))))
362 (propagated-inputs
363 `(("gnutls" ,gnutls/guile-2.0)
364 ("guile-json" ,guile2.0-json)
365 ("guile-ssh" ,guile2.0-ssh)
366 ("guile-git" ,guile2.0-git)))))
367
368 (define (source-file? file stat)
369 "Return true if FILE is likely a source file, false if it is a typical
370 generated file."
371 (define (wrong-extension? file)
372 (or (string-suffix? "~" file)
373 (member (file-extension file)
374 '("o" "a" "lo" "so" "go"))))
375
376 (match (basename file)
377 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
378 #f)
379 ((? wrong-extension?)
380 #f)
381 (_
382 #t)))
383
384 (define-public current-guix
385 (let* ((repository-root (canonicalize-path
386 (string-append (current-source-directory)
387 "/../..")))
388 (select? (delay (or (git-predicate repository-root)
389 source-file?))))
390 (lambda ()
391 "Return a package representing Guix built from the current source tree.
392 This works by adding the current source tree to the store (after filtering it
393 out) and returning a package that uses that as its 'source'."
394 (package
395 (inherit guix)
396 (version (string-append (package-version guix) "+"))
397 (source (local-file repository-root "guix-current"
398 #:recursive? #t
399 #:select? (force select?)))))))
400
401 \f
402 ;;;
403 ;;; Other tools.
404 ;;;
405
406 (define-public nix
407 (package
408 (name "nix")
409 (version "2.0.4")
410 (source (origin
411 (method url-fetch)
412 (uri (string-append "http://nixos.org/releases/nix/nix-"
413 version "/nix-" version ".tar.xz"))
414 (sha256
415 (base32
416 "0ss9svxlh1pvrdmnqjvjyqjmbqmrdbyfarvbb14i9d4bggzl0r8n"))))
417 (build-system gnu-build-system)
418 (native-inputs `(("pkg-config" ,pkg-config)))
419 (inputs `(("curl" ,curl)
420 ("bzip2" ,bzip2)
421 ("libgc" ,libgc)
422 ("libseccomp" ,libseccomp)
423 ("libsodium" ,libsodium)
424 ("openssl" ,openssl)
425 ("sqlite" ,sqlite)
426 ("xz" ,xz)))
427 (home-page "https://nixos.org/nix/")
428 (synopsis "The Nix package manager")
429 (description
430 "Nix is a purely functional package manager. This means that it treats
431 packages like values in purely functional programming languages such as
432 Haskell—they are built by functions that don't have side-effects, and they
433 never change after they have been built. Nix stores packages in the Nix
434 store, usually the directory /nix/store, where each package has its own unique
435 sub-directory.")
436 (license license:lgpl2.1+)))
437
438 (define-public emacs-nix-mode
439 (package
440 (name "emacs-nix-mode")
441 (version "1.2.2")
442 (source
443 (origin
444 (method url-fetch)
445 (uri (string-append "https://github.com/NixOS/nix-mode/archive/v"
446 version ".tar.gz"))
447 (file-name (string-append name "-" version ".tar.gz"))
448 (sha256
449 (base32
450 "06aqz0czznsj8835jqnk794sy2p6pa8kxfqwh0nl5d5vxivria6z"))))
451 (build-system emacs-build-system)
452 (inputs
453 `(("emacs-company" ,emacs-company)
454 ("emacs-mmm-mode" ,emacs-mmm-mode)))
455 (home-page "https://github.com/NixOS/nix-mode")
456 (synopsis "Emacs major mode for editing Nix expressions")
457 (description "@code{nixos-mode} provides an Emacs major mode for editing
458 Nix expressions. It supports syntax highlighting, indenting and refilling of
459 comments.")
460 (license license:lgpl2.1+)))
461
462 (define-public stow
463 (package
464 (name "stow")
465 (version "2.2.2")
466 (source (origin
467 (method url-fetch)
468 (uri (string-append "mirror://gnu/stow/stow-"
469 version ".tar.gz"))
470 (sha256
471 (base32
472 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
473 (build-system gnu-build-system)
474 (inputs
475 `(("perl" ,perl)))
476 (native-inputs
477 `(("perl-test-simple" ,perl-test-simple)
478 ("perl-test-output" ,perl-test-output)
479 ("perl-capture-tiny" ,perl-capture-tiny)
480 ("perl-io-stringy" ,perl-io-stringy)))
481 (home-page "https://www.gnu.org/software/stow/")
482 (synopsis "Managing installed software packages")
483 (description
484 "GNU Stow is a symlink manager. It generates symlinks to directories
485 of data and makes them appear to be merged into the same directory. It is
486 typically used for managing software packages installed from source, by
487 letting you install them apart in distinct directories and then create
488 symlinks to the files in a common directory such as /usr/local.")
489 (license license:gpl2+)))
490
491 (define-public rpm
492 (package
493 (name "rpm")
494 (version "4.13.0.2")
495 (source (origin
496 (method url-fetch)
497 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
498 (version-major+minor version) ".x/rpm-"
499 version ".tar.bz2"))
500 (sha256
501 (base32
502 "1521y4ghjns449kzpwkjn9cksh686383xnfx0linzlalqc3jqgig"))))
503 (build-system gnu-build-system)
504 (arguments
505 '(#:configure-flags '("--with-external-db" ;use the system's bdb
506 "--enable-python"
507 "--without-lua")
508 #:phases (modify-phases %standard-phases
509 (add-before 'configure 'set-nspr-search-path
510 (lambda* (#:key inputs #:allow-other-keys)
511 ;; nspr.pc contains the right -I flag pointing to
512 ;; 'include/nspr', but unfortunately 'configure' doesn't
513 ;; use 'pkg-config'. Thus, augment CPATH.
514 ;; Likewise for NSS.
515 (let ((nspr (assoc-ref inputs "nspr"))
516 (nss (assoc-ref inputs "nss")))
517 (setenv "CPATH"
518 (string-append (getenv "C_INCLUDE_PATH") ":"
519 nspr "/include/nspr:"
520 nss "/include/nss"))
521 (setenv "LIBRARY_PATH"
522 (string-append (getenv "LIBRARY_PATH") ":"
523 nss "/lib/nss"))
524 #t)))
525 (add-after 'install 'fix-rpm-symlinks
526 (lambda* (#:key outputs #:allow-other-keys)
527 ;; 'make install' gets these symlinks wrong. Fix them.
528 (let* ((out (assoc-ref outputs "out"))
529 (bin (string-append out "/bin")))
530 (with-directory-excursion bin
531 (for-each (lambda (file)
532 (delete-file file)
533 (symlink "rpm" file))
534 '("rpmquery" "rpmverify"))
535 #t)))))))
536 (native-inputs
537 `(("pkg-config" ,pkg-config)))
538 (inputs
539 `(("python" ,python-2)
540 ("xz" ,xz)
541 ("bdb" ,bdb)
542 ("popt" ,popt)
543 ("nss" ,nss)
544 ("nspr" ,nspr)
545 ("libarchive" ,libarchive)
546 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
547 ("file" ,file)
548 ("bzip2" ,bzip2)
549 ("zlib" ,zlib)
550 ("cpio" ,cpio)))
551 (home-page "http://www.rpm.org/")
552 (synopsis "The RPM Package Manager")
553 (description
554 "The RPM Package Manager (RPM) is a command-line driven package
555 management system capable of installing, uninstalling, verifying, querying,
556 and updating computer software packages. Each software package consists of an
557 archive of files along with information about the package like its version, a
558 description. There is also a library permitting developers to manage such
559 transactions from C or Python.")
560
561 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
562 (license license:gpl2+)))
563
564 (define-public diffoscope
565 (package
566 (name "diffoscope")
567 (version "96")
568 (source (origin
569 (method url-fetch)
570 (uri (pypi-uri name version))
571 (sha256
572 (base32
573 "1x66f2x8miy3giff14higpcs70c0zb5d3gj6yn8ac6p183sngl72"))))
574 (build-system python-build-system)
575 (arguments
576 `(#:phases (modify-phases %standard-phases
577 ;; setup.py mistakenly requires python-magic from PyPi, even
578 ;; though the Python bindings of `file` are sufficient.
579 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
580 (add-after 'unpack 'dependency-on-python-magic
581 (lambda _
582 (substitute* "setup.py"
583 (("'python-magic',") ""))))
584 (add-after 'unpack 'embed-tool-references
585 (lambda* (#:key inputs #:allow-other-keys)
586 (substitute* "diffoscope/comparators/utils/compare.py"
587 (("\\['xxd',")
588 (string-append "['" (which "xxd") "',")))
589 (substitute* "diffoscope/comparators/elf.py"
590 (("@tool_required\\('readelf'\\)") "")
591 (("get_tool_name\\('readelf'\\)")
592 (string-append "'" (which "readelf") "'")))
593 (substitute* "diffoscope/comparators/directory.py"
594 (("@tool_required\\('stat'\\)") "")
595 (("@tool_required\\('getfacl'\\)") "")
596 (("\\['stat',")
597 (string-append "['" (which "stat") "',"))
598 (("\\['getfacl',")
599 (string-append "['" (which "getfacl") "',")))
600 #t))
601 (add-before 'check 'delete-failing-test
602 (lambda _
603 (delete-file "tests/test_tools.py") ;this requires /sbin to be on the path
604 #t)))))
605 (inputs `(("rpm" ,rpm) ;for rpm-python
606 ("python-file" ,python-file)
607 ("python-debian" ,python-debian)
608 ("python-libarchive-c" ,python-libarchive-c)
609 ("python-tlsh" ,python-tlsh)
610 ("acl" ,acl) ;for getfacl
611 ("colordiff" ,colordiff)
612 ("xxd" ,xxd)
613
614 ;; Below are modules used for tests.
615 ("python-pytest" ,python-pytest)
616 ("python-chardet" ,python-chardet)))
617 (home-page "https://diffoscope.org/")
618 (synopsis "Compare files, archives, and directories in depth")
619 (description
620 "Diffoscope tries to get to the bottom of what makes files or directories
621 different. It recursively unpacks archives of many kinds and transforms
622 various binary formats into more human readable forms to compare them. It can
623 compare two tarballs, ISO images, or PDFs just as easily.")
624 (license license:gpl3+)))
625
626 (define-public python-anaconda-client
627 (package
628 (name "python-anaconda-client")
629 (version "1.6.3")
630 (source
631 (origin
632 (method url-fetch)
633 (uri (string-append "https://github.com/Anaconda-Platform/"
634 "anaconda-client/archive/" version ".tar.gz"))
635 (file-name (string-append name "-" version ".tar.gz"))
636 (sha256
637 (base32
638 "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
639 (build-system python-build-system)
640 (propagated-inputs
641 `(("python-pyyaml" ,python-pyyaml)
642 ("python-requests" ,python-requests)
643 ("python-clyent" ,python-clyent)))
644 (native-inputs
645 `(("python-pytz" ,python-pytz)
646 ("python-dateutil" ,python-dateutil)
647 ("python-mock" ,python-mock)
648 ("python-coverage" ,python-coverage)
649 ("python-pillow" ,python-pillow)))
650 (arguments
651 `(#:phases
652 (modify-phases %standard-phases
653 ;; This is needed for some tests.
654 (add-before 'check 'set-up-home
655 (lambda* _ (setenv "HOME" "/tmp") #t))
656 (add-before 'check 'remove-network-tests
657 (lambda* _
658 ;; Remove tests requiring a network connection
659 (let ((network-tests '("tests/test_upload.py"
660 "tests/test_authorizations.py"
661 "tests/test_login.py"
662 "tests/test_whoami.py"
663 "utils/notebook/tests/test_data_uri.py"
664 "utils/notebook/tests/test_base.py"
665 "utils/notebook/tests/test_downloader.py"
666 "inspect_package/tests/test_conda.py")))
667 (with-directory-excursion "binstar_client"
668 (for-each delete-file network-tests)))
669 #t)))))
670 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
671 (synopsis "Anaconda Cloud command line client library")
672 (description
673 "Anaconda Cloud command line client library provides an interface to
674 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
675 environments.")
676 (license license:bsd-3)))
677
678 (define-public python2-anaconda-client
679 (package-with-python2 python-anaconda-client))
680
681 (define-public python-conda
682 (package
683 (name "python-conda")
684 (version "4.3.16")
685 (source
686 (origin
687 (method url-fetch)
688 (uri (string-append "https://github.com/conda/conda/archive/"
689 version ".tar.gz"))
690 (file-name (string-append name "-" version ".tar.gz"))
691 (sha256
692 (base32
693 "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
694 (build-system python-build-system)
695 (arguments
696 `(#:phases
697 (modify-phases %standard-phases
698 (add-before 'build 'create-version-file
699 (lambda _
700 (with-output-to-file "conda/.version"
701 (lambda () (display ,version)))
702 #t))
703 (add-before 'check 'remove-failing-tests
704 (lambda _
705 ;; These tests require internet/network access
706 (let ((network-tests '("test_cli.py"
707 "test_create.py"
708 "test_export.py"
709 "test_fetch.py"
710 "test_history.py"
711 "test_info.py"
712 "test_install.py"
713 "test_priority.py"
714 "conda_env/test_cli.py"
715 "conda_env/test_create.py"
716 "conda_env/specs/test_notebook.py"
717 "conda_env/utils/test_notebooks.py"
718 "core/test_index.py"
719 "core/test_repodata.py")))
720 (with-directory-excursion "tests"
721 (for-each delete-file network-tests)
722
723 ;; FIXME: This test creates a file, then deletes it and tests
724 ;; that the file was deleted. For some reason it fails when
725 ;; building with guix, but does not when you run it in the
726 ;; directory left when you build with the --keep-failed
727 ;; option
728 (delete-file "gateways/disk/test_delete.py")
729 #t))))
730 (replace 'check
731 (lambda _
732 (setenv "HOME" "/tmp")
733 (zero? (system* "py.test")))))))
734 (native-inputs
735 `(("python-ruamel.yaml" ,python-ruamel.yaml)
736 ("python-requests" ,python-requests)
737 ("python-pycosat" ,python-pycosat)
738 ("python-pytest" ,python-pytest)
739 ("python-responses" ,python-responses)
740 ("python-pyyaml" ,python-pyyaml)
741 ("python-anaconda-client" ,python-anaconda-client)))
742 (home-page "https://github.com/conda/conda")
743 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
744 (description
745 "Conda is a cross-platform, Python-agnostic binary package manager. It
746 is the package manager used by Anaconda installations, but it may be used for
747 other systems as well. Conda makes environments first-class citizens, making
748 it easy to create independent environments even for C libraries. Conda is
749 written entirely in Python.
750
751 This package provides Conda as a library.")
752 (license license:bsd-3)))
753
754 (define-public python2-conda
755 (let ((base (package-with-python2
756 (strip-python2-variant python-conda))))
757 (package (inherit base)
758 (native-inputs
759 `(("python2-enum34" ,python2-enum34)
760 ,@(package-native-inputs base))))))
761
762 (define-public conda
763 (package (inherit python-conda)
764 (name "conda")
765 (arguments
766 (substitute-keyword-arguments (package-arguments python-conda)
767 ((#:phases phases)
768 `(modify-phases ,phases
769 (replace 'build
770 (lambda* (#:key outputs #:allow-other-keys)
771 ;; This test fails when run before installation.
772 (delete-file "tests/test_activate.py")
773
774 ;; Fix broken defaults
775 (substitute* "conda/base/context.py"
776 (("return sys.prefix")
777 (string-append "return \"" (assoc-ref outputs "out") "\""))
778 (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
779 (string-append "return False if self.root_prefix == self.conda_prefix else "
780 match)))
781
782 ;; The util/setup-testing.py is used to build conda in
783 ;; application form, rather than the default, library form.
784 ;; With this, we are able to run commands like `conda --help`
785 ;; directly on the command line
786 (zero? (system* "python" "utils/setup-testing.py" "build_py"))))
787 (replace 'install
788 (lambda* (#:key inputs outputs #:allow-other-keys)
789 (let* ((out (assoc-ref outputs "out"))
790 (target (string-append out "/lib/python"
791 ((@@ (guix build python-build-system)
792 get-python-version)
793 (assoc-ref inputs "python"))
794 "/site-packages/")))
795 ;; The installer aborts if the target directory is not on
796 ;; PYTHONPATH.
797 (setenv "PYTHONPATH"
798 (string-append target ":" (getenv "PYTHONPATH")))
799
800 ;; And it aborts if the directory doesn't exist.
801 (mkdir-p target)
802 (zero? (system* "python" "utils/setup-testing.py" "install"
803 (string-append "--prefix=" out))))))
804 ;; The "activate" and "deactivate" scripts don't need wrapping.
805 ;; They also break when they are renamed.
806 (add-after 'wrap 'undo-wrap
807 (lambda* (#:key outputs #:allow-other-keys)
808 (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/")
809 (delete-file "deactivate")
810 (rename-file ".deactivate-real" "deactivate")
811 (delete-file "activate")
812 (rename-file ".activate-real" "activate")
813 #t)))))))
814 (description
815 "Conda is a cross-platform, Python-agnostic binary package manager. It
816 is the package manager used by Anaconda installations, but it may be used for
817 other systems as well. Conda makes environments first-class citizens, making
818 it easy to create independent environments even for C libraries. Conda is
819 written entirely in Python.")))
820
821 (define-public gwl
822 (package
823 (name "gwl")
824 (version "0.1.1")
825 (source (origin
826 (method url-fetch)
827 (uri (string-append "https://www.guixwl.org/releases/gwl-"
828 version ".tar.gz"))
829 (sha256
830 (base32
831 "06pm967mq1wyggx7l0nfapw5s0k5qc5r9lawk2v3db868br779a7"))))
832 (build-system gnu-build-system)
833 (native-inputs
834 `(("autoconf" ,autoconf)
835 ("automake" ,automake)
836 ("pkg-config" ,pkg-config)))
837 (inputs
838 `(("guile" ,guile-2.2)))
839 (propagated-inputs
840 `(("guix" ,guix)
841 ("guile-commonmark" ,guile-commonmark)))
842 (home-page "https://www.guixwl.org")
843 (synopsis "Workflow management extension for GNU Guix")
844 (description "This project provides two subcommands to GNU Guix and
845 introduces two record types that provide a workflow management extension built
846 on top of GNU Guix.")
847 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
848 ;; the web interface modules in gwl/ are licensed AGPL3+,
849 ;; and the fonts included in this package are licensed OFL1.1.
850 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
851
852 (define-public gcab
853 (package
854 (name "gcab")
855 (version "1.1")
856 (source (origin
857 (method url-fetch)
858 (uri (string-append "mirror://gnome/sources/" name "/"
859 version "/" name "-" version ".tar.xz"))
860 (sha256
861 (base32
862 "0l19sr6pg0cfcddmi5n79d08mjjbhn427ip5jlsy9zddq9r24aqr"))
863 ;; gcab 1.1 has a hard dependency on git — even when building
864 ;; from a tarball. Remove it early so ‘guix environment gcab’
865 ;; can actually build what ‘guix build --source gcab’ returns.
866 (modules '((guix build utils)))
867 (snippet
868 '(begin
869 (substitute* "meson.build"
870 (("git_version = .*$") "git_version = []\n"))
871 #t))))
872 (build-system meson-build-system)
873 (native-inputs
874 `(("glib:bin" ,glib "bin") ; for glib-mkenums
875 ("intltool" ,intltool)
876 ("pkg-config" ,pkg-config)
877 ("vala" ,vala)))
878 (inputs
879 `(("glib" ,glib)
880 ("zlib" ,zlib)))
881 (arguments
882 `(#:configure-flags
883 ;; XXX This ‘documentation’ is for developers, and fails informatively:
884 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
885 (list "-Ddocs=false"
886 "-Dintrospection=false")))
887 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
888 (synopsis "Microsoft Cabinet file manipulation library")
889 (description
890 "The libgcab library provides GObject functions to read, write, and modify
891 Microsoft cabinet (.@dfn{CAB}) files.")
892 (license (list license:gpl2+ ; tests/testsuite.at
893 license:lgpl2.1+)))) ; the rest
894
895 (define-public msitools
896 (package
897 (name "msitools")
898 (version "0.98")
899 (source (origin
900 (method url-fetch)
901 (uri (string-append "mirror://gnome/sources/" name "/"
902 version "/" name "-" version ".tar.xz"))
903 (sha256
904 (base32
905 "19wb3n3nwkpc6bjr0q3f1znaxsfaqgjbdxxnbx8ic8bb5b49hwac"))))
906 (build-system gnu-build-system)
907 (native-inputs
908 `(("pkg-config" ,pkg-config)))
909 (inputs
910 `(("gcab" ,gcab)
911 ("glib" ,glib)
912 ("libgsf" ,libgsf)
913 ("libxml2" ,libxml2)
914 ("uuid" ,util-linux)))
915 (home-page "https://wiki.gnome.org/msitools")
916 (synopsis "Windows Installer file manipulation tool")
917 (description
918 "msitools is a collection of command-line tools to inspect, extract, build,
919 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
920 for packaging and deployment of cross-compiled Windows applications.")
921 (license license:lgpl2.1+)))
922
923 (define-public libostree
924 (package
925 (name "libostree")
926 (version "2018.7")
927 (source (origin
928 (method url-fetch)
929 (uri (string-append
930 "https://github.com/ostreedev/ostree/releases/download/v"
931 version "/libostree-" version ".tar.xz"))
932 (sha256
933 (base32
934 "1nc310lv36psxn5yslkxlgi9gjxwqpwqzkg2pldgpwrlv6gkagj8"))))
935 (build-system gnu-build-system)
936 (arguments
937 '(#:phases
938 (modify-phases %standard-phases
939 (add-before 'check 'pre-check
940 (lambda _
941 ;; Don't try to use the non-existing '/var/tmp' as test
942 ;; directory.
943 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
944 #t)))
945 ;; XXX: fails with:
946 ;; tap-driver.sh: internal error getting exit status
947 ;; tap-driver.sh: fatal: I/O or internal error
948 #:tests? #f))
949 (native-inputs
950 `(("attr" ,attr) ; for tests
951 ("bison" ,bison)
952 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
953 ("gobject-introspection" ,gobject-introspection)
954 ("pkg-config" ,pkg-config)
955 ("xsltproc" ,libxslt)))
956 (inputs
957 `(("avahi" ,avahi)
958 ("docbook-xml" ,docbook-xml-4.2)
959 ("docbook-xsl" ,docbook-xsl)
960 ("e2fsprogs" ,e2fsprogs)
961 ("fuse" ,fuse)
962 ("glib" ,glib)
963 ("gpgme" ,gpgme)
964 ("libarchive" ,libarchive)
965 ("libsoup" ,libsoup)
966 ("nettle" ,nettle) ; required by 'libarchive.la'
967 ("util-linux" ,util-linux)))
968 (home-page "https://ostree.readthedocs.io/en/latest/")
969 (synopsis "Operating system and container binary deployment and upgrades")
970 (description
971 "@code{libostree} is both a shared library and suite of command line
972 tools that combines a \"git-like\" model for committing and downloading
973 bootable filesystem trees, along with a layer for deploying them and managing
974 the bootloader configuration.")
975 (license license:lgpl2.0+)))