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