Merge remote-tracking branch 'origin/staging-next' into staging
[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 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
17 ;;; Copyright © 2020 Jesse Gibbons <jgibbons2357+guix@gmail.com>
18 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
19 ;;;
20 ;;; This file is part of GNU Guix.
21 ;;;
22 ;;; GNU Guix is free software; you can redistribute it and/or modify it
23 ;;; under the terms of the GNU General Public License as published by
24 ;;; the Free Software Foundation; either version 3 of the License, or (at
25 ;;; your option) any later version.
26 ;;;
27 ;;; GNU Guix is distributed in the hope that it will be useful, but
28 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 ;;; GNU General Public License for more details.
31 ;;;
32 ;;; You should have received a copy of the GNU General Public License
33 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
35 (define-module (gnu packages package-management)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages acl)
38 #:use-module (gnu packages attr)
39 #:use-module (gnu packages avahi)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages backup)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bash)
44 #:use-module (gnu packages bdw-gc)
45 #:use-module (gnu packages bison)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages cpio)
51 #:use-module (gnu packages crypto)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages dbm)
55 #:use-module (gnu packages docbook)
56 #:use-module (gnu packages file)
57 #:use-module (gnu packages gettext)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages gnupg)
61 #:use-module (gnu packages graphviz)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages guile)
64 #:use-module (gnu packages guile-xyz)
65 #:use-module (gnu packages hurd)
66 #:use-module (gnu packages libedit)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages lisp)
69 #:use-module (gnu packages man)
70 #:use-module (gnu packages nettle)
71 #:use-module (gnu packages networking)
72 #:use-module (gnu packages nss)
73 #:use-module (gnu packages patchutils)
74 #:use-module (gnu packages perl)
75 #:use-module (gnu packages perl-check)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages popt)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages python-web)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages serialization)
82 #:use-module (gnu packages sqlite)
83 #:use-module (gnu packages ssh)
84 #:use-module (gnu packages texinfo)
85 #:use-module (gnu packages time)
86 #:use-module (gnu packages tls)
87 #:use-module (gnu packages vim)
88 #:use-module (gnu packages virtualization)
89 #:use-module (gnu packages web)
90 #:use-module (gnu packages xml)
91 #:use-module (gnu packages xorg)
92 #:use-module (guix build-system glib-or-gtk)
93 #:use-module (guix build-system gnu)
94 #:use-module (guix build-system meson)
95 #:use-module (guix build-system python)
96 #:use-module (guix download)
97 #:use-module (guix gexp)
98 #:use-module (guix git-download)
99 #:use-module ((guix licenses) #:prefix license:)
100 #:use-module (guix packages)
101 #:use-module (guix utils)
102 #:use-module (ice-9 match)
103 #:use-module (srfi srfi-1))
104
105 (define (boot-guile-uri arch)
106 "Return the URI for the bootstrap Guile tarball for ARCH."
107 (cond ((string=? "armhf" arch)
108 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
109 arch "-linux"
110 "/20150101/guile-2.0.11.tar.xz"))
111 ((string=? "aarch64" arch)
112 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
113 arch "-linux/20170217/guile-2.0.14.tar.xz"))
114 (else
115 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
116 arch "-linux"
117 "/20131110/guile-2.0.9.tar.xz"))))
118
119 ;; NOTE: The commit IDs used here form a linked list threaded through the git
120 ;; history. In a phenomenon known as boot-stripping, not only the head of this
121 ;; list is used, but also a few older versions, when a guix from this package is
122 ;; used to build something also depending on guix.
123 ;;
124 ;; Therefore, if, by accident, you set this package to a non-existent commit ID,
125 ;; it is insufficient to simply correct it with the latest commit.
126 ;; Instead, please push one commit that rolls back Guix to before the mistake,
127 ;; and then another that points to the first one. That way, the faulty commit
128 ;; won't appear on the linked list.
129 (define-public guix
130 ;; Latest version of Guix, which may or may not correspond to a release.
131 ;; Note: the 'update-guix-package.scm' script expects this definition to
132 ;; start precisely like this.
133 (let ((version "1.1.0")
134 (commit "5e7cf66fb35780f930ad0bc5fe21ac330df4411d")
135 (revision 32))
136 (package
137 (name "guix")
138
139 (version (if (zero? revision)
140 version
141 (string-append version "-"
142 (number->string revision)
143 "." (string-take commit 7))))
144 (source (origin
145 (method git-fetch)
146 (uri (git-reference
147 (url "https://git.savannah.gnu.org/git/guix.git")
148 (commit commit)))
149 (sha256
150 (base32
151 "15clfjp845gvl0p6qw0b1gdibqfq20zwzr6dbxvq8l9fgzj1kb6b"))
152 (file-name (string-append "guix-" version "-checkout"))))
153 (build-system gnu-build-system)
154 (arguments
155 `(#:configure-flags (list
156 "--localstatedir=/var"
157 "--sysconfdir=/etc"
158 (string-append "--with-bash-completion-dir="
159 (assoc-ref %outputs "out")
160 "/etc/bash_completion.d")
161
162 ;; Set 'DOT_USER_PROGRAM' to the empty string so
163 ;; we don't keep a reference to Graphviz, whose
164 ;; closure is pretty big (too big for the Guix
165 ;; system installation image.)
166 "ac_cv_path_DOT_USER_PROGRAM=dot"
167
168 ;; To avoid problems with the length of shebangs,
169 ;; choose a fixed-width and short directory name
170 ;; for tests.
171 "ac_cv_guix_test_root=/tmp/guix-tests"
172 ,@(if (hurd-target?) '("--with-courage") '()))
173 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
174
175 #:modules ((guix build gnu-build-system)
176 (guix build utils)
177 (srfi srfi-26)
178 (ice-9 popen)
179 (ice-9 rdelim))
180
181 #:phases (modify-phases %standard-phases
182 (replace 'bootstrap
183 (lambda _
184 ;; Make sure 'msgmerge' can modify the PO files.
185 (for-each (lambda (po)
186 (chmod po #o666))
187 (find-files "." "\\.po$"))
188
189 (patch-shebang "build-aux/git-version-gen")
190
191 (call-with-output-file ".tarball-version"
192 (lambda (port)
193 (display ,version port)))
194
195 ;; Install SysV init files to $(prefix)/etc rather
196 ;; than to /etc.
197 (substitute* "nix/local.mk"
198 (("^sysvinitservicedir = .*$")
199 (string-append "sysvinitservicedir = \
200 $(prefix)/etc/init.d\n")))
201
202 ;; Install OpenRC init files to $(prefix)/etc rather
203 ;; than to /etc.
204 (substitute* "nix/local.mk"
205 (("^openrcservicedir = .*$")
206 (string-append "openrcservicedir = \
207 $(prefix)/etc/init.d\n")))
208
209 (invoke "sh" "bootstrap")))
210 (add-before 'build 'use-host-compressors
211 (lambda* (#:key inputs target #:allow-other-keys)
212 (when target
213 ;; Use host compressors.
214 (let ((bzip2 (assoc-ref inputs "bzip2"))
215 (gzip (assoc-ref inputs "gzip"))
216 (xz (assoc-ref inputs "xz")))
217 (substitute* "guix/config.scm"
218 (("\"[^\"]*/bin/bzip2")
219 (string-append "\"" bzip2 "/bin/bzip2"))
220 (("\"[^\"]*/bin/gzip") gzip
221 (string-append "\"" gzip "/bin/gzip"))
222 (("\"[^\"]*/bin//xz")
223 (string-append "\"" xz "/bin/xz")))))
224 #t))
225 (add-before 'check 'copy-bootstrap-guile
226 (lambda* (#:key system target inputs #:allow-other-keys)
227 ;; Copy the bootstrap guile tarball in the store
228 ;; used by the test suite.
229 (define (intern file recursive?)
230 ;; Note: don't use 'guix download' here because we
231 ;; need to set the 'recursive?' argument.
232 (define base
233 (strip-store-file-name file))
234
235 (define code
236 `(begin
237 (use-modules (guix))
238 (with-store store
239 (let* ((item (add-to-store store ,base
240 ,recursive?
241 "sha256" ,file))
242 (root (string-append "/tmp/gc-root-"
243 (basename item))))
244 ;; Register a root so that the GC tests
245 ;; don't delete those.
246 (symlink item root)
247 (add-indirect-root store root)))))
248
249 (invoke "./test-env" "guile" "-c"
250 (object->string code)))
251
252 (unless target
253 (intern (assoc-ref inputs "boot-guile") #f)
254
255 ;; On x86_64 some tests need the i686 Guile.
256 ,@(if (and (not (%current-target-system))
257 (string=? (%current-system)
258 "x86_64-linux"))
259 '((intern (assoc-ref inputs "boot-guile/i686") #f))
260 '())
261
262 ;; Copy the bootstrap executables.
263 (for-each (lambda (input)
264 (intern (assoc-ref inputs input) #t))
265 '("bootstrap/bash" "bootstrap/mkdir"
266 "bootstrap/tar" "bootstrap/xz")))
267 #t))
268 (add-after 'unpack 'disable-failing-tests
269 ;; XXX FIXME: These tests fail within the build container.
270 (lambda _
271 (substitute* "tests/syscalls.scm"
272 (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
273 (string-append "(test-skip 1)\n" all)))
274 (substitute* "tests/containers.scm"
275 (("^\\(test-(assert|equal)" all)
276 (string-append "(test-skip 1)\n" all)))
277 (when (file-exists? "tests/guix-environment-container.sh")
278 (substitute* "tests/guix-environment-container.sh"
279 (("guix environment --version")
280 "exit 77\n")))
281 #t))
282 (add-before 'check 'set-SHELL
283 (lambda _
284 ;; 'guix environment' tests rely on 'SHELL' having a
285 ;; correct value, so set it.
286 (setenv "SHELL" (which "sh"))
287 #t))
288 (add-after 'install 'wrap-program
289 (lambda* (#:key inputs native-inputs outputs target
290 #:allow-other-keys)
291 ;; Make sure the 'guix' command finds GnuTLS,
292 ;; Guile-JSON, and Guile-Git automatically.
293 (let* ((out (assoc-ref outputs "out"))
294 (guile ,@(if (%current-target-system)
295 '((assoc-ref native-inputs "guile"))
296 '((assoc-ref inputs "guile"))))
297 (gcrypt (assoc-ref inputs "guile-gcrypt"))
298 (json (assoc-ref inputs "guile-json"))
299 (sqlite (assoc-ref inputs "guile-sqlite3"))
300 (zlib (assoc-ref inputs "guile-zlib"))
301 (lzlib (assoc-ref inputs "guile-lzlib"))
302 (git (assoc-ref inputs "guile-git"))
303 (bs (assoc-ref inputs
304 "guile-bytestructures"))
305 (ssh (assoc-ref inputs "guile-ssh"))
306 (gnutls (assoc-ref inputs "gnutls"))
307 (locales (assoc-ref inputs "glibc-utf8-locales"))
308 (deps (list gcrypt json sqlite gnutls
309 git bs ssh zlib lzlib))
310 (effective
311 (read-line
312 (open-pipe* OPEN_READ
313 (string-append guile "/bin/guile")
314 "-c" "(display (effective-version))")))
315 (path (string-join
316 (map (cut string-append <>
317 "/share/guile/site/"
318 effective)
319 (delete #f deps))
320 ":"))
321 (gopath (string-join
322 (map (cut string-append <>
323 "/lib/guile/" effective
324 "/site-ccache")
325 (delete #f deps))
326 ":"))
327 (locpath (string-append locales "/lib/locale")))
328
329 (wrap-program (string-append out "/bin/guix")
330 `("GUILE_LOAD_PATH" ":" prefix (,path))
331 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))
332 `("GUIX_LOCPATH" ":" suffix (,locpath)))
333
334 (when target
335 ;; XXX Touching wrap-program rebuilds world
336 (let ((bash (assoc-ref inputs "bash")))
337 (substitute* (string-append out "/bin/guix")
338 (("^#!.*/bash") (string-append "#! " bash "/bin/bash")))))
339 #t))))))
340 (native-inputs `(("pkg-config" ,pkg-config)
341
342 ;; Guile libraries are needed here for
343 ;; cross-compilation.
344 ("guile" ,guile-3.0-latest) ;for faster builds
345 ("gnutls" ,gnutls)
346 ("guile-gcrypt" ,guile-gcrypt)
347 ("guile-json" ,guile-json-4)
348 ("guile-sqlite3" ,guile-sqlite3)
349 ("guile-zlib" ,guile-zlib)
350 ("guile-lzlib" ,guile-lzlib)
351 ("guile-ssh" ,guile-ssh)
352 ("guile-git" ,guile-git)
353
354 ;; XXX: Keep the development inputs here even though
355 ;; they're unnecessary, just so that 'guix environment
356 ;; guix' always contains them.
357 ("autoconf" ,autoconf-wrapper)
358 ("automake" ,automake)
359 ("gettext" ,gettext-minimal)
360 ("texinfo" ,texinfo)
361 ("graphviz" ,graphviz)
362 ("help2man" ,help2man)
363 ("po4a" ,po4a)))
364 (inputs
365 `(("bzip2" ,bzip2)
366 ("gzip" ,gzip)
367 ("sqlite" ,sqlite)
368 ("libgcrypt" ,libgcrypt)
369
370 ("guile" ,guile-3.0-latest)
371
372 ;; Some of the tests use "unshare" when it is available.
373 ("util-linux" ,util-linux)
374
375 ;; Many tests rely on the 'guile-bootstrap' package, which is why we
376 ;; have it here.
377 ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
378 ,@(if (and (not (%current-target-system))
379 (string=? (%current-system) "x86_64-linux"))
380 `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
381 '())
382 ,@(if (%current-target-system)
383 `(("bash" ,bash-minimal)
384 ("xz" ,xz))
385 '())
386
387 ;; Tests also rely on these bootstrap executables.
388 ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))
389 ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system)))
390 ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system)))
391 ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system)))
392
393 ("glibc-utf8-locales" ,glibc-utf8-locales)))
394 (propagated-inputs
395 `(("gnutls" ,(if (%current-target-system) gnutls-3.6.14 gnutls))
396 ("guile-gcrypt" ,guile-gcrypt)
397 ("guile-json" ,guile-json-4)
398 ("guile-sqlite3" ,guile-sqlite3)
399 ("guile-ssh" ,guile-ssh)
400 ("guile-git" ,guile-git)
401 ("guile-zlib" ,guile-zlib)
402 ("guile-lzlib" ,guile-lzlib)))
403
404 (home-page "https://www.gnu.org/software/guix/")
405 (synopsis "Functional package manager for installed software packages and versions")
406 (description
407 "GNU Guix is a functional package manager for the GNU system, and is
408 also a distribution thereof. It includes a virtual machine image. Besides
409 the usual package management features, it also supports transactional
410 upgrades and roll-backs, per-user profiles, and much more. It is based on
411 the Nix package manager.")
412 (license license:gpl3+)
413 (properties '((ftp-server . "alpha.gnu.org"))))))
414
415 (define-public guix-daemon
416 ;; This package is for internal consumption: it allows us to quickly build
417 ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
418 ;; pull'.
419 (package
420 (inherit guix)
421 (properties `((hidden? . #t)))
422 (name "guix-daemon")
423
424 ;; Use a minimum set of dependencies.
425 (native-inputs
426 (fold alist-delete (package-native-inputs guix)
427 '("po4a" "graphviz" "help2man")))
428 (inputs
429 `(("gnutls" ,gnutls)
430 ("guile-git" ,guile-git)
431 ("guile-json" ,guile-json-3)
432 ("guile-gcrypt" ,guile-gcrypt)
433 ,@(fold alist-delete (package-inputs guix)
434 '("boot-guile" "boot-guile/i686" "util-linux"))))
435
436 (propagated-inputs '())
437
438 (arguments
439 (substitute-keyword-arguments (package-arguments guix)
440 ((#:configure-flags flags '())
441 ;; Pretend we have those libraries; we don't actually need them.
442 `(append ,flags
443 '("guix_cv_have_recent_guile_sqlite3=yes"
444 "guix_cv_have_recent_guile_ssh=yes")))
445 ((#:tests? #f #f)
446 #f)
447 ((#:phases phases '%standard-phases)
448 `(modify-phases ,phases
449 (add-after 'unpack 'change-default-guix
450 (lambda _
451 ;; We need to tell 'guix-daemon' which 'guix' command to use.
452 ;; Here we use a questionable hack where we hard-code root's
453 ;; current guix, which could be wrong (XXX). Note that scripts
454 ;; like 'guix perform-download' do not run as root so we assume
455 ;; that they have access to /var/guix/profiles/per-user/root.
456 (substitute* "nix/libstore/globals.cc"
457 (("guixProgram = (.*)nixBinDir + \"/guix\"" _ before)
458 (string-append "guixProgram = " before
459 "/var/guix/profiles/per-user/root\
460 /current-guix/bin/guix")))
461 #t))
462 (replace 'build
463 (lambda _
464 (invoke "make" "nix/libstore/schema.sql.hh")
465 (invoke "make" "-j" (number->string
466 (parallel-job-count))
467 "guix-daemon")))
468 (delete 'copy-bootstrap-guile)
469 (replace 'install
470 (lambda* (#:key outputs #:allow-other-keys)
471 (invoke "make" "install-binPROGRAMS")))
472 (delete 'wrap-program)))))))
473
474
475 (define-public guile2.2-guix
476 (package
477 (inherit guix)
478 (name "guile2.2-guix")
479 (native-inputs
480 `(("guile" ,guile-2.2)
481 ("gnutls" ,guile2.2-gnutls)
482 ("guile-gcrypt" ,guile2.2-gcrypt)
483 ("guile-json" ,guile2.2-json)
484 ("guile-sqlite3" ,guile2.2-sqlite3)
485 ("guile-ssh" ,guile2.2-ssh)
486 ("guile-git" ,guile2.2-git)
487 ,@(fold alist-delete (package-native-inputs guix)
488 '("guile" "gnutls" "guile-gcrypt" "guile-json"
489 "guile-sqlite3" "guile-ssh" "guile-git"))))
490 (inputs
491 `(("guile" ,guile-2.2)
492 ,@(alist-delete "guile" (package-inputs guix))))
493 (propagated-inputs
494 `(("gnutls" ,gnutls)
495 ("guile-gcrypt" ,guile2.2-gcrypt)
496 ("guile-json" ,guile2.2-json)
497 ("guile-sqlite3" ,guile2.2-sqlite3)
498 ("guile-ssh" ,guile2.2-ssh)
499 ("guile-git" ,guile2.2-git)))))
500
501 (define-public guile3.0-guix
502 (deprecated-package "guile3.0-guix" guix))
503
504 (define-public guix-minimal
505 ;; A version of Guix which is built with the minimal set of dependencies, as
506 ;; outlined in the README "Requirements" section. Intended as a CI job, so
507 ;; marked as hidden.
508 (hidden-package
509 (package
510 (inherit guix)
511 (name "guix-minimal")
512 (native-inputs
513 (fold alist-delete
514 (package-native-inputs guix)
515 '("guile-ssh")))
516 (propagated-inputs
517 (fold alist-delete
518 (package-propagated-inputs guix)
519 '("guile-ssh"))))))
520
521 (define (source-file? file stat)
522 "Return true if FILE is likely a source file, false if it is a typical
523 generated file."
524 (define (wrong-extension? file)
525 (or (string-suffix? "~" file)
526 (member (file-extension file)
527 '("o" "a" "lo" "so" "go"))))
528
529 (match (basename file)
530 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
531 #f)
532 ((? wrong-extension?)
533 #f)
534 (_
535 #t)))
536
537 (define-public current-guix-package
538 ;; This parameter allows callers to override the package that 'current-guix'
539 ;; returns. This is useful when 'current-guix' cannot compute it by itself,
540 ;; for instance because it's not running from a source code checkout.
541 (make-parameter #f))
542
543 (define-public current-guix
544 (let* ((repository-root (delay (canonicalize-path
545 (string-append (current-source-directory)
546 "/../.."))))
547 (select? (delay (or (git-predicate (force repository-root))
548 source-file?))))
549 (lambda ()
550 "Return a package representing Guix built from the current source tree.
551 This works by adding the current source tree to the store (after filtering it
552 out) and returning a package that uses that as its 'source'."
553 (or (current-guix-package)
554 (package
555 (inherit guix)
556 (version (string-append (package-version guix) "+"))
557 (source (local-file (force repository-root) "guix-current"
558 #:recursive? #t
559 #:select? (force select?))))))))
560
561 \f
562 ;;;
563 ;;; Other tools.
564 ;;;
565
566 (define-public nix
567 (package
568 (name "nix")
569 (version "2.3.8")
570 (source (origin
571 (method url-fetch)
572 (uri (string-append "https://nixos.org/releases/nix/nix-"
573 version "/nix-" version ".tar.xz"))
574 (sha256
575 (base32
576 "0amd5nnqslvkfpz042l4ydihw2qsy68nmjbwaagcrggaq4irh4f7"))))
577 (build-system gnu-build-system)
578 (arguments
579 `(#:configure-flags '("--sysconfdir=/etc" "--enable-gc")
580 #:phases
581 (modify-phases %standard-phases
582 (replace 'install
583 ;; Don't try & fail to create subdirectories in /etc, but keep them
584 ;; in the output as examples.
585 (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
586 (let* ((out (assoc-ref outputs "out"))
587 (etc (string-append out "/etc")))
588 (apply invoke "make" "install"
589 (string-append "sysconfdir=" etc)
590 (string-append "profiledir=" etc "/profile.d")
591 make-flags)))))))
592 (native-inputs `(("pkg-config" ,pkg-config)))
593 (inputs `(("boost" ,boost)
594 ("brotli" ,brotli)
595 ("bzip2" ,bzip2)
596 ("curl" ,curl)
597 ("editline" ,editline)
598 ("libgc" ,libgc)
599 ("libseccomp" ,libseccomp)
600 ("libsodium" ,libsodium)
601 ("openssl" ,openssl)
602 ("sqlite" ,sqlite)
603 ("xz" ,xz)))
604 (home-page "https://nixos.org/nix/")
605 (synopsis "The Nix package manager")
606 (description
607 "Nix is a purely functional package manager. This means that it treats
608 packages like values in purely functional programming languages such as
609 Haskell—they are built by functions that don't have side-effects, and they
610 never change after they have been built. Nix stores packages in the Nix
611 store, usually the directory /nix/store, where each package has its own unique
612 sub-directory.")
613 (license license:lgpl2.1+)))
614
615 (define-public stow
616 (package
617 (name "stow")
618 (version "2.3.1")
619 (source (origin
620 (method url-fetch)
621 (uri (string-append "mirror://gnu/stow/stow-"
622 version ".tar.gz"))
623 (sha256
624 (base32
625 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
626 (build-system gnu-build-system)
627 (inputs
628 `(("perl" ,perl)))
629 (native-inputs
630 `(("perl-test-simple" ,perl-test-simple)
631 ("perl-test-output" ,perl-test-output)
632 ("perl-capture-tiny" ,perl-capture-tiny)
633 ("perl-io-stringy" ,perl-io-stringy)))
634 (home-page "https://www.gnu.org/software/stow/")
635 (synopsis "Managing installed software packages")
636 (description
637 "GNU Stow is a symlink manager. It generates symlinks to directories
638 of data and makes them appear to be merged into the same directory. It is
639 typically used for managing software packages installed from source, by
640 letting you install them apart in distinct directories and then create
641 symlinks to the files in a common directory such as /usr/local.")
642 (license license:gpl3+)))
643
644 (define-public xstow
645 (package
646 (name "xstow")
647 (version "1.0.2")
648 (source (origin
649 (method url-fetch)
650 (uri (string-append "mirror://sourceforge/xstow/xstow-"
651 version ".tar.bz2"))
652 (sha256
653 (base32
654 "1vy6lcswpkixh7h5mvsmq2wbcih6lpsmcva3m7v6f5npllciy13g"))))
655 (build-system gnu-build-system)
656 (synopsis "Replacement of GNU Stow written in C++")
657 (description
658 "XStow is a replacement of GNU Stow written in C++. It supports all
659 features of Stow with some extensions.")
660 (home-page "http://xstow.sourceforge.net/")
661 (license license:gpl2)))
662
663 (define-public rpm
664 (package
665 (name "rpm")
666 (version "4.14.2.1")
667 (source (origin
668 (method url-fetch)
669 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
670 (version-major+minor version) ".x/rpm-"
671 version ".tar.bz2"))
672 (sha256
673 (base32
674 "1nmck2fq9h85fgs3zhh6w1avlw5y16cbz5khd459ry3jfd5w4f8i"))))
675 (build-system gnu-build-system)
676 (arguments
677 '(#:configure-flags '("--with-external-db" ;use the system's bdb
678 "--enable-python"
679 "--without-lua")
680 #:phases (modify-phases %standard-phases
681 (add-before 'configure 'set-nss-library-path
682 (lambda* (#:key inputs #:allow-other-keys)
683 (let ((nss (assoc-ref inputs "nss")))
684 (setenv "LIBRARY_PATH"
685 (string-append (getenv "LIBRARY_PATH") ":"
686 nss "/lib/nss"))
687 #t))))))
688 (native-inputs
689 `(("pkg-config" ,pkg-config)))
690 (inputs
691 `(("python" ,python)
692 ("xz" ,xz)
693 ("bdb" ,bdb)
694 ("popt" ,popt)
695 ("nss" ,nss)
696 ("nspr" ,nspr)
697 ("libarchive" ,libarchive)
698 ("file" ,file)
699 ("bzip2" ,bzip2)
700 ("zlib" ,zlib)
701 ("cpio" ,cpio)))
702 (home-page "https://rpm.org/")
703 (synopsis "The RPM Package Manager")
704 (description
705 "The RPM Package Manager (RPM) is a command-line driven package
706 management system capable of installing, uninstalling, verifying, querying,
707 and updating computer software packages. Each software package consists of an
708 archive of files along with information about the package like its version, a
709 description. There is also a library permitting developers to manage such
710 transactions from C or Python.")
711
712 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
713 (license license:gpl2+)))
714
715 (define-public python-anaconda-client
716 (package
717 (name "python-anaconda-client")
718 (version "1.6.3")
719 (source
720 (origin
721 (method git-fetch)
722 (uri (git-reference
723 (url "https://github.com/Anaconda-Platform/anaconda-client")
724 (commit version)))
725 (file-name (git-file-name name version))
726 (sha256
727 (base32
728 "0w1bfxnydjl9qp53r2gcvr6vlpdqqilcrzqxrll9sgg6vwdyiyyp"))))
729 (build-system python-build-system)
730 (propagated-inputs
731 `(("python-pyyaml" ,python-pyyaml)
732 ("python-requests" ,python-requests)
733 ("python-clyent" ,python-clyent)))
734 (native-inputs
735 `(("python-pytz" ,python-pytz)
736 ("python-dateutil" ,python-dateutil)
737 ("python-mock" ,python-mock)
738 ("python-coverage" ,python-coverage)
739 ("python-pillow" ,python-pillow)))
740 (arguments
741 `(#:phases
742 (modify-phases %standard-phases
743 ;; This is needed for some tests.
744 (add-before 'check 'set-up-home
745 (lambda* _ (setenv "HOME" "/tmp") #t))
746 (add-before 'check 'remove-network-tests
747 (lambda* _
748 ;; Remove tests requiring a network connection
749 (let ((network-tests '("tests/test_upload.py"
750 "tests/test_authorizations.py"
751 "tests/test_login.py"
752 "tests/test_whoami.py"
753 "utils/notebook/tests/test_data_uri.py"
754 "utils/notebook/tests/test_base.py"
755 "utils/notebook/tests/test_downloader.py"
756 "inspect_package/tests/test_conda.py")))
757 (with-directory-excursion "binstar_client"
758 (for-each delete-file network-tests)))
759 #t)))))
760 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
761 (synopsis "Anaconda Cloud command line client library")
762 (description
763 "Anaconda Cloud command line client library provides an interface to
764 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
765 environments.")
766 (license license:bsd-3)))
767
768 (define-public python2-anaconda-client
769 (package-with-python2 python-anaconda-client))
770
771 (define-public python-conda-package-handling
772 (package
773 (name "python-conda-package-handling")
774 (version "1.6.0")
775 (source
776 (origin
777 (method git-fetch)
778 (uri (git-reference
779 (url "https://github.com/conda/conda-package-handling/")
780 (commit version)))
781 (file-name (git-file-name name version))
782 (sha256
783 (base32
784 "0bqbs6a8jbjmbn47n5n1p529cx7pf4vgfnhqca9mflgidfb5i0jf"))))
785 (build-system python-build-system)
786 (arguments
787 `(#:phases
788 (modify-phases %standard-phases
789 (add-after 'unpack 'use-unmodified-libarchive
790 (lambda _
791 (substitute* "setup.py"
792 (("archive_and_deps") "archive"))
793 #t))
794 (replace 'check
795 (lambda* (#:key inputs outputs #:allow-other-keys)
796 (add-installed-pythonpath inputs outputs)
797 (invoke "pytest" "-vv" "tests"
798 "-k"
799 (string-append
800 ;; TODO: these three fail because the mocker fixture
801 ;; cannot be found
802 "not test_rename_to_trash"
803 " and not test_api_extract_tarball_with_libarchive_import_error"
804 " and not test_delete_trash"
805 ;; TODO: this one does not raise an exception when it
806 ;; should.
807 " and not test_secure_refusal_to_extract_abs_paths")))))))
808 (propagated-inputs
809 `(("python-six" ,python-six)
810 ("python-tqdm" ,python-tqdm)))
811 (inputs
812 `(("libarchive" ,libarchive)))
813 (native-inputs
814 `(("python-cython" ,python-cython)
815 ("python-pytest" ,python-pytest)
816 ("python-pytest-cov" ,python-pytest-cov)
817 ("python-mock" ,python-mock)))
818 (home-page "https://conda.io")
819 (synopsis "Create and extract conda packages of various formats")
820 (description
821 "This library is an abstraction of Conda package handling and a tool for
822 extracting, creating, and converting between formats.")
823 (license license:bsd-3)))
824
825 (define-public conda
826 (package
827 (name "conda")
828 (version "4.8.3")
829 (source
830 (origin
831 (method git-fetch)
832 (uri (git-reference
833 (url "https://github.com/conda/conda")
834 (commit version)))
835 (file-name (git-file-name name version))
836 (sha256
837 (base32
838 "0iv1qzk21jsk6vdp3106xvpvl68zgfdqb3kyzpya87jhkl204l7r"))))
839 (build-system python-build-system)
840 (arguments
841 `(#:phases
842 (modify-phases %standard-phases
843 (add-after 'unpack 'fix-permissions
844 (lambda _
845 ;; This file is no longer writable after downloading with
846 ;; 'git-fetch'
847 (make-file-writable
848 "tests/conda_env/support/saved-env/environment.yml")
849 #t))
850 (add-after 'unpack 'correct-python-executable-name
851 (lambda* (#:key inputs #:allow-other-keys)
852 (let ((python (assoc-ref inputs "python-wrapper")))
853 #;
854 (substitute* "conda/common/path.py"
855 (("python_version or ''")
856 "python_version or '3'"))
857 (substitute* "conda/core/initialize.py"
858 (("python_exe = join")
859 (format #f "python_exe = \"~a/bin/python\" #"
860 python))))
861 #t))
862 (add-after 'unpack 'do-not-use-python-root-as-prefix
863 (lambda* (#:key inputs outputs #:allow-other-keys)
864 (let ((out (assoc-ref outputs "out"))
865 (python (assoc-ref inputs "python-wrapper")))
866 (substitute* "tests/core/test_initialize.py"
867 (("\"\"\"\\) % conda_prefix")
868 (format #f "\"\"\") % \"~a\"" python))
869 (("CONDA_PYTHON_EXE \"%s\"' % join\\(conda_prefix")
870 (format #f "CONDA_PYTHON_EXE \"%s\"' % join(\"~a\""
871 python))
872 (("conda_prefix = abspath\\(sys.prefix\\)")
873 (format #f "conda_prefix = abspath(\"~a\")" out)))
874 (substitute* "conda/base/context.py"
875 (("os.chdir\\(sys.prefix\\)")
876 (format #f "os.chdir(\"~a\")" out))
877 (("sys.prefix, '.condarc'")
878 (format #f "\"~a\", '.condarc'" out))
879 (("return abspath\\(sys.prefix\\)")
880 (format #f "return abspath(\"~a\")" out))
881 (("os.path.join\\(sys.prefix, bin_dir, exe\\)")
882 (format #f "\"~a/bin/conda\"" out))
883 (("'CONDA_EXE', sys.executable")
884 (format #f "'CONDA_EXE', \"~a/bin/conda\"" out))))
885 #t))
886 (add-before 'build 'create-version-file
887 (lambda _
888 (with-output-to-file "conda/.version"
889 (lambda () (display ,version)))
890 #t))
891 (replace 'check
892 (lambda _
893 (setenv "HOME" "/tmp")
894 (invoke "py.test" "-vv"
895 "-k"
896 (string-append
897 "not integration"
898 ;; This one reports a newer version of conda than
899 ;; expected.
900 " and not test_auto_update_conda"
901 ;; This fails because the output directory is not a
902 ;; Conda environment.
903 " and not test_list"
904 ;; This fails because we patched the default root
905 ;; prefix.
906 " and not test_default_target_is_root_prefix"
907 ;; TODO: I don't understand what this failure means
908 " and not test_PrefixData_return_value_contract"
909 ;; TODO: same here
910 " and not test_install_1"
911 ;; Not sure if this is really wrong. This fails because
912 ;; /gnu/store/...python-conda-4.8.3/bin/python
913 ;; is not /gnu/store/...python-wrapper-3.8.2/bin/python
914 " and not test_make_entry_point"))))
915 (add-after 'install 'init
916 ;; This writes a whole bunch of shell initialization files to the
917 ;; prefix directory. Many features of conda can only be used after
918 ;; running "conda init".
919 (lambda* (#:key inputs outputs #:allow-other-keys)
920 (add-installed-pythonpath inputs outputs)
921 (setenv "HOME" "/tmp")
922
923 ;; "conda init" insists on using sudo, because it is hell-bent on
924 ;; modifying system files.
925 (mkdir-p "/tmp/fake-sudo")
926 (with-output-to-file "/tmp/fake-sudo/sudo"
927 (lambda () (format #t "#!~/bin/sh~%exec $@" (which "sh"))))
928 (chmod "/tmp/fake-sudo/sudo" #o700)
929 (setenv "PATH" (string-append "/tmp/fake-sudo:"
930 (getenv "PATH")))
931
932 (invoke (string-append (assoc-ref outputs "out")
933 "/bin/conda")
934 "init"))))))
935 (inputs
936 `(("python-wrapper" ,python-wrapper)))
937 (propagated-inputs
938 `(("python-anaconda-client" ,python-anaconda-client)
939 ("python-conda-package-handling" ,python-conda-package-handling)
940 ("python-cytoolz" ,python-cytoolz)
941 ("python-pycosat" ,python-pycosat)
942 ("python-pytest" ,python-pytest)
943 ("python-pyyaml" ,python-pyyaml)
944 ("python-requests" ,python-requests)
945 ("python-responses" ,python-responses)
946 ("python-ruamel.yaml" ,python-ruamel.yaml)
947 ("python-tqdm" ,python-tqdm)
948 ;; XXX: This is dragged in by libarchive and is needed at runtime.
949 ("zstd" ,zstd)))
950 (home-page "https://github.com/conda/conda")
951 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
952 (description
953 "Conda is a cross-platform, Python-agnostic binary package manager. It
954 is the package manager used by Anaconda installations, but it may be used for
955 other systems as well. Conda makes environments first-class citizens, making
956 it easy to create independent environments even for C libraries. Conda is
957 written entirely in Python.")
958 (license license:bsd-3)))
959
960 (define-public python-conda
961 (deprecated-package "python-conda" conda))
962
963 (define-public gwl
964 (package
965 (name "gwl")
966 (version "0.2.1")
967 (source (origin
968 (method url-fetch)
969 (uri (string-append "mirror://gnu/gwl/gwl-" version ".tar.gz"))
970 (sha256
971 (base32
972 "1ji5jvzni8aml9fmimlr11g3k8isrnlvnbzhmwgdjh72hils0alc"))))
973 (build-system gnu-build-system)
974 (arguments
975 `(#:phases
976 (modify-phases %standard-phases
977 (add-before 'build 'fix-tests
978 (lambda _
979 ;; Avoid cross-device link.
980 (substitute* "tests/cache.scm"
981 (("/tmp/gwl-test-input-XXXXXX")
982 (string-append (getcwd) "/gwl-test-input-XXXXXX")))
983 #t)))))
984 (native-inputs
985 `(("autoconf" ,autoconf)
986 ("automake" ,automake)
987 ("pkg-config" ,pkg-config)
988 ("texinfo" ,texinfo)
989 ("graphviz" ,graphviz)))
990 (inputs
991 `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
992 (propagated-inputs
993 `(("guix" ,guix)
994 ("guile-commonmark" ,guile-commonmark)
995 ("guile-gcrypt" ,guile-gcrypt)
996 ("guile-pfds" ,guile-pfds)
997 ("guile-syntax-highlight" ,guile-syntax-highlight)
998 ("guile-wisp" ,guile-wisp)))
999 (home-page "https://workflows.guix.info")
1000 (synopsis "Workflow management extension for GNU Guix")
1001 (description "The @dfn{Guix Workflow Language} (GWL) provides an
1002 extension to GNU Guix's declarative language for package management to
1003 automate the execution of programs in scientific workflows. The GWL
1004 can use process engines to integrate with various computing
1005 environments.")
1006 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
1007 ;; the web interface modules in gwl/ are licensed AGPL3+,
1008 ;; and the fonts included in this package are licensed OFL1.1.
1009 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
1010
1011 (define-public guix-build-coordinator
1012 (let ((commit "98f50831612b9d1253ae8ca2bceb547fed373f41")
1013 (revision "5"))
1014 (package
1015 (name "guix-build-coordinator")
1016 (version (git-version "0" revision commit))
1017 (source (origin
1018 (method git-fetch)
1019 (uri (git-reference
1020 (url "https://git.cbaines.net/git/guix/build-coordinator")
1021 (commit commit)))
1022 (sha256
1023 (base32
1024 "08xwb5phh14cxgwv4fxcd2hhpjgqxfknm9zkx9qp26zb56w2xzkz"))
1025 (file-name (string-append name "-" version "-checkout"))))
1026 (build-system gnu-build-system)
1027 (arguments
1028 `(#:modules (((guix build guile-build-system)
1029 #:select (target-guile-effective-version))
1030 ,@%gnu-build-system-modules)
1031 #:imported-modules ((guix build guile-build-system)
1032 ,@%gnu-build-system-modules)
1033 #:phases
1034 (modify-phases %standard-phases
1035 (add-before 'build 'set-GUILE_AUTO_COMPILE
1036 (lambda _
1037 ;; To avoid warnings relating to 'guild'.
1038 (setenv "GUILE_AUTO_COMPILE" "0")
1039 #t))
1040 (add-after 'install 'wrap-executable
1041 (lambda* (#:key inputs outputs #:allow-other-keys)
1042 (let* ((out (assoc-ref outputs "out"))
1043 (bin (string-append out "/bin"))
1044 (guile (assoc-ref inputs "guile"))
1045 (version (target-guile-effective-version))
1046 (scm (string-append out "/share/guile/site/" version))
1047 (go (string-append out "/lib/guile/" version "/site-ccache")))
1048 (for-each
1049 (lambda (file)
1050 (simple-format (current-error-port) "wrapping: ~A\n" file)
1051 (wrap-program file
1052 `("PATH" ":" prefix
1053 (,bin
1054 ;; Support building without sqitch as an input, as it
1055 ;; can't be cross-compiled yet
1056 ,@(or (and=> (assoc-ref inputs "sqitch")
1057 list)
1058 '())))
1059 `("GUILE_LOAD_PATH" ":" prefix
1060 (,scm ,(getenv "GUILE_LOAD_PATH")))
1061 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1062 (,go ,(getenv "GUILE_LOAD_COMPILED_PATH")))))
1063 (find-files bin)))
1064 #t))
1065 (delete 'strip)))) ; As the .go files aren't compatible
1066 (native-inputs
1067 `(("pkg-config" ,pkg-config)
1068 ("autoconf" ,autoconf)
1069 ("automake" ,automake)
1070 ("gnutls" ,gnutls)
1071
1072 ;; Guile libraries are needed here for cross-compilation.
1073 ("guile-json" ,guile-json-3)
1074 ("guile-gcrypt" ,guile-gcrypt)
1075 ("guix" ,guix)
1076 ("guile-prometheus" ,guile-prometheus)
1077 ("guile-fibers" ,guile-fibers)
1078 ("guile-lib" ,guile-lib)
1079 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1080 (inputs
1081 `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))
1082 ("sqlite" ,sqlite)
1083 ("sqitch" ,sqitch)))
1084 (propagated-inputs
1085 `(("guile-fibers" ,guile-fibers)
1086 ("guile-prometheus" ,guile-prometheus)
1087 ("guile-gcrypt" ,guile-gcrypt)
1088 ("guile-json" ,guile-json-4)
1089 ("guile-lib" ,guile-lib)
1090 ("guile-lzlib" ,guile-lzlib)
1091 ("guile-zlib" ,guile-zlib)
1092 ("guile-sqlite3" ,guile-sqlite3)
1093 ("guix" ,guix)
1094 ("gnutls" ,gnutls)))
1095 (home-page "https://git.cbaines.net/guix/build-coordinator/")
1096 (synopsis "Tool to help build derivations")
1097 (description
1098 "The Guix Build Coordinator helps with performing lots of builds across
1099 potentially many machines, and with doing something with the results and
1100 outputs of those builds.")
1101 (license license:gpl3+))))
1102
1103 (define-public guix-jupyter
1104 (package
1105 (name "guix-jupyter")
1106 (version "0.1.0")
1107 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
1108 (source (origin
1109 (method git-fetch)
1110 (uri (git-reference (url home-page)
1111 (commit (string-append "v" version))))
1112 (sha256
1113 (base32
1114 "01z7jjkc7r7lj6637rcgpz40v8xqqyfp6871h94yvcnwm7zy9h1n"))
1115 (modules '((guix build utils)))
1116 (snippet
1117 '(begin
1118 ;; Allow builds with Guile 3.0.
1119 (substitute* "configure.ac"
1120 (("^GUILE_PKG.*")
1121 "GUILE_PKG([3.0 2.2])\n"))
1122
1123 ;; Avoid name clash and build failure now that
1124 ;; 'define-json-mapping' is also provided by Guile-JSON, as
1125 ;; of version 4.3.
1126 (substitute* (find-files "." "\\.scm$")
1127 (("define-json-mapping")
1128 "define-json-mapping*")
1129 (("<=>")
1130 "<->"))
1131 #t))
1132 (file-name (string-append "guix-jupyter-" version "-checkout"))))
1133 (build-system gnu-build-system)
1134 (arguments
1135 `(#:modules ((srfi srfi-26)
1136 (ice-9 match)
1137 (ice-9 popen)
1138 (ice-9 rdelim)
1139 (guix build utils)
1140 (guix build gnu-build-system))
1141 #:phases
1142 (modify-phases %standard-phases
1143 (add-after 'install 'sed-kernel-json
1144 (lambda* (#:key inputs outputs #:allow-other-keys)
1145 (let* ((out (assoc-ref outputs "out"))
1146 (guix (assoc-ref inputs "guix"))
1147 (guile (assoc-ref inputs "guile"))
1148 (json (assoc-ref inputs "guile-json"))
1149 (git (assoc-ref inputs "guile-git"))
1150 (bs (assoc-ref inputs "guile-bytestructures"))
1151 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
1152 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1153 (deps (list out s-zmq guix json git bs gcrypt))
1154 (effective
1155 (read-line
1156 (open-pipe* OPEN_READ
1157 (string-append guile "/bin/guile")
1158 "-c" "(display (effective-version))")))
1159 (path (map (cut string-append "-L\", \"" <>
1160 "/share/guile/site/"
1161 effective)
1162 deps))
1163 (gopath (map (cut string-append "-C\", \"" <>
1164 "/lib/guile/" effective
1165 "/site-ccache")
1166 deps))
1167 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
1168 (substitute* (string-append kernel-dir "kernel.json")
1169 (("-s")
1170 (string-join
1171 (list (string-join path "\",\n\t\t\"")
1172 (string-join gopath "\",\n\t\t\"")
1173 "-s")
1174 "\",\n\t\t\""))
1175 (("guix-jupyter-kernel.scm")
1176 (string-append out "/share/guile/site/3.0/"
1177 "guix-jupyter-kernel.scm")))
1178 #t))))))
1179 (native-inputs
1180 `(("autoconf" ,autoconf)
1181 ("automake" ,automake)
1182 ("pkg-config" ,pkg-config)
1183
1184 ;; For testing.
1185 ("jupyter" ,jupyter)
1186 ("python-ipython" ,python-ipython)
1187 ("python-ipykernel" ,python-ipykernel)))
1188 (inputs
1189 `(("guix" ,guix)
1190 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1191 (propagated-inputs
1192 `(("guile-json" ,guile-json-4)
1193 ("guile-simple-zmq" ,guile-simple-zmq)
1194 ("guile-gcrypt" ,guile-gcrypt)))
1195 (synopsis "Guix kernel for Jupyter")
1196 (description
1197 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
1198 with information about their software dependencies, such that code is executed
1199 in the right software environment. Guix-Jupyter spawns the actual kernels
1200 such as @code{python-ipykernel} on behalf of the notebook user and runs them
1201 in an isolated environment, in separate namespaces.")
1202 (license license:gpl3+)))
1203
1204 (define-public gcab
1205 (package
1206 (name "gcab")
1207 (version "1.4")
1208 (source (origin
1209 (method url-fetch)
1210 (uri (string-append "mirror://gnome/sources/gcab/"
1211 version "/gcab-" version ".tar.xz"))
1212 (sha256
1213 (base32
1214 "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7"))))
1215 (build-system meson-build-system)
1216 (native-inputs
1217 `(("glib:bin" ,glib "bin") ; for glib-mkenums
1218 ("intltool" ,intltool)
1219 ("pkg-config" ,pkg-config)
1220 ("vala" ,vala)))
1221 (inputs
1222 `(("glib" ,glib)
1223 ("zlib" ,zlib)))
1224 (arguments
1225 `(#:configure-flags
1226 ;; XXX This ‘documentation’ is for developers, and fails informatively:
1227 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
1228 (list "-Ddocs=false"
1229 "-Dintrospection=false")))
1230 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
1231 (synopsis "Microsoft Cabinet file manipulation library")
1232 (description
1233 "The libgcab library provides GObject functions to read, write, and modify
1234 Microsoft cabinet (.@dfn{CAB}) files.")
1235 (license (list license:gpl2+ ; tests/testsuite.at
1236 license:lgpl2.1+)))) ; the rest
1237
1238 (define-public msitools
1239 (package
1240 (name "msitools")
1241 (version "0.100")
1242 (source (origin
1243 (method url-fetch)
1244 (uri (string-append "mirror://gnome/sources/msitools/"
1245 version "/msitools-" version ".tar.xz"))
1246 (sha256
1247 (base32
1248 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
1249 (build-system gnu-build-system)
1250 (native-inputs
1251 `(("bison" ,bison)
1252 ("pkg-config" ,pkg-config)))
1253 (inputs
1254 `(("gcab" ,gcab)
1255 ("glib" ,glib)
1256 ("libgsf" ,libgsf)
1257 ("libxml2" ,libxml2)
1258 ("uuid" ,util-linux "lib")))
1259 (home-page "https://wiki.gnome.org/msitools")
1260 (synopsis "Windows Installer file manipulation tool")
1261 (description
1262 "msitools is a collection of command-line tools to inspect, extract, build,
1263 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
1264 for packaging and deployment of cross-compiled Windows applications.")
1265 (license license:lgpl2.1+)))
1266
1267 (define-public libostree
1268 (package
1269 (name "libostree")
1270 (version "2020.7")
1271 (source
1272 (origin
1273 (method url-fetch)
1274 (uri (string-append
1275 "https://github.com/ostreedev/ostree/releases/download/v"
1276 (version-major+minor version) "/libostree-" version ".tar.xz"))
1277 (sha256
1278 (base32 "0clriq2ypz1fycd6mpjyrhzid44svzpzw0amnank593h69b216ax"))))
1279 (build-system gnu-build-system)
1280 (arguments
1281 '(#:phases
1282 (modify-phases %standard-phases
1283 (add-before 'check 'pre-check
1284 (lambda _
1285 ;; Don't try to use the non-existing '/var/tmp' as test
1286 ;; directory.
1287 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
1288 #t)))
1289 ;; XXX: fails with:
1290 ;; tap-driver.sh: missing test plan
1291 ;; tap-driver.sh: internal error getting exit status
1292 ;; tap-driver.sh: fatal: I/O or internal error
1293 #:tests? #f))
1294 (native-inputs
1295 `(("attr" ,attr) ; for tests
1296 ("bison" ,bison)
1297 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
1298 ("gobject-introspection" ,gobject-introspection)
1299 ("pkg-config" ,pkg-config)
1300 ("xsltproc" ,libxslt)))
1301 (inputs
1302 `(("avahi" ,avahi)
1303 ("docbook-xml" ,docbook-xml-4.2)
1304 ("docbook-xsl" ,docbook-xsl)
1305 ("e2fsprogs" ,e2fsprogs)
1306 ("fuse" ,fuse)
1307 ("glib" ,glib)
1308 ("gpgme" ,gpgme)
1309 ("libarchive" ,libarchive)
1310 ("libsoup" ,libsoup)
1311 ("util-linux" ,util-linux)))
1312 (home-page "https://ostree.readthedocs.io/en/latest/")
1313 (synopsis "Operating system and container binary deployment and upgrades")
1314 (description
1315 "@code{libostree} is both a shared library and suite of command line
1316 tools that combines a \"git-like\" model for committing and downloading
1317 bootable file system trees, along with a layer for deploying them and managing
1318 the boot loader configuration.")
1319 (license license:lgpl2.0+)))
1320
1321 (define-public flatpak
1322 (package
1323 (name "flatpak")
1324 (version "1.8.2")
1325 (source
1326 (origin
1327 (method url-fetch)
1328 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
1329 version "/flatpak-" version ".tar.xz"))
1330 (sha256
1331 (base32 "1c45a0k7wx685n5b3ihv7dk0mm2kmwbw7cx8w5g2la62yxfn49kr"))))
1332
1333 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1334 ;; find the TLS backend in glib-networking.
1335 (build-system glib-or-gtk-build-system)
1336
1337 (arguments
1338 '(#:configure-flags
1339 (list
1340 "--enable-documentation=no" ;; FIXME
1341 "--enable-system-helper=no"
1342 "--localstatedir=/var"
1343 (string-append "--with-system-bubblewrap="
1344 (assoc-ref %build-inputs "bubblewrap")
1345 "/bin/bwrap")
1346 (string-append "--with-system-dbus-proxy="
1347 (assoc-ref %build-inputs "xdg-dbus-proxy")
1348 "/bin/xdg-dbus-proxy"))
1349 #:phases
1350 (modify-phases %standard-phases
1351 (add-after 'unpack 'fix-tests
1352 (lambda* (#:key inputs #:allow-other-keys)
1353 (copy-recursively
1354 (string-append (assoc-ref inputs "glibc-utf8-locales")
1355 "/lib/locale/") "/tmp/locale")
1356 (for-each make-file-writable (find-files "/tmp"))
1357 (substitute* "tests/make-test-runtime.sh"
1358 (("cp `which.*") "echo guix\n")
1359 (("cp -r /usr/lib/locale/C\\.\\*")
1360 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
1361 cp -r /tmp/locale/*/en_US.*")))
1362 (substitute* "tests/libtest.sh"
1363 (("/bin/kill") (which "kill"))
1364 (("/usr/bin/python3") (which "python3")))
1365 #t))
1366 ;; Many tests fail for unknown reasons, so we just run a few basic
1367 ;; tests.
1368 (replace 'check
1369 (lambda _
1370 (setenv "HOME" "/tmp")
1371 (invoke "make" "check"
1372 "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
1373 (native-inputs
1374 `(("bison" ,bison)
1375 ("dbus" ,dbus) ; for dbus-daemon
1376 ("gettext" ,gettext-minimal)
1377 ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
1378 ("glibc-utf8-locales" ,glibc-utf8-locales)
1379 ("gobject-introspection" ,gobject-introspection)
1380 ("libcap" ,libcap)
1381 ("pkg-config" ,pkg-config)
1382 ("python" ,python)
1383 ("python-pyparsing" ,python-pyparsing)
1384 ("socat" ,socat)
1385 ("which" ,which)))
1386 (propagated-inputs `(("glib-networking" ,glib-networking)
1387 ("gnupg" ,gnupg)
1388 ("gsettings-desktop-schemas"
1389 ,gsettings-desktop-schemas)))
1390 (inputs
1391 `(("appstream-glib" ,appstream-glib)
1392 ("bubblewrap" ,bubblewrap)
1393 ("dconf" ,dconf)
1394 ("fuse" ,fuse)
1395 ("gdk-pixbuf" ,gdk-pixbuf)
1396 ("gpgme" ,gpgme)
1397 ("json-glib" ,json-glib)
1398 ("libarchive" ,libarchive)
1399 ("libostree" ,libostree)
1400 ("libseccomp" ,libseccomp)
1401 ("libsoup" ,libsoup)
1402 ("libxau" ,libxau)
1403 ("libxml2" ,libxml2)
1404 ("util-linux" ,util-linux)
1405 ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
1406 (home-page "https://flatpak.org")
1407 (synopsis "System for building, distributing, and running sandboxed desktop
1408 applications")
1409 (description "Flatpak is a system for building, distributing, and running
1410 sandboxed desktop applications on GNU/Linux.")
1411 (license license:lgpl2.1+)))
1412
1413 (define-public akku
1414 (package
1415 (name "akku")
1416 (version "1.0.1")
1417 (source (origin
1418 (method git-fetch)
1419 (uri (git-reference
1420 (url "https://gitlab.com/akkuscm/akku.git")
1421 (commit (string-append "v" version))))
1422 (file-name (git-file-name name version))
1423 (sha256 (base32 "1dm32ws3nshnnscd7k75zswxxs1pp25y2q4k8j5ms241hz47by3c"))))
1424 (build-system gnu-build-system)
1425 (arguments
1426 '(#:phases (modify-phases %standard-phases
1427 (replace 'bootstrap
1428 (lambda* (#:key outputs #:allow-other-keys)
1429 (for-each patch-shebang
1430 '("bootstrap"
1431 ".akku/env"))
1432 (let* ((home "/tmp")
1433 (datadir (string-append home "/.local/share/akku/")))
1434 (mkdir-p datadir)
1435 (invoke "touch" (string-append datadir "index.db"))
1436 (setenv "HOME" home))
1437 (invoke "./bootstrap")
1438 #t))
1439 (add-after 'install 'wrap-executables
1440 (lambda* (#:key outputs inputs #:allow-other-keys)
1441 (let ((out (assoc-ref outputs "out"))
1442 (curl (assoc-ref inputs "curl")))
1443 (wrap-program (string-append out "/bin/akku")
1444 `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
1445 #t))))))
1446 (native-inputs
1447 `(("which" ,which)
1448 ("autoconf" ,autoconf)
1449 ("automake" ,automake)
1450 ("pkg-config" ,pkg-config)))
1451 (inputs
1452 `(("guile" ,guile-3.0)
1453 ("curl" ,curl)))
1454 (home-page "https://akkuscm.org/")
1455 (synopsis "Language package manager for Scheme")
1456 (description
1457 "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
1458 It is mainly meant for programmers who develop portable programs or libraries in Scheme,
1459 but could potentially work for end-users of those programs. It also has a translator
1460 from R7RS, which allows most R7RS code to run on R6RS implementations.")
1461 (license license:gpl3+)))