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