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