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