gnu: guix: Fix openrc init scripts.
[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 "6e7ba45357078b31a369b23f8a9f38302dfcbb10")
136 (revision 18))
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 "14zzhjdd7igkc8vpv06hn375085n10mljv8wwpnk6r4a6r8qg5d3"))
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 "6e7e63f356cb88e3e5fe1a55a0390a1366205c9c")
1053 (revision "21"))
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 "01l4f0h9r864dbq4fg38fr2pdm5c7q2dysxcv8bx1clxilm58kd5"))
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 `("guile-json"
1092 "guile-gcrypt"
1093 "guix"
1094 "guile-prometheus"
1095 "guile-lib"
1096 "guile-lzlib"
1097 "guile-zlib"
1098 "gnutls")))
1099 (wrap-program file
1100 `("PATH" ":" prefix
1101 (,bin
1102 ;; Support building without sqitch as an input, as it
1103 ;; can't be cross-compiled yet
1104 ,@(or (and=> (assoc-ref inputs "sqitch")
1105 list)
1106 '())))
1107 `("GUILE_LOAD_PATH" ":" prefix
1108 (,scm ,(string-join
1109 (map (lambda (input)
1110 (simple-format
1111 #f "~A/share/guile/site/~A"
1112 (assoc-ref inputs input)
1113 version))
1114 guile-inputs)
1115 ":")))
1116 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1117 (,go ,(string-join
1118 (map (lambda (input)
1119 (simple-format
1120 #f "~A/lib/guile/~A/site-ccache"
1121 (assoc-ref inputs input)
1122 version))
1123 guile-inputs)
1124 ":"))))
1125 (when target
1126 ;; XXX work around wrap-program picking bash for the
1127 ;; host rather than target
1128 (let ((bash (assoc-ref inputs "bash")))
1129 (substitute* file
1130 (("^#!.*/bash")
1131 (string-append "#! " bash "/bin/bash")))))))
1132 (find-files bin)))
1133 #t))
1134 (delete 'strip)))) ; As the .go files aren't compatible
1135 (native-inputs
1136 `(("pkg-config" ,pkg-config)
1137 ("autoconf" ,autoconf)
1138 ("automake" ,automake)
1139 ("gnutls" ,gnutls)
1140
1141 ;; Guile libraries are needed here for cross-compilation.
1142 ("guile-json" ,guile-json-4)
1143 ("guile-gcrypt" ,guile-gcrypt)
1144 ("guix" ,guix)
1145 ("guile-prometheus" ,guile-prometheus)
1146 ("guile-fibers" ,guile-fibers)
1147 ("guile-lib" ,guile-lib)
1148 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1149 (inputs
1150 `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))
1151 ,@(if (%current-target-system)
1152 `(("bash" ,bash-minimal))
1153 '())
1154 ("sqlite" ,sqlite)
1155 ,@(if (hurd-target?)
1156 '()
1157 `(("sqitch" ,sqitch)))))
1158 (propagated-inputs
1159 `(,@(if (hurd-target?)
1160 '()
1161 `(("guile-fibers" ,guile-fibers)))
1162 ("guile-prometheus" ,guile-prometheus)
1163 ("guile-gcrypt" ,guile-gcrypt)
1164 ("guile-json" ,guile-json-4)
1165 ("guile-lib" ,guile-lib)
1166 ("guile-lzlib" ,guile-lzlib)
1167 ("guile-zlib" ,guile-zlib)
1168 ("guile-sqlite3" ,guile-sqlite3)
1169 ("guix" ,guix)
1170 ("gnutls" ,gnutls)))
1171 (home-page "https://git.cbaines.net/guix/build-coordinator/")
1172 (synopsis "Tool to help build derivations")
1173 (description
1174 "The Guix Build Coordinator helps with performing lots of builds across
1175 potentially many machines, and with doing something with the results and
1176 outputs of those builds.")
1177 (license license:gpl3+))))
1178
1179 (define-public guix-jupyter
1180 (package
1181 (name "guix-jupyter")
1182 (version "0.2.1")
1183 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
1184 (source (origin
1185 (method git-fetch)
1186 (uri (git-reference (url home-page)
1187 (commit (string-append "v" version))))
1188 (sha256
1189 (base32
1190 "1kqwfp5h95s6mirq5nbydsbmlhsinn32grz1ld5mbxvhl6sn2i0j"))
1191 (file-name (string-append "guix-jupyter-" version "-checkout"))))
1192 (build-system gnu-build-system)
1193 (arguments
1194 `(#:modules ((srfi srfi-26)
1195 (ice-9 match)
1196 (ice-9 popen)
1197 (ice-9 rdelim)
1198 (guix build utils)
1199 (guix build gnu-build-system))
1200 #:phases
1201 (modify-phases %standard-phases
1202 (add-after 'install 'sed-kernel-json
1203 (lambda* (#:key inputs outputs #:allow-other-keys)
1204 (let* ((out (assoc-ref outputs "out"))
1205 (guix (assoc-ref inputs "guix"))
1206 (guile (assoc-ref inputs "guile"))
1207 (json (assoc-ref inputs "guile-json"))
1208 (git (assoc-ref inputs "guile-git"))
1209 (bs (assoc-ref inputs "guile-bytestructures"))
1210 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
1211 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1212 (deps (list out s-zmq guix json git bs gcrypt))
1213 (effective
1214 (read-line
1215 (open-pipe* OPEN_READ
1216 (string-append guile "/bin/guile")
1217 "-c" "(display (effective-version))")))
1218 (path (map (cut string-append "-L\", \"" <>
1219 "/share/guile/site/"
1220 effective)
1221 deps))
1222 (gopath (map (cut string-append "-C\", \"" <>
1223 "/lib/guile/" effective
1224 "/site-ccache")
1225 deps))
1226 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
1227 (substitute* (string-append kernel-dir "kernel.json")
1228 (("-s")
1229 (string-join
1230 (list (string-join path "\",\n\t\t\"")
1231 (string-join gopath "\",\n\t\t\"")
1232 "-s")
1233 "\",\n\t\t\""))
1234 (("guix-jupyter-kernel.scm")
1235 (string-append out "/share/guile/site/3.0/"
1236 "guix-jupyter-kernel.scm")))
1237 #t))))))
1238 (native-inputs
1239 `(("autoconf" ,autoconf)
1240 ("automake" ,automake)
1241 ("pkg-config" ,pkg-config)
1242
1243 ;; For testing.
1244 ("jupyter" ,jupyter)
1245 ("python-ipython" ,python-ipython)
1246 ("python-ipykernel" ,python-ipykernel)))
1247 (inputs
1248 `(("guix" ,guix)
1249 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1250 (propagated-inputs
1251 `(("guile-json" ,guile-json-4)
1252 ("guile-simple-zmq" ,guile-simple-zmq)
1253 ("guile-gcrypt" ,guile-gcrypt)))
1254 (synopsis "Guix kernel for Jupyter")
1255 (description
1256 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
1257 with information about their software dependencies, such that code is executed
1258 in the right software environment. Guix-Jupyter spawns the actual kernels
1259 such as @code{python-ipykernel} on behalf of the notebook user and runs them
1260 in an isolated environment, in separate namespaces.")
1261 (license license:gpl3+)))
1262
1263 (define-public gcab
1264 (package
1265 (name "gcab")
1266 (version "1.4")
1267 (source (origin
1268 (method url-fetch)
1269 (uri (string-append "mirror://gnome/sources/gcab/"
1270 version "/gcab-" version ".tar.xz"))
1271 (sha256
1272 (base32
1273 "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7"))))
1274 (build-system meson-build-system)
1275 (native-inputs
1276 `(("glib:bin" ,glib "bin") ; for glib-mkenums
1277 ("intltool" ,intltool)
1278 ("pkg-config" ,pkg-config)
1279 ("vala" ,vala)))
1280 (inputs
1281 `(("glib" ,glib)
1282 ("zlib" ,zlib)))
1283 (arguments
1284 `(#:configure-flags
1285 ;; XXX This ‘documentation’ is for developers, and fails informatively:
1286 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
1287 (list "-Ddocs=false"
1288 "-Dintrospection=false")))
1289 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
1290 (synopsis "Microsoft Cabinet file manipulation library")
1291 (description
1292 "The libgcab library provides GObject functions to read, write, and modify
1293 Microsoft cabinet (.@dfn{CAB}) files.")
1294 (license (list license:gpl2+ ; tests/testsuite.at
1295 license:lgpl2.1+)))) ; the rest
1296
1297 (define-public msitools
1298 (package
1299 (name "msitools")
1300 (version "0.100")
1301 (source (origin
1302 (method url-fetch)
1303 (uri (string-append "mirror://gnome/sources/msitools/"
1304 version "/msitools-" version ".tar.xz"))
1305 (sha256
1306 (base32
1307 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
1308 (build-system gnu-build-system)
1309 (native-inputs
1310 `(("bison" ,bison)
1311 ("pkg-config" ,pkg-config)))
1312 (inputs
1313 `(("gcab" ,gcab)
1314 ("glib" ,glib)
1315 ("libgsf" ,libgsf)
1316 ("libxml2" ,libxml2)
1317 ("uuid" ,util-linux "lib")))
1318 (home-page "https://wiki.gnome.org/msitools")
1319 (synopsis "Windows Installer file manipulation tool")
1320 (description
1321 "msitools is a collection of command-line tools to inspect, extract, build,
1322 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
1323 for packaging and deployment of cross-compiled Windows applications.")
1324 (license license:lgpl2.1+)))
1325
1326 (define-public libostree
1327 (package
1328 (name "libostree")
1329 (version "2020.8")
1330 (source
1331 (origin
1332 (method url-fetch)
1333 (uri (string-append
1334 "https://github.com/ostreedev/ostree/releases/download/v"
1335 (version-major+minor version) "/libostree-" version ".tar.xz"))
1336 (sha256
1337 (base32 "16v73v63h16ika73kgh2cvgm0v27r2d48m932mbj3xm6s295kapx"))))
1338 (build-system gnu-build-system)
1339 (arguments
1340 '(#:phases
1341 (modify-phases %standard-phases
1342 (add-before 'check 'pre-check
1343 (lambda _
1344 ;; Don't try to use the non-existing '/var/tmp' as test
1345 ;; directory.
1346 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
1347 #t)))
1348 ;; XXX: fails with:
1349 ;; tap-driver.sh: missing test plan
1350 ;; tap-driver.sh: internal error getting exit status
1351 ;; tap-driver.sh: fatal: I/O or internal error
1352 #:tests? #f))
1353 (native-inputs
1354 `(("attr" ,attr) ; for tests
1355 ("bison" ,bison)
1356 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
1357 ("gobject-introspection" ,gobject-introspection)
1358 ("pkg-config" ,pkg-config)
1359 ("xsltproc" ,libxslt)))
1360 (inputs
1361 `(("avahi" ,avahi)
1362 ("docbook-xml" ,docbook-xml-4.2)
1363 ("docbook-xsl" ,docbook-xsl)
1364 ("e2fsprogs" ,e2fsprogs)
1365 ("fuse" ,fuse)
1366 ("glib" ,glib)
1367 ("gpgme" ,gpgme)
1368 ("libarchive" ,libarchive)
1369 ("libsoup" ,libsoup)
1370 ("util-linux" ,util-linux)))
1371 (home-page "https://ostree.readthedocs.io/en/latest/")
1372 (synopsis "Operating system and container binary deployment and upgrades")
1373 (description
1374 "@code{libostree} is both a shared library and suite of command line
1375 tools that combines a \"git-like\" model for committing and downloading
1376 bootable file system trees, along with a layer for deploying them and managing
1377 the boot loader configuration.")
1378 (license license:lgpl2.0+)))
1379
1380 (define-public flatpak
1381 (package
1382 (name "flatpak")
1383 (version "1.10.2")
1384 (source
1385 (origin
1386 (method url-fetch)
1387 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
1388 version "/flatpak-" version ".tar.xz"))
1389 (sha256
1390 (base32 "1r6xw7r3ir2vaa30n3mily6m7d51cf4qv22fkqlzzy3js0wjf5fv"))))
1391
1392 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1393 ;; find the TLS backend in glib-networking.
1394 (build-system glib-or-gtk-build-system)
1395
1396 (arguments
1397 '(#:configure-flags
1398 (list
1399 "--enable-documentation=no" ;; FIXME
1400 "--enable-system-helper=no"
1401 "--localstatedir=/var"
1402 (string-append "--with-system-bubblewrap="
1403 (assoc-ref %build-inputs "bubblewrap")
1404 "/bin/bwrap")
1405 (string-append "--with-system-dbus-proxy="
1406 (assoc-ref %build-inputs "xdg-dbus-proxy")
1407 "/bin/xdg-dbus-proxy"))
1408 #:phases
1409 (modify-phases %standard-phases
1410 (add-after 'unpack 'fix-tests
1411 (lambda* (#:key inputs #:allow-other-keys)
1412 (copy-recursively
1413 (string-append (assoc-ref inputs "glibc-utf8-locales")
1414 "/lib/locale/") "/tmp/locale")
1415 (for-each make-file-writable (find-files "/tmp"))
1416 (substitute* "tests/make-test-runtime.sh"
1417 (("cp `which.*") "echo guix\n")
1418 (("cp -r /usr/lib/locale/C\\.\\*")
1419 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
1420 cp -r /tmp/locale/*/en_US.*")))
1421 (substitute* "tests/libtest.sh"
1422 (("/bin/kill") (which "kill"))
1423 (("/usr/bin/python3") (which "python3")))
1424 #t))
1425 ;; Many tests fail for unknown reasons, so we just run a few basic
1426 ;; tests.
1427 (replace 'check
1428 (lambda _
1429 (setenv "HOME" "/tmp")
1430 (invoke "make" "check"
1431 "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
1432 (native-inputs
1433 `(("bison" ,bison)
1434 ("dbus" ,dbus) ; for dbus-daemon
1435 ("gettext" ,gettext-minimal)
1436 ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
1437 ("glibc-utf8-locales" ,glibc-utf8-locales)
1438 ("gobject-introspection" ,gobject-introspection)
1439 ("libcap" ,libcap)
1440 ("pkg-config" ,pkg-config)
1441 ("python" ,python)
1442 ("python-pyparsing" ,python-pyparsing)
1443 ("socat" ,socat)
1444 ("which" ,which)))
1445 (propagated-inputs `(("glib-networking" ,glib-networking)
1446 ("gnupg" ,gnupg)
1447 ("gsettings-desktop-schemas"
1448 ,gsettings-desktop-schemas)))
1449 (inputs
1450 `(("appstream-glib" ,appstream-glib)
1451 ("bubblewrap" ,bubblewrap)
1452 ("dconf" ,dconf)
1453 ("fuse" ,fuse)
1454 ("gdk-pixbuf" ,gdk-pixbuf)
1455 ("gpgme" ,gpgme)
1456 ("json-glib" ,json-glib)
1457 ("libarchive" ,libarchive)
1458 ("libostree" ,libostree)
1459 ("libseccomp" ,libseccomp)
1460 ("libsoup" ,libsoup)
1461 ("libxau" ,libxau)
1462 ("libxml2" ,libxml2)
1463 ("util-linux" ,util-linux)
1464 ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
1465 (home-page "https://flatpak.org")
1466 (synopsis "System for building, distributing, and running sandboxed desktop
1467 applications")
1468 (description "Flatpak is a system for building, distributing, and running
1469 sandboxed desktop applications on GNU/Linux.")
1470 (license license:lgpl2.1+)))
1471
1472 (define-public akku
1473 (package
1474 (name "akku")
1475 (version "1.0.1")
1476 (source (origin
1477 (method git-fetch)
1478 (uri (git-reference
1479 (url "https://gitlab.com/akkuscm/akku.git")
1480 (commit (string-append "v" version))))
1481 (file-name (git-file-name name version))
1482 (sha256 (base32 "1dm32ws3nshnnscd7k75zswxxs1pp25y2q4k8j5ms241hz47by3c"))))
1483 (build-system gnu-build-system)
1484 (arguments
1485 '(#:phases (modify-phases %standard-phases
1486 (replace 'bootstrap
1487 (lambda* (#:key outputs #:allow-other-keys)
1488 (for-each patch-shebang
1489 '("bootstrap"
1490 ".akku/env"))
1491 (let* ((home "/tmp")
1492 (datadir (string-append home "/.local/share/akku/")))
1493 (mkdir-p datadir)
1494 (invoke "touch" (string-append datadir "index.db"))
1495 (setenv "HOME" home))
1496 (invoke "./bootstrap")
1497 #t))
1498 (add-after 'install 'wrap-executables
1499 (lambda* (#:key outputs inputs #:allow-other-keys)
1500 (let ((out (assoc-ref outputs "out"))
1501 (curl (assoc-ref inputs "curl")))
1502 (wrap-program (string-append out "/bin/akku")
1503 `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
1504 #t))))))
1505 (native-inputs
1506 `(("which" ,which)
1507 ("autoconf" ,autoconf)
1508 ("automake" ,automake)
1509 ("pkg-config" ,pkg-config)))
1510 (inputs
1511 `(("guile" ,guile-3.0)
1512 ("curl" ,curl)))
1513 (home-page "https://akkuscm.org/")
1514 (synopsis "Language package manager for Scheme")
1515 (description
1516 "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
1517 It is mainly meant for programmers who develop portable programs or libraries in Scheme,
1518 but could potentially work for end-users of those programs. It also has a translator
1519 from R7RS, which allows most R7RS code to run on R6RS implementations.")
1520 (license license:gpl3+)))