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