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