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