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