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