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