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