252ff04632b5383de0a5f19efb17758a2fe3d0ba
[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 "2f458ad713143f31365b9c80ed1b98999db8de32")
134 (revision 23))
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 "1csf8s37babnq5xcp54wgiwcgn9968ha5p52w10mjb24dr7i1m7w"))
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.6")
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 "128xf2as0y7hr28x575pbf9lkjpxr9hsxknbavv4p7ywr4lhbs85"))))
569 (build-system gnu-build-system)
570 (arguments
571 `(#:configure-flags
572 (list "--sysconfdir=/etc")
573 #:phases
574 (modify-phases %standard-phases
575 (replace 'install
576 ;; Don't try & fail to create subdirectories in /etc, but keep them
577 ;; in the output as examples.
578 (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
579 (let* ((out (assoc-ref outputs "out"))
580 (etc (string-append out "/etc")))
581 (apply invoke "make" "install"
582 (string-append "sysconfdir=" etc)
583 (string-append "profiledir=" etc "/profile.d")
584 make-flags)))))))
585 (native-inputs `(("pkg-config" ,pkg-config)))
586 (inputs `(("boost" ,boost)
587 ("brotli" ,brotli)
588 ("bzip2" ,bzip2)
589 ("curl" ,curl)
590 ("editline" ,editline)
591 ("libgc" ,libgc)
592 ("libseccomp" ,libseccomp)
593 ("libsodium" ,libsodium)
594 ("openssl" ,openssl)
595 ("sqlite" ,sqlite)
596 ("xz" ,xz)))
597 (home-page "https://nixos.org/nix/")
598 (synopsis "The Nix package manager")
599 (description
600 "Nix is a purely functional package manager. This means that it treats
601 packages like values in purely functional programming languages such as
602 Haskell—they are built by functions that don't have side-effects, and they
603 never change after they have been built. Nix stores packages in the Nix
604 store, usually the directory /nix/store, where each package has its own unique
605 sub-directory.")
606 (license license:lgpl2.1+)))
607
608 (define-public stow
609 (package
610 (name "stow")
611 (version "2.3.1")
612 (source (origin
613 (method url-fetch)
614 (uri (string-append "mirror://gnu/stow/stow-"
615 version ".tar.gz"))
616 (sha256
617 (base32
618 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
619 (build-system gnu-build-system)
620 (inputs
621 `(("perl" ,perl)))
622 (native-inputs
623 `(("perl-test-simple" ,perl-test-simple)
624 ("perl-test-output" ,perl-test-output)
625 ("perl-capture-tiny" ,perl-capture-tiny)
626 ("perl-io-stringy" ,perl-io-stringy)))
627 (home-page "https://www.gnu.org/software/stow/")
628 (synopsis "Managing installed software packages")
629 (description
630 "GNU Stow is a symlink manager. It generates symlinks to directories
631 of data and makes them appear to be merged into the same directory. It is
632 typically used for managing software packages installed from source, by
633 letting you install them apart in distinct directories and then create
634 symlinks to the files in a common directory such as /usr/local.")
635 (license license:gpl3+)))
636
637 (define-public rpm
638 (package
639 (name "rpm")
640 (version "4.14.2.1")
641 (source (origin
642 (method url-fetch)
643 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
644 (version-major+minor version) ".x/rpm-"
645 version ".tar.bz2"))
646 (sha256
647 (base32
648 "1nmck2fq9h85fgs3zhh6w1avlw5y16cbz5khd459ry3jfd5w4f8i"))))
649 (build-system gnu-build-system)
650 (arguments
651 '(#:configure-flags '("--with-external-db" ;use the system's bdb
652 "--enable-python"
653 "--without-lua")
654 #:phases (modify-phases %standard-phases
655 (add-before 'configure 'set-nss-library-path
656 (lambda* (#:key inputs #:allow-other-keys)
657 (let ((nss (assoc-ref inputs "nss")))
658 (setenv "LIBRARY_PATH"
659 (string-append (getenv "LIBRARY_PATH") ":"
660 nss "/lib/nss"))
661 #t))))))
662 (native-inputs
663 `(("pkg-config" ,pkg-config)))
664 (inputs
665 `(("python" ,python)
666 ("xz" ,xz)
667 ("bdb" ,bdb)
668 ("popt" ,popt)
669 ("nss" ,nss)
670 ("nspr" ,nspr)
671 ("libarchive" ,libarchive)
672 ("file" ,file)
673 ("bzip2" ,bzip2)
674 ("zlib" ,zlib)
675 ("cpio" ,cpio)))
676 (home-page "https://rpm.org/")
677 (synopsis "The RPM Package Manager")
678 (description
679 "The RPM Package Manager (RPM) is a command-line driven package
680 management system capable of installing, uninstalling, verifying, querying,
681 and updating computer software packages. Each software package consists of an
682 archive of files along with information about the package like its version, a
683 description. There is also a library permitting developers to manage such
684 transactions from C or Python.")
685
686 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
687 (license license:gpl2+)))
688
689 (define-public python-anaconda-client
690 (package
691 (name "python-anaconda-client")
692 (version "1.6.3")
693 (source
694 (origin
695 (method git-fetch)
696 (uri (git-reference
697 (url "https://github.com/Anaconda-Platform/anaconda-client")
698 (commit version)))
699 (file-name (git-file-name name version))
700 (sha256
701 (base32
702 "0w1bfxnydjl9qp53r2gcvr6vlpdqqilcrzqxrll9sgg6vwdyiyyp"))))
703 (build-system python-build-system)
704 (propagated-inputs
705 `(("python-pyyaml" ,python-pyyaml)
706 ("python-requests" ,python-requests)
707 ("python-clyent" ,python-clyent)))
708 (native-inputs
709 `(("python-pytz" ,python-pytz)
710 ("python-dateutil" ,python-dateutil)
711 ("python-mock" ,python-mock)
712 ("python-coverage" ,python-coverage)
713 ("python-pillow" ,python-pillow)))
714 (arguments
715 `(#:phases
716 (modify-phases %standard-phases
717 ;; This is needed for some tests.
718 (add-before 'check 'set-up-home
719 (lambda* _ (setenv "HOME" "/tmp") #t))
720 (add-before 'check 'remove-network-tests
721 (lambda* _
722 ;; Remove tests requiring a network connection
723 (let ((network-tests '("tests/test_upload.py"
724 "tests/test_authorizations.py"
725 "tests/test_login.py"
726 "tests/test_whoami.py"
727 "utils/notebook/tests/test_data_uri.py"
728 "utils/notebook/tests/test_base.py"
729 "utils/notebook/tests/test_downloader.py"
730 "inspect_package/tests/test_conda.py")))
731 (with-directory-excursion "binstar_client"
732 (for-each delete-file network-tests)))
733 #t)))))
734 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
735 (synopsis "Anaconda Cloud command line client library")
736 (description
737 "Anaconda Cloud command line client library provides an interface to
738 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
739 environments.")
740 (license license:bsd-3)))
741
742 (define-public python2-anaconda-client
743 (package-with-python2 python-anaconda-client))
744
745 (define-public python-conda-package-handling
746 (package
747 (name "python-conda-package-handling")
748 (version "1.6.0")
749 (source
750 (origin
751 (method git-fetch)
752 (uri (git-reference
753 (url "https://github.com/conda/conda-package-handling/")
754 (commit version)))
755 (file-name (git-file-name name version))
756 (sha256
757 (base32
758 "0bqbs6a8jbjmbn47n5n1p529cx7pf4vgfnhqca9mflgidfb5i0jf"))))
759 (build-system python-build-system)
760 (arguments
761 `(#:phases
762 (modify-phases %standard-phases
763 (add-after 'unpack 'use-unmodified-libarchive
764 (lambda _
765 (substitute* "setup.py"
766 (("archive_and_deps") "archive"))
767 #t))
768 (replace 'check
769 (lambda* (#:key inputs outputs #:allow-other-keys)
770 (add-installed-pythonpath inputs outputs)
771 (invoke "pytest" "-vv" "tests"
772 "-k"
773 (string-append
774 ;; TODO: these three fail because the mocker fixture
775 ;; cannot be found
776 "not test_rename_to_trash"
777 " and not test_api_extract_tarball_with_libarchive_import_error"
778 " and not test_delete_trash"
779 ;; TODO: this one does not raise an exception when it
780 ;; should.
781 " and not test_secure_refusal_to_extract_abs_paths")))))))
782 (propagated-inputs
783 `(("python-six" ,python-six)
784 ("python-tqdm" ,python-tqdm)))
785 (inputs
786 `(("libarchive" ,libarchive)))
787 (native-inputs
788 `(("python-cython" ,python-cython)
789 ("python-pytest" ,python-pytest)
790 ("python-pytest-cov" ,python-pytest-cov)
791 ("python-mock" ,python-mock)))
792 (home-page "https://conda.io")
793 (synopsis "Create and extract conda packages of various formats")
794 (description
795 "This library is an abstraction of Conda package handling and a tool for
796 extracting, creating, and converting between formats.")
797 (license license:bsd-3)))
798
799 (define-public conda
800 (package
801 (name "conda")
802 (version "4.8.3")
803 (source
804 (origin
805 (method git-fetch)
806 (uri (git-reference
807 (url "https://github.com/conda/conda")
808 (commit version)))
809 (file-name (git-file-name name version))
810 (sha256
811 (base32
812 "0iv1qzk21jsk6vdp3106xvpvl68zgfdqb3kyzpya87jhkl204l7r"))))
813 (build-system python-build-system)
814 (arguments
815 `(#:phases
816 (modify-phases %standard-phases
817 (add-after 'unpack 'fix-permissions
818 (lambda _
819 ;; This file is no longer writable after downloading with
820 ;; 'git-fetch'
821 (make-file-writable
822 "tests/conda_env/support/saved-env/environment.yml")
823 #t))
824 (add-after 'unpack 'correct-python-executable-name
825 (lambda* (#:key inputs #:allow-other-keys)
826 (let ((python (assoc-ref inputs "python-wrapper")))
827 #;
828 (substitute* "conda/common/path.py"
829 (("python_version or ''")
830 "python_version or '3'"))
831 (substitute* "conda/core/initialize.py"
832 (("python_exe = join")
833 (format #f "python_exe = \"~a/bin/python\" #"
834 python))))
835 #t))
836 (add-after 'unpack 'do-not-use-python-root-as-prefix
837 (lambda* (#:key inputs outputs #:allow-other-keys)
838 (let ((out (assoc-ref outputs "out"))
839 (python (assoc-ref inputs "python-wrapper")))
840 (substitute* "tests/core/test_initialize.py"
841 (("\"\"\"\\) % conda_prefix")
842 (format #f "\"\"\") % \"~a\"" python))
843 (("CONDA_PYTHON_EXE \"%s\"' % join\\(conda_prefix")
844 (format #f "CONDA_PYTHON_EXE \"%s\"' % join(\"~a\""
845 python))
846 (("conda_prefix = abspath\\(sys.prefix\\)")
847 (format #f "conda_prefix = abspath(\"~a\")" out)))
848 (substitute* "conda/base/context.py"
849 (("os.chdir\\(sys.prefix\\)")
850 (format #f "os.chdir(\"~a\")" out))
851 (("sys.prefix, '.condarc'")
852 (format #f "\"~a\", '.condarc'" out))
853 (("return abspath\\(sys.prefix\\)")
854 (format #f "return abspath(\"~a\")" out))
855 (("os.path.join\\(sys.prefix, bin_dir, exe\\)")
856 (format #f "\"~a/bin/conda\"" out))
857 (("'CONDA_EXE', sys.executable")
858 (format #f "'CONDA_EXE', \"~a/bin/conda\"" out))))
859 #t))
860 (add-before 'build 'create-version-file
861 (lambda _
862 (with-output-to-file "conda/.version"
863 (lambda () (display ,version)))
864 #t))
865 (replace 'check
866 (lambda _
867 (setenv "HOME" "/tmp")
868 (invoke "py.test" "-vv"
869 "-k"
870 (string-append
871 "not integration"
872 ;; This one reports a newer version of conda than
873 ;; expected.
874 " and not test_auto_update_conda"
875 ;; This fails because the output directory is not a
876 ;; Conda environment.
877 " and not test_list"
878 ;; This fails because we patched the default root
879 ;; prefix.
880 " and not test_default_target_is_root_prefix"
881 ;; TODO: I don't understand what this failure means
882 " and not test_PrefixData_return_value_contract"
883 ;; TODO: same here
884 " and not test_install_1"
885 ;; Not sure if this is really wrong. This fails because
886 ;; /gnu/store/...python-conda-4.8.3/bin/python
887 ;; is not /gnu/store/...python-wrapper-3.8.2/bin/python
888 " and not test_make_entry_point"))))
889 (add-after 'install 'init
890 ;; This writes a whole bunch of shell initialization files to the
891 ;; prefix directory. Many features of conda can only be used after
892 ;; running "conda init".
893 (lambda* (#:key inputs outputs #:allow-other-keys)
894 (add-installed-pythonpath inputs outputs)
895 (setenv "HOME" "/tmp")
896
897 ;; "conda init" insists on using sudo, because it is hell-bent on
898 ;; modifying system files.
899 (mkdir-p "/tmp/fake-sudo")
900 (with-output-to-file "/tmp/fake-sudo/sudo"
901 (lambda () (format #t "#!~/bin/sh~%exec $@" (which "sh"))))
902 (chmod "/tmp/fake-sudo/sudo" #o700)
903 (setenv "PATH" (string-append "/tmp/fake-sudo:"
904 (getenv "PATH")))
905
906 (invoke (string-append (assoc-ref outputs "out")
907 "/bin/conda")
908 "init"))))))
909 (inputs
910 `(("python-wrapper" ,python-wrapper)))
911 (propagated-inputs
912 `(("python-anaconda-client" ,python-anaconda-client)
913 ("python-conda-package-handling" ,python-conda-package-handling)
914 ("python-cytoolz" ,python-cytoolz)
915 ("python-pycosat" ,python-pycosat)
916 ("python-pytest" ,python-pytest)
917 ("python-pyyaml" ,python-pyyaml)
918 ("python-requests" ,python-requests)
919 ("python-responses" ,python-responses)
920 ("python-ruamel.yaml" ,python-ruamel.yaml)
921 ("python-tqdm" ,python-tqdm)
922 ;; XXX: This is dragged in by libarchive and is needed at runtime.
923 ("zstd" ,zstd)))
924 (home-page "https://github.com/conda/conda")
925 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
926 (description
927 "Conda is a cross-platform, Python-agnostic binary package manager. It
928 is the package manager used by Anaconda installations, but it may be used for
929 other systems as well. Conda makes environments first-class citizens, making
930 it easy to create independent environments even for C libraries. Conda is
931 written entirely in Python.")
932 (license license:bsd-3)))
933
934 (define-public python-conda
935 (deprecated-package "python-conda" conda))
936
937 (define-public gwl
938 (package
939 (name "gwl")
940 (version "0.2.1")
941 (source (origin
942 (method url-fetch)
943 (uri (string-append "mirror://gnu/gwl/gwl-" version ".tar.gz"))
944 (sha256
945 (base32
946 "1ji5jvzni8aml9fmimlr11g3k8isrnlvnbzhmwgdjh72hils0alc"))))
947 (build-system gnu-build-system)
948 (arguments
949 `(#:phases
950 (modify-phases %standard-phases
951 (add-before 'build 'fix-tests
952 (lambda _
953 ;; Avoid cross-device link.
954 (substitute* "tests/cache.scm"
955 (("/tmp/gwl-test-input-XXXXXX")
956 (string-append (getcwd) "/gwl-test-input-XXXXXX")))
957 #t)))))
958 (native-inputs
959 `(("autoconf" ,autoconf)
960 ("automake" ,automake)
961 ("pkg-config" ,pkg-config)
962 ("texinfo" ,texinfo)
963 ("graphviz" ,graphviz)))
964 (inputs
965 `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
966 (propagated-inputs
967 `(("guix" ,guix)
968 ("guile-commonmark" ,guile-commonmark)
969 ("guile-gcrypt" ,guile-gcrypt)
970 ("guile-pfds" ,guile-pfds)
971 ("guile-syntax-highlight" ,guile-syntax-highlight)
972 ("guile-wisp" ,guile-wisp)))
973 (home-page "https://workflows.guix.info")
974 (synopsis "Workflow management extension for GNU Guix")
975 (description "The @dfn{Guix Workflow Language} (GWL) provides an
976 extension to GNU Guix's declarative language for package management to
977 automate the execution of programs in scientific workflows. The GWL
978 can use process engines to integrate with various computing
979 environments.")
980 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
981 ;; the web interface modules in gwl/ are licensed AGPL3+,
982 ;; and the fonts included in this package are licensed OFL1.1.
983 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
984
985 (define-public guix-jupyter
986 (package
987 (name "guix-jupyter")
988 (version "0.1.0")
989 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
990 (source (origin
991 (method git-fetch)
992 (uri (git-reference (url home-page)
993 (commit (string-append "v" version))))
994 (sha256
995 (base32
996 "01z7jjkc7r7lj6637rcgpz40v8xqqyfp6871h94yvcnwm7zy9h1n"))
997 (modules '((guix build utils)))
998 (snippet
999 '(begin
1000 ;; Allow builds with Guile 3.0.
1001 (substitute* "configure.ac"
1002 (("^GUILE_PKG.*")
1003 "GUILE_PKG([3.0 2.2])\n"))
1004 #t))
1005 (file-name (string-append "guix-jupyter-" version "-checkout"))))
1006 (build-system gnu-build-system)
1007 (arguments
1008 `(#:modules ((srfi srfi-26)
1009 (ice-9 match)
1010 (ice-9 popen)
1011 (ice-9 rdelim)
1012 (guix build utils)
1013 (guix build gnu-build-system))
1014 #:phases
1015 (modify-phases %standard-phases
1016 (add-after 'install 'sed-kernel-json
1017 (lambda* (#:key inputs outputs #:allow-other-keys)
1018 (let* ((out (assoc-ref outputs "out"))
1019 (guix (assoc-ref inputs "guix"))
1020 (guile (assoc-ref inputs "guile"))
1021 (json (assoc-ref inputs "guile-json"))
1022 (git (assoc-ref inputs "guile-git"))
1023 (bs (assoc-ref inputs "guile-bytestructures"))
1024 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
1025 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1026 (deps (list out s-zmq guix json git bs gcrypt))
1027 (effective
1028 (read-line
1029 (open-pipe* OPEN_READ
1030 (string-append guile "/bin/guile")
1031 "-c" "(display (effective-version))")))
1032 (path (map (cut string-append "-L\", \"" <>
1033 "/share/guile/site/"
1034 effective)
1035 deps))
1036 (gopath (map (cut string-append "-C\", \"" <>
1037 "/lib/guile/" effective
1038 "/site-ccache")
1039 deps))
1040 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
1041 (substitute* (string-append kernel-dir "kernel.json")
1042 (("-s")
1043 (string-join
1044 (list (string-join path "\",\n\t\t\"")
1045 (string-join gopath "\",\n\t\t\"")
1046 "-s")
1047 "\",\n\t\t\""))
1048 (("guix-jupyter-kernel.scm")
1049 (string-append out "/share/guile/site/3.0/"
1050 "guix-jupyter-kernel.scm")))
1051 #t))))))
1052 (native-inputs
1053 `(("autoconf" ,autoconf)
1054 ("automake" ,automake)
1055 ("pkg-config" ,pkg-config)
1056
1057 ;; For testing.
1058 ("jupyter" ,jupyter)
1059 ("python-ipython" ,python-ipython)
1060 ("python-ipykernel" ,python-ipykernel)))
1061 (inputs
1062 `(("guix" ,guix)
1063 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1064 (propagated-inputs
1065 `(("guile-json" ,guile-json-4)
1066 ("guile-simple-zmq" ,guile-simple-zmq)
1067 ("guile-gcrypt" ,guile-gcrypt)))
1068 (synopsis "Guix kernel for Jupyter")
1069 (description
1070 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
1071 with information about their software dependencies, such that code is executed
1072 in the right software environment. Guix-Jupyter spawns the actual kernels
1073 such as @code{python-ipykernel} on behalf of the notebook user and runs them
1074 in an isolated environment, in separate namespaces.")
1075 (license license:gpl3+)))
1076
1077 (define-public gcab
1078 (package
1079 (name "gcab")
1080 (version "1.2")
1081 (source (origin
1082 (method url-fetch)
1083 (uri (string-append "mirror://gnome/sources/gcab/"
1084 version "/gcab-" version ".tar.xz"))
1085 (sha256
1086 (base32
1087 "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas"))))
1088 (build-system meson-build-system)
1089 (native-inputs
1090 `(("glib:bin" ,glib "bin") ; for glib-mkenums
1091 ("intltool" ,intltool)
1092 ("pkg-config" ,pkg-config)
1093 ("vala" ,vala)))
1094 (inputs
1095 `(("glib" ,glib)
1096 ("zlib" ,zlib)))
1097 (arguments
1098 `(#:configure-flags
1099 ;; XXX This ‘documentation’ is for developers, and fails informatively:
1100 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
1101 (list "-Ddocs=false"
1102 "-Dintrospection=false")))
1103 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
1104 (synopsis "Microsoft Cabinet file manipulation library")
1105 (description
1106 "The libgcab library provides GObject functions to read, write, and modify
1107 Microsoft cabinet (.@dfn{CAB}) files.")
1108 (license (list license:gpl2+ ; tests/testsuite.at
1109 license:lgpl2.1+)))) ; the rest
1110
1111 (define-public msitools
1112 (package
1113 (name "msitools")
1114 (version "0.100")
1115 (source (origin
1116 (method url-fetch)
1117 (uri (string-append "mirror://gnome/sources/msitools/"
1118 version "/msitools-" version ".tar.xz"))
1119 (sha256
1120 (base32
1121 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
1122 (build-system gnu-build-system)
1123 (native-inputs
1124 `(("bison" ,bison)
1125 ("pkg-config" ,pkg-config)))
1126 (inputs
1127 `(("gcab" ,gcab)
1128 ("glib" ,glib)
1129 ("libgsf" ,libgsf)
1130 ("libxml2" ,libxml2)
1131 ("uuid" ,util-linux "lib")))
1132 (home-page "https://wiki.gnome.org/msitools")
1133 (synopsis "Windows Installer file manipulation tool")
1134 (description
1135 "msitools is a collection of command-line tools to inspect, extract, build,
1136 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
1137 for packaging and deployment of cross-compiled Windows applications.")
1138 (license license:lgpl2.1+)))
1139
1140 (define-public libostree
1141 (package
1142 (name "libostree")
1143 (version "2020.5")
1144 (source (origin
1145 (method url-fetch)
1146 (uri (string-append
1147 "https://github.com/ostreedev/ostree/releases/download/v"
1148 (version-major+minor version) "/libostree-" version ".tar.xz"))
1149 (sha256
1150 (base32
1151 "1k92177hjalbdpmg45ymwwrni68vh9rs5x9zvy5fzl9lng12fgpb"))))
1152 (build-system gnu-build-system)
1153 (arguments
1154 '(#:phases
1155 (modify-phases %standard-phases
1156 (add-before 'check 'pre-check
1157 (lambda _
1158 ;; Don't try to use the non-existing '/var/tmp' as test
1159 ;; directory.
1160 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
1161 #t)))
1162 ;; XXX: fails with:
1163 ;; tap-driver.sh: missing test plan
1164 ;; tap-driver.sh: internal error getting exit status
1165 ;; tap-driver.sh: fatal: I/O or internal error
1166 #:tests? #f))
1167 (native-inputs
1168 `(("attr" ,attr) ; for tests
1169 ("bison" ,bison)
1170 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
1171 ("gobject-introspection" ,gobject-introspection)
1172 ("pkg-config" ,pkg-config)
1173 ("xsltproc" ,libxslt)))
1174 (inputs
1175 `(("avahi" ,avahi)
1176 ("docbook-xml" ,docbook-xml-4.2)
1177 ("docbook-xsl" ,docbook-xsl)
1178 ("e2fsprogs" ,e2fsprogs)
1179 ("fuse" ,fuse)
1180 ("glib" ,glib)
1181 ("gpgme" ,gpgme)
1182 ("libarchive" ,libarchive)
1183 ("libsoup" ,libsoup)
1184 ("util-linux" ,util-linux)))
1185 (home-page "https://ostree.readthedocs.io/en/latest/")
1186 (synopsis "Operating system and container binary deployment and upgrades")
1187 (description
1188 "@code{libostree} is both a shared library and suite of command line
1189 tools that combines a \"git-like\" model for committing and downloading
1190 bootable file system trees, along with a layer for deploying them and managing
1191 the boot loader configuration.")
1192 (license license:lgpl2.0+)))
1193
1194 (define-public flatpak
1195 (package
1196 (name "flatpak")
1197 (version "1.8.2")
1198 (source
1199 (origin
1200 (method url-fetch)
1201 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
1202 version "/flatpak-" version ".tar.xz"))
1203 (sha256
1204 (base32 "1c45a0k7wx685n5b3ihv7dk0mm2kmwbw7cx8w5g2la62yxfn49kr"))))
1205
1206 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1207 ;; find the TLS backend in glib-networking.
1208 (build-system glib-or-gtk-build-system)
1209
1210 (arguments
1211 '(#:configure-flags
1212 (list
1213 "--enable-documentation=no" ;; FIXME
1214 "--enable-system-helper=no"
1215 "--localstatedir=/var"
1216 (string-append "--with-system-bubblewrap="
1217 (assoc-ref %build-inputs "bubblewrap")
1218 "/bin/bwrap")
1219 (string-append "--with-system-dbus-proxy="
1220 (assoc-ref %build-inputs "xdg-dbus-proxy")
1221 "/bin/xdg-dbus-proxy"))
1222 #:phases
1223 (modify-phases %standard-phases
1224 (add-after 'unpack 'fix-tests
1225 (lambda* (#:key inputs #:allow-other-keys)
1226 (copy-recursively
1227 (string-append (assoc-ref inputs "glibc-utf8-locales")
1228 "/lib/locale/") "/tmp/locale")
1229 (for-each make-file-writable (find-files "/tmp"))
1230 (substitute* "tests/make-test-runtime.sh"
1231 (("cp `which.*") "echo guix\n")
1232 (("cp -r /usr/lib/locale/C\\.\\*")
1233 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
1234 cp -r /tmp/locale/*/en_US.*")))
1235 (substitute* "tests/libtest.sh"
1236 (("/bin/kill") (which "kill"))
1237 (("/usr/bin/python3") (which "python3")))
1238 #t))
1239 ;; Many tests fail for unknown reasons, so we just run a few basic
1240 ;; tests.
1241 (replace 'check
1242 (lambda _
1243 (setenv "HOME" "/tmp")
1244 (invoke "make" "check"
1245 "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
1246 (native-inputs
1247 `(("bison" ,bison)
1248 ("dbus" ,dbus) ; for dbus-daemon
1249 ("gettext" ,gettext-minimal)
1250 ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
1251 ("glibc-utf8-locales" ,glibc-utf8-locales)
1252 ("gobject-introspection" ,gobject-introspection)
1253 ("libcap" ,libcap)
1254 ("pkg-config" ,pkg-config)
1255 ("python" ,python)
1256 ("python-pyparsing" ,python-pyparsing)
1257 ("socat" ,socat)
1258 ("which" ,which)))
1259 (propagated-inputs `(("glib-networking" ,glib-networking)
1260 ("gnupg" ,gnupg)
1261 ("gsettings-desktop-schemas"
1262 ,gsettings-desktop-schemas)))
1263 (inputs
1264 `(("appstream-glib" ,appstream-glib)
1265 ("bubblewrap" ,bubblewrap)
1266 ("dconf" ,dconf)
1267 ("fuse" ,fuse)
1268 ("gdk-pixbuf" ,gdk-pixbuf)
1269 ("gpgme" ,gpgme)
1270 ("json-glib" ,json-glib)
1271 ("libarchive" ,libarchive)
1272 ("libostree" ,libostree)
1273 ("libseccomp" ,libseccomp)
1274 ("libsoup" ,libsoup)
1275 ("libxau" ,libxau)
1276 ("libxml2" ,libxml2)
1277 ("util-linux" ,util-linux)
1278 ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
1279 (home-page "https://flatpak.org")
1280 (synopsis "System for building, distributing, and running sandboxed desktop
1281 applications")
1282 (description "Flatpak is a system for building, distributing, and running
1283 sandboxed desktop applications on GNU/Linux.")
1284 (license license:lgpl2.1+)))
1285
1286 (define-public akku
1287 (package
1288 (name "akku")
1289 (version "1.0.1")
1290 (source (origin
1291 (method git-fetch)
1292 (uri (git-reference
1293 (url "https://gitlab.com/akkuscm/akku.git")
1294 (commit (string-append "v" version))))
1295 (file-name (git-file-name name version))
1296 (sha256 (base32 "1dm32ws3nshnnscd7k75zswxxs1pp25y2q4k8j5ms241hz47by3c"))))
1297 (build-system gnu-build-system)
1298 (arguments
1299 '(#:phases (modify-phases %standard-phases
1300 (replace 'bootstrap
1301 (lambda* (#:key outputs #:allow-other-keys)
1302 (for-each patch-shebang
1303 '("bootstrap"
1304 ".akku/env"))
1305 (let* ((home "/tmp")
1306 (datadir (string-append home "/.local/share/akku/")))
1307 (mkdir-p datadir)
1308 (invoke "touch" (string-append datadir "index.db"))
1309 (setenv "HOME" home))
1310 (invoke "./bootstrap")
1311 #t))
1312 (add-after 'install 'wrap-executables
1313 (lambda* (#:key outputs inputs #:allow-other-keys)
1314 (let ((out (assoc-ref outputs "out"))
1315 (curl (assoc-ref inputs "curl")))
1316 (wrap-program (string-append out "/bin/akku")
1317 `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
1318 #t))))))
1319 (native-inputs
1320 `(("which" ,which)
1321 ("autoconf" ,autoconf)
1322 ("automake" ,automake)
1323 ("pkg-config" ,pkg-config)))
1324 (inputs
1325 `(("guile" ,guile-3.0)
1326 ("curl" ,curl)))
1327 (home-page "https://akkuscm.org/")
1328 (synopsis "Language package manager for Scheme")
1329 (description
1330 "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
1331 It is mainly meant for programmers who develop portable programs or libraries in Scheme,
1332 but could potentially work for end-users of those programs. It also has a translator
1333 from R7RS, which allows most R7RS code to run on R6RS implementations.")
1334 (license license:gpl3+)))