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