Merge branch 'version-0.15.0'
[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 "4876bc8234095e2af191b0c6470455ce67d9f5f7")
105 (revision 1))
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 "0qw0ffrxzxfk76pp38kx222ndpsv9mbhlmfycagyipgypgjdd9lq"))
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 ("guile" ,guile-2.2)
267
268 ;; Many tests rely on the 'guile-bootstrap' package, which is why we
269 ;; have it here.
270 ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
271 ;; Some of the tests use "unshare" when it is available.
272 ("util-linux" ,util-linux)
273 ,@(if (and (not (%current-target-system))
274 (string=? (%current-system) "x86_64-linux"))
275 `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
276 '())))
277 (propagated-inputs
278 `(("gnutls" ,gnutls)
279 ("guile-json" ,guile-json)
280 ("guile-sqlite3" ,guile-sqlite3)
281 ("guile-ssh" ,guile-ssh)
282 ("guile-git" ,guile-git)))
283
284 (home-page "https://www.gnu.org/software/guix/")
285 (synopsis "Functional package manager for installed software packages and versions")
286 (description
287 "GNU Guix is a functional package manager for the GNU system, and is
288 also a distribution thereof. It includes a virtual machine image. Besides
289 the usual package management features, it also supports transactional
290 upgrades and roll-backs, per-user profiles, and much more. It is based on
291 the Nix package manager.")
292 (license license:gpl3+)
293 (properties '((ftp-server . "alpha.gnu.org"))))))
294
295 ;; Alias for backward compatibility.
296 (define-public guix-devel guix)
297
298 (define-public guix-daemon
299 ;; This package is for internal consumption: it allows us to quickly build
300 ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
301 ;; pull'.
302 (package
303 (inherit guix)
304 (properties `((hidden? . #t)))
305 (name "guix-daemon")
306
307 ;; Use a minimum set of dependencies.
308 (native-inputs
309 (fold alist-delete (package-native-inputs guix)
310 '("po4a" "graphviz" "help2man")))
311 (inputs
312 `(("gnutls" ,gnutls)
313 ("guile-git" ,guile-git)
314 ,@(fold alist-delete (package-inputs guix)
315 '("boot-guile" "boot-guile/i686" "util-linux"))))
316
317 (propagated-inputs '())
318
319 (arguments
320 (substitute-keyword-arguments (package-arguments guix)
321 ((#:configure-flags flags '())
322 ;; Pretend we have those libraries; we don't actually need them.
323 `(append ,flags
324 '("guix_cv_have_recent_guile_sqlite3=yes"
325 "guix_cv_have_recent_guile_ssh=yes")))
326 ((#:tests? #f #f)
327 #f)
328 ((#:phases phases '%standard-phases)
329 `(modify-phases ,phases
330 (replace 'build
331 (lambda _
332 (invoke "make" "nix/libstore/schema.sql.hh")
333 (invoke "make" "-j" (number->string
334 (parallel-job-count))
335 "guix-daemon")))
336 (delete 'copy-bootstrap-guile)
337 (replace 'install
338 (lambda* (#:key outputs #:allow-other-keys)
339 (invoke "make" "install-binPROGRAMS"
340 "install-nodist_pkglibexecSCRIPTS")
341
342 ;; We need to tell 'guix-daemon' which 'guix' command to use.
343 ;; Here we use a questionable hack where we hard-code
344 ;; "~root/.config", which could be wrong (XXX).
345 (let ((out (assoc-ref outputs "out")))
346 (substitute* (find-files (string-append out "/libexec"))
347 (("exec \".*/bin/guix\"")
348 "exec ~root/.config/current/bin/guix"))
349 #t)))
350 (delete 'wrap-program)))))))
351
352 (define-public guile2.0-guix
353 (package
354 (inherit guix)
355 (name "guile2.0-guix")
356 (inputs
357 `(("guile" ,guile-2.0)
358 ,@(alist-delete "guile" (package-inputs guix))))
359 (propagated-inputs
360 `(("gnutls" ,gnutls/guile-2.0)
361 ("guile-json" ,guile2.0-json)
362 ("guile-ssh" ,guile2.0-ssh)
363 ("guile-git" ,guile2.0-git)))))
364
365 (define (source-file? file stat)
366 "Return true if FILE is likely a source file, false if it is a typical
367 generated file."
368 (define (wrong-extension? file)
369 (or (string-suffix? "~" file)
370 (member (file-extension file)
371 '("o" "a" "lo" "so" "go"))))
372
373 (match (basename file)
374 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
375 #f)
376 ((? wrong-extension?)
377 #f)
378 (_
379 #t)))
380
381 (define-public current-guix
382 (let* ((repository-root (canonicalize-path
383 (string-append (current-source-directory)
384 "/../..")))
385 (select? (delay (or (git-predicate repository-root)
386 source-file?))))
387 (lambda ()
388 "Return a package representing Guix built from the current source tree.
389 This works by adding the current source tree to the store (after filtering it
390 out) and returning a package that uses that as its 'source'."
391 (package
392 (inherit guix)
393 (version (string-append (package-version guix) "+"))
394 (source (local-file repository-root "guix-current"
395 #:recursive? #t
396 #:select? (force select?)))))))
397
398 \f
399 ;;;
400 ;;; Other tools.
401 ;;;
402
403 (define-public nix
404 (package
405 (name "nix")
406 (version "2.0.4")
407 (source (origin
408 (method url-fetch)
409 (uri (string-append "http://nixos.org/releases/nix/nix-"
410 version "/nix-" version ".tar.xz"))
411 (sha256
412 (base32
413 "0ss9svxlh1pvrdmnqjvjyqjmbqmrdbyfarvbb14i9d4bggzl0r8n"))))
414 (build-system gnu-build-system)
415 (native-inputs `(("pkg-config" ,pkg-config)))
416 (inputs `(("curl" ,curl)
417 ("bzip2" ,bzip2)
418 ("libgc" ,libgc)
419 ("libseccomp" ,libseccomp)
420 ("libsodium" ,libsodium)
421 ("openssl" ,openssl)
422 ("sqlite" ,sqlite)
423 ("xz" ,xz)))
424 (home-page "https://nixos.org/nix/")
425 (synopsis "The Nix package manager")
426 (description
427 "Nix is a purely functional package manager. This means that it treats
428 packages like values in purely functional programming languages such as
429 Haskell—they are built by functions that don't have side-effects, and they
430 never change after they have been built. Nix stores packages in the Nix
431 store, usually the directory /nix/store, where each package has its own unique
432 sub-directory.")
433 (license license:lgpl2.1+)))
434
435 (define-public emacs-nix-mode
436 (package
437 (name "emacs-nix-mode")
438 (version "1.2.2")
439 (source
440 (origin
441 (method url-fetch)
442 (uri (string-append "https://github.com/NixOS/nix-mode/archive/v"
443 version ".tar.gz"))
444 (file-name (string-append name "-" version ".tar.gz"))
445 (sha256
446 (base32
447 "06aqz0czznsj8835jqnk794sy2p6pa8kxfqwh0nl5d5vxivria6z"))))
448 (build-system emacs-build-system)
449 (inputs
450 `(("emacs-company" ,emacs-company)
451 ("emacs-mmm-mode" ,emacs-mmm-mode)))
452 (home-page "https://github.com/NixOS/nix-mode")
453 (synopsis "Emacs major mode for editing Nix expressions")
454 (description "@code{nixos-mode} provides an Emacs major mode for editing
455 Nix expressions. It supports syntax highlighting, indenting and refilling of
456 comments.")
457 (license license:lgpl2.1+)))
458
459 (define-public stow
460 (package
461 (name "stow")
462 (version "2.2.2")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append "mirror://gnu/stow/stow-"
466 version ".tar.gz"))
467 (sha256
468 (base32
469 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
470 (build-system gnu-build-system)
471 (inputs
472 `(("perl" ,perl)))
473 (native-inputs
474 `(("perl-test-simple" ,perl-test-simple)
475 ("perl-test-output" ,perl-test-output)
476 ("perl-capture-tiny" ,perl-capture-tiny)
477 ("perl-io-stringy" ,perl-io-stringy)))
478 (home-page "https://www.gnu.org/software/stow/")
479 (synopsis "Managing installed software packages")
480 (description
481 "GNU Stow is a symlink manager. It generates symlinks to directories
482 of data and makes them appear to be merged into the same directory. It is
483 typically used for managing software packages installed from source, by
484 letting you install them apart in distinct directories and then create
485 symlinks to the files in a common directory such as /usr/local.")
486 (license license:gpl2+)))
487
488 (define-public rpm
489 (package
490 (name "rpm")
491 (version "4.13.0.2")
492 (source (origin
493 (method url-fetch)
494 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
495 (version-major+minor version) ".x/rpm-"
496 version ".tar.bz2"))
497 (sha256
498 (base32
499 "1521y4ghjns449kzpwkjn9cksh686383xnfx0linzlalqc3jqgig"))))
500 (build-system gnu-build-system)
501 (arguments
502 '(#:configure-flags '("--with-external-db" ;use the system's bdb
503 "--enable-python"
504 "--without-lua")
505 #:phases (modify-phases %standard-phases
506 (add-before 'configure 'set-nspr-search-path
507 (lambda* (#:key inputs #:allow-other-keys)
508 ;; nspr.pc contains the right -I flag pointing to
509 ;; 'include/nspr', but unfortunately 'configure' doesn't
510 ;; use 'pkg-config'. Thus, augment CPATH.
511 ;; Likewise for NSS.
512 (let ((nspr (assoc-ref inputs "nspr"))
513 (nss (assoc-ref inputs "nss")))
514 (setenv "CPATH"
515 (string-append (getenv "C_INCLUDE_PATH") ":"
516 nspr "/include/nspr:"
517 nss "/include/nss"))
518 (setenv "LIBRARY_PATH"
519 (string-append (getenv "LIBRARY_PATH") ":"
520 nss "/lib/nss"))
521 #t)))
522 (add-after 'install 'fix-rpm-symlinks
523 (lambda* (#:key outputs #:allow-other-keys)
524 ;; 'make install' gets these symlinks wrong. Fix them.
525 (let* ((out (assoc-ref outputs "out"))
526 (bin (string-append out "/bin")))
527 (with-directory-excursion bin
528 (for-each (lambda (file)
529 (delete-file file)
530 (symlink "rpm" file))
531 '("rpmquery" "rpmverify"))
532 #t)))))))
533 (native-inputs
534 `(("pkg-config" ,pkg-config)))
535 (inputs
536 `(("python" ,python-2)
537 ("xz" ,xz)
538 ("bdb" ,bdb)
539 ("popt" ,popt)
540 ("nss" ,nss)
541 ("nspr" ,nspr)
542 ("libarchive" ,libarchive)
543 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
544 ("file" ,file)
545 ("bzip2" ,bzip2)
546 ("zlib" ,zlib)
547 ("cpio" ,cpio)))
548 (home-page "http://www.rpm.org/")
549 (synopsis "The RPM Package Manager")
550 (description
551 "The RPM Package Manager (RPM) is a command-line driven package
552 management system capable of installing, uninstalling, verifying, querying,
553 and updating computer software packages. Each software package consists of an
554 archive of files along with information about the package like its version, a
555 description. There is also a library permitting developers to manage such
556 transactions from C or Python.")
557
558 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
559 (license license:gpl2+)))
560
561 (define-public diffoscope
562 (package
563 (name "diffoscope")
564 (version "96")
565 (source (origin
566 (method url-fetch)
567 (uri (pypi-uri name version))
568 (sha256
569 (base32
570 "1x66f2x8miy3giff14higpcs70c0zb5d3gj6yn8ac6p183sngl72"))))
571 (build-system python-build-system)
572 (arguments
573 `(#:phases (modify-phases %standard-phases
574 ;; setup.py mistakenly requires python-magic from PyPi, even
575 ;; though the Python bindings of `file` are sufficient.
576 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
577 (add-after 'unpack 'dependency-on-python-magic
578 (lambda _
579 (substitute* "setup.py"
580 (("'python-magic',") ""))))
581 (add-after 'unpack 'embed-tool-references
582 (lambda* (#:key inputs #:allow-other-keys)
583 (substitute* "diffoscope/comparators/utils/compare.py"
584 (("\\['xxd',")
585 (string-append "['" (which "xxd") "',")))
586 (substitute* "diffoscope/comparators/elf.py"
587 (("@tool_required\\('readelf'\\)") "")
588 (("get_tool_name\\('readelf'\\)")
589 (string-append "'" (which "readelf") "'")))
590 (substitute* "diffoscope/comparators/directory.py"
591 (("@tool_required\\('stat'\\)") "")
592 (("@tool_required\\('getfacl'\\)") "")
593 (("\\['stat',")
594 (string-append "['" (which "stat") "',"))
595 (("\\['getfacl',")
596 (string-append "['" (which "getfacl") "',")))
597 #t))
598 (add-before 'check 'delete-failing-test
599 (lambda _
600 (delete-file "tests/test_tools.py") ;this requires /sbin to be on the path
601 #t)))))
602 (inputs `(("rpm" ,rpm) ;for rpm-python
603 ("python-file" ,python-file)
604 ("python-debian" ,python-debian)
605 ("python-libarchive-c" ,python-libarchive-c)
606 ("python-tlsh" ,python-tlsh)
607 ("acl" ,acl) ;for getfacl
608 ("colordiff" ,colordiff)
609 ("xxd" ,xxd)
610
611 ;; Below are modules used for tests.
612 ("python-pytest" ,python-pytest)
613 ("python-chardet" ,python-chardet)))
614 (home-page "https://diffoscope.org/")
615 (synopsis "Compare files, archives, and directories in depth")
616 (description
617 "Diffoscope tries to get to the bottom of what makes files or directories
618 different. It recursively unpacks archives of many kinds and transforms
619 various binary formats into more human readable forms to compare them. It can
620 compare two tarballs, ISO images, or PDFs just as easily.")
621 (license license:gpl3+)))
622
623 (define-public python-anaconda-client
624 (package
625 (name "python-anaconda-client")
626 (version "1.6.3")
627 (source
628 (origin
629 (method url-fetch)
630 (uri (string-append "https://github.com/Anaconda-Platform/"
631 "anaconda-client/archive/" version ".tar.gz"))
632 (file-name (string-append name "-" version ".tar.gz"))
633 (sha256
634 (base32
635 "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
636 (build-system python-build-system)
637 (propagated-inputs
638 `(("python-pyyaml" ,python-pyyaml)
639 ("python-requests" ,python-requests)
640 ("python-clyent" ,python-clyent)))
641 (native-inputs
642 `(("python-pytz" ,python-pytz)
643 ("python-dateutil" ,python-dateutil)
644 ("python-mock" ,python-mock)
645 ("python-coverage" ,python-coverage)
646 ("python-pillow" ,python-pillow)))
647 (arguments
648 `(#:phases
649 (modify-phases %standard-phases
650 ;; This is needed for some tests.
651 (add-before 'check 'set-up-home
652 (lambda* _ (setenv "HOME" "/tmp") #t))
653 (add-before 'check 'remove-network-tests
654 (lambda* _
655 ;; Remove tests requiring a network connection
656 (let ((network-tests '("tests/test_upload.py"
657 "tests/test_authorizations.py"
658 "tests/test_login.py"
659 "tests/test_whoami.py"
660 "utils/notebook/tests/test_data_uri.py"
661 "utils/notebook/tests/test_base.py"
662 "utils/notebook/tests/test_downloader.py"
663 "inspect_package/tests/test_conda.py")))
664 (with-directory-excursion "binstar_client"
665 (for-each delete-file network-tests)))
666 #t)))))
667 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
668 (synopsis "Anaconda Cloud command line client library")
669 (description
670 "Anaconda Cloud command line client library provides an interface to
671 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
672 environments.")
673 (license license:bsd-3)))
674
675 (define-public python2-anaconda-client
676 (package-with-python2 python-anaconda-client))
677
678 (define-public python-conda
679 (package
680 (name "python-conda")
681 (version "4.3.16")
682 (source
683 (origin
684 (method url-fetch)
685 (uri (string-append "https://github.com/conda/conda/archive/"
686 version ".tar.gz"))
687 (file-name (string-append name "-" version ".tar.gz"))
688 (sha256
689 (base32
690 "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
691 (build-system python-build-system)
692 (arguments
693 `(#:phases
694 (modify-phases %standard-phases
695 (add-before 'build 'create-version-file
696 (lambda _
697 (with-output-to-file "conda/.version"
698 (lambda () (display ,version)))
699 #t))
700 (add-before 'check 'remove-failing-tests
701 (lambda _
702 ;; These tests require internet/network access
703 (let ((network-tests '("test_cli.py"
704 "test_create.py"
705 "test_export.py"
706 "test_fetch.py"
707 "test_history.py"
708 "test_info.py"
709 "test_install.py"
710 "test_priority.py"
711 "conda_env/test_cli.py"
712 "conda_env/test_create.py"
713 "conda_env/specs/test_notebook.py"
714 "conda_env/utils/test_notebooks.py"
715 "core/test_index.py"
716 "core/test_repodata.py")))
717 (with-directory-excursion "tests"
718 (for-each delete-file network-tests)
719
720 ;; FIXME: This test creates a file, then deletes it and tests
721 ;; that the file was deleted. For some reason it fails when
722 ;; building with guix, but does not when you run it in the
723 ;; directory left when you build with the --keep-failed
724 ;; option
725 (delete-file "gateways/disk/test_delete.py")
726 #t))))
727 (replace 'check
728 (lambda _
729 (setenv "HOME" "/tmp")
730 (zero? (system* "py.test")))))))
731 (native-inputs
732 `(("python-ruamel.yaml" ,python-ruamel.yaml)
733 ("python-requests" ,python-requests)
734 ("python-pycosat" ,python-pycosat)
735 ("python-pytest" ,python-pytest)
736 ("python-responses" ,python-responses)
737 ("python-pyyaml" ,python-pyyaml)
738 ("python-anaconda-client" ,python-anaconda-client)))
739 (home-page "https://github.com/conda/conda")
740 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
741 (description
742 "Conda is a cross-platform, Python-agnostic binary package manager. It
743 is the package manager used by Anaconda installations, but it may be used for
744 other systems as well. Conda makes environments first-class citizens, making
745 it easy to create independent environments even for C libraries. Conda is
746 written entirely in Python.
747
748 This package provides Conda as a library.")
749 (license license:bsd-3)))
750
751 (define-public python2-conda
752 (let ((base (package-with-python2
753 (strip-python2-variant python-conda))))
754 (package (inherit base)
755 (native-inputs
756 `(("python2-enum34" ,python2-enum34)
757 ,@(package-native-inputs base))))))
758
759 (define-public conda
760 (package (inherit python-conda)
761 (name "conda")
762 (arguments
763 (substitute-keyword-arguments (package-arguments python-conda)
764 ((#:phases phases)
765 `(modify-phases ,phases
766 (replace 'build
767 (lambda* (#:key outputs #:allow-other-keys)
768 ;; This test fails when run before installation.
769 (delete-file "tests/test_activate.py")
770
771 ;; Fix broken defaults
772 (substitute* "conda/base/context.py"
773 (("return sys.prefix")
774 (string-append "return \"" (assoc-ref outputs "out") "\""))
775 (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
776 (string-append "return False if self.root_prefix == self.conda_prefix else "
777 match)))
778
779 ;; The util/setup-testing.py is used to build conda in
780 ;; application form, rather than the default, library form.
781 ;; With this, we are able to run commands like `conda --help`
782 ;; directly on the command line
783 (zero? (system* "python" "utils/setup-testing.py" "build_py"))))
784 (replace 'install
785 (lambda* (#:key inputs outputs #:allow-other-keys)
786 (let* ((out (assoc-ref outputs "out"))
787 (target (string-append out "/lib/python"
788 ((@@ (guix build python-build-system)
789 get-python-version)
790 (assoc-ref inputs "python"))
791 "/site-packages/")))
792 ;; The installer aborts if the target directory is not on
793 ;; PYTHONPATH.
794 (setenv "PYTHONPATH"
795 (string-append target ":" (getenv "PYTHONPATH")))
796
797 ;; And it aborts if the directory doesn't exist.
798 (mkdir-p target)
799 (zero? (system* "python" "utils/setup-testing.py" "install"
800 (string-append "--prefix=" out))))))
801 ;; The "activate" and "deactivate" scripts don't need wrapping.
802 ;; They also break when they are renamed.
803 (add-after 'wrap 'undo-wrap
804 (lambda* (#:key outputs #:allow-other-keys)
805 (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/")
806 (delete-file "deactivate")
807 (rename-file ".deactivate-real" "deactivate")
808 (delete-file "activate")
809 (rename-file ".activate-real" "activate")
810 #t)))))))
811 (description
812 "Conda is a cross-platform, Python-agnostic binary package manager. It
813 is the package manager used by Anaconda installations, but it may be used for
814 other systems as well. Conda makes environments first-class citizens, making
815 it easy to create independent environments even for C libraries. Conda is
816 written entirely in Python.")))
817
818 (define-public gwl
819 (package
820 (name "gwl")
821 (version "0.1.1")
822 (source (origin
823 (method url-fetch)
824 (uri (string-append "https://www.guixwl.org/releases/gwl-"
825 version ".tar.gz"))
826 (sha256
827 (base32
828 "06pm967mq1wyggx7l0nfapw5s0k5qc5r9lawk2v3db868br779a7"))))
829 (build-system gnu-build-system)
830 (native-inputs
831 `(("autoconf" ,autoconf)
832 ("automake" ,automake)
833 ("pkg-config" ,pkg-config)))
834 (inputs
835 `(("guile" ,guile-2.2)))
836 (propagated-inputs
837 `(("guix" ,guix)
838 ("guile-commonmark" ,guile-commonmark)))
839 (home-page "https://www.guixwl.org")
840 (synopsis "Workflow management extension for GNU Guix")
841 (description "This project provides two subcommands to GNU Guix and
842 introduces two record types that provide a workflow management extension built
843 on top of GNU Guix.")
844 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
845 ;; the web interface modules in gwl/ are licensed AGPL3+,
846 ;; and the fonts included in this package are licensed OFL1.1.
847 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
848
849 (define-public gcab
850 (package
851 (name "gcab")
852 (version "1.1")
853 (source (origin
854 (method url-fetch)
855 (uri (string-append "mirror://gnome/sources/" name "/"
856 version "/" name "-" version ".tar.xz"))
857 (sha256
858 (base32
859 "0l19sr6pg0cfcddmi5n79d08mjjbhn427ip5jlsy9zddq9r24aqr"))
860 ;; gcab 1.1 has a hard dependency on git — even when building
861 ;; from a tarball. Remove it early so ‘guix environment gcab’
862 ;; can actually build what ‘guix build --source gcab’ returns.
863 (modules '((guix build utils)))
864 (snippet
865 '(begin
866 (substitute* "meson.build"
867 (("git_version = .*$") "git_version = []\n"))
868 #t))))
869 (build-system meson-build-system)
870 (native-inputs
871 `(("glib:bin" ,glib "bin") ; for glib-mkenums
872 ("intltool" ,intltool)
873 ("pkg-config" ,pkg-config)
874 ("vala" ,vala)))
875 (inputs
876 `(("glib" ,glib)
877 ("zlib" ,zlib)))
878 (arguments
879 `(#:configure-flags
880 ;; XXX This ‘documentation’ is for developers, and fails informatively:
881 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
882 (list "-Ddocs=false"
883 "-Dintrospection=false")))
884 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
885 (synopsis "Microsoft Cabinet file manipulation library")
886 (description
887 "The libgcab library provides GObject functions to read, write, and modify
888 Microsoft cabinet (.@dfn{CAB}) files.")
889 (license (list license:gpl2+ ; tests/testsuite.at
890 license:lgpl2.1+)))) ; the rest
891
892 (define-public msitools
893 (package
894 (name "msitools")
895 (version "0.97")
896 (source (origin
897 (method url-fetch)
898 (uri (string-append "mirror://gnome/sources/" name "/"
899 version "/" name "-" version ".tar.xz"))
900 (sha256
901 (base32
902 "0pn6izlgwi4ngpk9jk2n38gcjjpk29nm15aad89bg9z3k9n2hnrs"))))
903 (build-system gnu-build-system)
904 (native-inputs
905 `(("pkg-config" ,pkg-config)))
906 (inputs
907 `(("gcab" ,gcab)
908 ("glib" ,glib)
909 ("libgsf" ,libgsf)
910 ("libxml2" ,libxml2)
911 ("uuid" ,util-linux)))
912 (home-page "https://wiki.gnome.org/msitools")
913 (synopsis "Windows Installer file manipulation tool")
914 (description
915 "msitools is a collection of command-line tools to inspect, extract, build,
916 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
917 for packaging and deployment of cross-compiled Windows applications.")
918 (license license:lgpl2.1+)))
919
920 (define-public libostree
921 (package
922 (name "libostree")
923 (version "2018.5")
924 (source (origin
925 (method url-fetch)
926 (uri (string-append
927 "https://github.com/ostreedev/ostree/releases/download/v"
928 version "/libostree-" version ".tar.xz"))
929 (sha256
930 (base32
931 "0q82d6rvp119nx7ck7j63a591kz8vg7v465kf9ygh8kzg875l3xd"))))
932 (build-system gnu-build-system)
933 (arguments
934 '(#:phases
935 (modify-phases %standard-phases
936 (add-before 'check 'pre-check
937 (lambda _
938 ;; Don't try to use the non-existing '/var/tmp' as test
939 ;; directory.
940 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
941 #t)))
942 ;; XXX: fails with:
943 ;; tap-driver.sh: internal error getting exit status
944 ;; tap-driver.sh: fatal: I/O or internal error
945 #:tests? #f))
946 (native-inputs
947 `(("attr" ,attr) ; for tests
948 ("bison" ,bison)
949 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
950 ("gobject-introspection" ,gobject-introspection)
951 ("pkg-config" ,pkg-config)
952 ("xsltproc" ,libxslt)))
953 (inputs
954 `(("avahi" ,avahi)
955 ("docbook-xml" ,docbook-xml-4.2)
956 ("docbook-xsl" ,docbook-xsl)
957 ("e2fsprogs" ,e2fsprogs)
958 ("fuse" ,fuse)
959 ("glib" ,glib)
960 ("gpgme" ,gpgme)
961 ("libarchive" ,libarchive)
962 ("libsoup" ,libsoup)
963 ("nettle" ,nettle) ; required by 'libarchive.la'
964 ("util-linux" ,util-linux)))
965 (home-page "https://ostree.readthedocs.io/en/latest/")
966 (synopsis "Operating system and container binary deployment and upgrades")
967 (description
968 "@code{libostree} is both a shared library and suite of command line
969 tools that combines a \"git-like\" model for committing and downloading
970 bootable filesystem trees, along with a layer for deploying them and managing
971 the bootloader configuration.")
972 (license license:lgpl2.0+)))