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