gnu: guix: Update to 682639c.
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015, 2017, 2020, 2021, 2022 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–2022 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, 2022 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 ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
21 ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
22 ;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
23 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
24 ;;;
25 ;;; This file is part of GNU Guix.
26 ;;;
27 ;;; GNU Guix is free software; you can redistribute it and/or modify it
28 ;;; under the terms of the GNU General Public License as published by
29 ;;; the Free Software Foundation; either version 3 of the License, or (at
30 ;;; your option) any later version.
31 ;;;
32 ;;; GNU Guix is distributed in the hope that it will be useful, but
33 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 ;;; GNU General Public License for more details.
36 ;;;
37 ;;; You should have received a copy of the GNU General Public License
38 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39
40 (define-module (gnu packages package-management)
41 #:use-module (gnu artwork)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages acl)
44 #:use-module (gnu packages attr)
45 #:use-module (gnu packages avahi)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages backup)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bash)
50 #:use-module (gnu packages bdw-gc)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages boost)
53 #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
54 #:use-module (gnu packages build-tools)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages cmake)
58 #:use-module (gnu packages cpio)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages dejagnu)
63 #:use-module (gnu packages dbm)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages file)
66 #:use-module (gnu packages freedesktop)
67 #:use-module (gnu packages flex)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gnupg)
73 #:use-module (gnu packages graphviz)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages guile)
76 #:use-module (gnu packages guile-xyz)
77 #:use-module (gnu packages hardware)
78 #:use-module (gnu packages hurd)
79 #:use-module (gnu packages imagemagick)
80 #:use-module (gnu packages less)
81 #:use-module (gnu packages libedit)
82 #:use-module (gnu packages linux)
83 #:use-module (gnu packages lisp)
84 #:use-module (gnu packages lua)
85 #:use-module (gnu packages man)
86 #:use-module (gnu packages markup)
87 #:use-module (gnu packages nettle)
88 #:use-module (gnu packages networking)
89 #:use-module (gnu packages ninja)
90 #:use-module (gnu packages nss)
91 #:use-module (gnu packages patchutils)
92 #:use-module (gnu packages perl)
93 #:use-module (gnu packages perl-check)
94 #:use-module (gnu packages pkg-config)
95 #:use-module (gnu packages popt)
96 #:use-module (gnu packages python)
97 #:use-module (gnu packages python-build)
98 #:use-module (gnu packages python-check)
99 #:use-module (gnu packages python-web)
100 #:use-module (gnu packages python-xyz)
101 #:use-module (gnu packages serialization)
102 #:use-module (gnu packages sqlite)
103 #:use-module (gnu packages ssh)
104 #:use-module (gnu packages tcl)
105 #:use-module (gnu packages texinfo)
106 #:use-module (gnu packages time)
107 #:use-module (gnu packages tls)
108 #:use-module (gnu packages vim)
109 #:use-module (gnu packages virtualization)
110 #:use-module (gnu packages web)
111 #:use-module (gnu packages xml)
112 #:use-module (gnu packages xorg)
113 #:use-module (gnu packages version-control)
114 #:autoload (guix build-system channel) (channel-build-system)
115 #:use-module (guix build-system glib-or-gtk)
116 #:use-module (guix build-system gnu)
117 #:use-module (guix build-system guile)
118 #:use-module (guix build-system meson)
119 #:use-module (guix build-system python)
120 #:use-module (guix build-system trivial)
121 #:use-module (guix download)
122 #:use-module (guix gexp)
123 #:use-module (guix git-download)
124 #:autoload (guix describe) (current-channels)
125 #:autoload (guix channels) (channel?
126 guix-channel?
127 repository->guix-channel)
128 #:use-module ((guix licenses) #:prefix license:)
129 #:use-module (guix packages)
130 #:use-module (guix utils)
131 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
132 #:use-module (ice-9 match)
133 #:use-module (srfi srfi-1))
134
135 (define (boot-guile-uri arch)
136 "Return the URI for the bootstrap Guile tarball for ARCH."
137 (cond ((string=? "armhf" arch)
138 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
139 arch "-linux"
140 "/20150101/guile-2.0.11.tar.xz"))
141 ((string=? "aarch64" arch)
142 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
143 arch "-linux/20170217/guile-2.0.14.tar.xz"))
144 (else
145 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
146 arch "-linux"
147 "/20131110/guile-2.0.9.tar.xz"))))
148
149 ;; NOTE: The commit IDs used here form a linked list threaded through the git
150 ;; history. In a phenomenon known as boot-stripping, not only the head of this
151 ;; list is used, but also a few older versions, when a guix from this package is
152 ;; used to build something also depending on guix.
153 ;;
154 ;; Therefore, if, by accident, you set this package to a non-existent commit ID,
155 ;; it is insufficient to simply correct it with the latest commit.
156 ;; Instead, please push one commit that rolls back Guix to before the mistake,
157 ;; and then another that points to the first one. That way, the faulty commit
158 ;; won't appear on the linked list.
159 ;;
160 ;; If you are updating this package because it fails to build, you need to
161 ;; actually update it *twice*, as the installer is pointing to the N-1 guix
162 ;; package revision.
163 (define-public guix
164 ;; Latest version of Guix, which may or may not correspond to a release.
165 ;; Note: the 'update-guix-package.scm' script expects this definition to
166 ;; start precisely like this.
167 (let ((version "1.3.0")
168 (commit "682639c107908426fe6bf0a1b8404b98b7820290")
169 (revision 32))
170 (package
171 (name "guix")
172
173 (version (if (zero? revision)
174 version
175 (string-append version "-"
176 (number->string revision)
177 "." (string-take commit 7))))
178 (source (origin
179 (method git-fetch)
180 (uri (git-reference
181 (url "https://git.savannah.gnu.org/git/guix.git")
182 (commit commit)))
183 (sha256
184 (base32
185 "1ap8hfq46ncp7azhdvc9s64a9q9y74xfqpgfwlcgz6sw82a09yh0"))
186 (file-name (string-append "guix-" version "-checkout"))))
187 (build-system gnu-build-system)
188 (arguments
189 `(#:configure-flags (list
190
191 ;; Provide channel metadata for 'guix describe'.
192 ;; Don't pass '--with-channel-url' and
193 ;; '--with-channel-introduction' and instead use
194 ;; the defaults.
195 ,(string-append "--with-channel-commit=" commit)
196
197 "--localstatedir=/var"
198 "--sysconfdir=/etc"
199 (string-append "--with-bash-completion-dir="
200 (assoc-ref %outputs "out")
201 "/etc/bash_completion.d")
202
203 ;; Set 'DOT_USER_PROGRAM' to the empty string so
204 ;; we don't keep a reference to Graphviz, whose
205 ;; closure is pretty big (too big for the Guix
206 ;; system installation image.)
207 "ac_cv_path_DOT_USER_PROGRAM=dot"
208
209 ;; To avoid problems with the length of shebangs,
210 ;; choose a fixed-width and short directory name
211 ;; for tests.
212 "ac_cv_guix_test_root=/tmp/guix-tests"
213 ,@(if (hurd-target?) '("--with-courage") '()))
214 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
215
216 #:modules ((guix build gnu-build-system)
217 (guix build utils)
218 (srfi srfi-26)
219 (ice-9 popen)
220 (ice-9 rdelim))
221
222 #:phases (modify-phases %standard-phases
223 (replace 'bootstrap
224 (lambda _
225 ;; Make sure 'msgmerge' can modify the PO files.
226 (for-each (lambda (po)
227 (chmod po #o666))
228 (find-files "." "\\.po$"))
229
230 (patch-shebang "build-aux/git-version-gen")
231
232 (call-with-output-file ".tarball-version"
233 (lambda (port)
234 (display ,version port)))
235
236 ;; Install SysV init files to $(prefix)/etc rather
237 ;; than to /etc.
238 (substitute* "nix/local.mk"
239 (("^sysvinitservicedir = .*$")
240 (string-append "sysvinitservicedir = \
241 $(prefix)/etc/init.d\n")))
242
243 ;; Install OpenRC init files to $(prefix)/etc rather
244 ;; than to /etc.
245 (substitute* "nix/local.mk"
246 (("^openrcservicedir = .*$")
247 (string-append "openrcservicedir = \
248 $(prefix)/etc/openrc\n")))
249
250 (invoke "sh" "bootstrap")))
251 ,@(if (target-riscv64?)
252 `((add-after 'unpack 'use-correct-guile-version-for-tests
253 (lambda _
254 (substitute* "tests/gexp.scm"
255 (("2\\.0") "3.0")))))
256 '())
257 (add-before 'build 'use-host-compressors
258 (lambda* (#:key inputs target #:allow-other-keys)
259 (when target
260 ;; Use host compressors.
261 (let ((bzip2 (assoc-ref inputs "bzip2"))
262 (gzip (assoc-ref inputs "gzip"))
263 (xz (assoc-ref inputs "xz")))
264 (substitute* "guix/config.scm"
265 (("\"[^\"]*/bin/bzip2")
266 (string-append "\"" bzip2 "/bin/bzip2"))
267 (("\"[^\"]*/bin/gzip") gzip
268 (string-append "\"" gzip "/bin/gzip"))
269 (("\"[^\"]*/bin//xz")
270 (string-append "\"" xz "/bin/xz")))))
271 #t))
272 (add-before 'check 'copy-bootstrap-guile
273 (lambda* (#:key system target inputs #:allow-other-keys)
274 ;; Copy the bootstrap guile tarball in the store
275 ;; used by the test suite.
276 (define (intern file recursive?)
277 ;; Note: don't use 'guix download' here because we
278 ;; need to set the 'recursive?' argument.
279 (define base
280 (strip-store-file-name file))
281
282 (define code
283 `(begin
284 (use-modules (guix))
285 (with-store store
286 (let* ((item (add-to-store store ,base
287 ,recursive?
288 "sha256" ,file))
289 (root (string-append "/tmp/gc-root-"
290 (basename item))))
291 ;; Register a root so that the GC tests
292 ;; don't delete those.
293 (symlink item root)
294 (add-indirect-root store root)))))
295
296 (invoke "./test-env" "guile" "-c"
297 (object->string code)))
298
299 (unless target
300 (intern (assoc-ref inputs "boot-guile") #f)
301
302 ;; On x86_64 some tests need the i686 Guile.
303 (when (and (not target)
304 (string=? system "x86_64-linux"))
305 (intern (assoc-ref inputs "boot-guile/i686") #f))
306
307 ;; Copy the bootstrap executables.
308 (for-each (lambda (input)
309 (intern (assoc-ref inputs input) #t))
310 '("bootstrap/bash" "bootstrap/mkdir"
311 "bootstrap/tar" "bootstrap/xz")))
312 #t))
313 (add-after 'unpack 'disable-failing-tests
314 ;; XXX FIXME: These tests fail within the build container.
315 (lambda _
316 (substitute* "tests/syscalls.scm"
317 (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
318 (string-append "(test-skip 1)\n" all)))
319 (substitute* "tests/containers.scm"
320 (("^\\(test-(assert|equal)" all)
321 (string-append "(test-skip 1)\n" all)))
322 (when (file-exists? "tests/guix-environment-container.sh")
323 (substitute* "tests/guix-environment-container.sh"
324 (("guix environment --version")
325 "exit 77\n")))
326 #t))
327 (add-before 'check 'set-SHELL
328 (lambda _
329 ;; 'guix environment' tests rely on 'SHELL' having a
330 ;; correct value, so set it.
331 (setenv "SHELL" (which "sh"))
332 #t))
333 (add-after 'install 'wrap-program
334 (lambda* (#:key inputs native-inputs outputs target
335 #:allow-other-keys)
336 ;; Make sure the 'guix' command finds GnuTLS,
337 ;; Guile-JSON, and Guile-Git automatically.
338 (let* ((out (assoc-ref outputs "out"))
339 (guile (assoc-ref (or native-inputs inputs)
340 "guile"))
341 (avahi (assoc-ref inputs "guile-avahi"))
342 (gcrypt (assoc-ref inputs "guile-gcrypt"))
343 (guile-lib (assoc-ref inputs "guile-lib"))
344 (json (assoc-ref inputs "guile-json"))
345 (sqlite (assoc-ref inputs "guile-sqlite3"))
346 (zlib (assoc-ref inputs "guile-zlib"))
347 (lzlib (assoc-ref inputs "guile-lzlib"))
348 (zstd (assoc-ref inputs "guile-zstd"))
349 (git (assoc-ref inputs "guile-git"))
350 (bs (assoc-ref inputs
351 "guile-bytestructures"))
352 (ssh (assoc-ref inputs "guile-ssh"))
353 (gnutls (assoc-ref inputs "guile-gnutls"))
354 (disarchive (assoc-ref inputs "disarchive"))
355 (lzma (assoc-ref inputs "guile-lzma"))
356 (locales (assoc-ref inputs "glibc-utf8-locales"))
357 (deps (list gcrypt json sqlite gnutls git
358 bs ssh zlib lzlib zstd guile-lib
359 disarchive lzma))
360 (deps* (if avahi (cons avahi deps) deps))
361 (effective
362 (read-line
363 (open-pipe* OPEN_READ
364 (string-append guile "/bin/guile")
365 "-c" "(display (effective-version))")))
366 (path (map (cut string-append <>
367 "/share/guile/site/"
368 effective)
369 (delete #f deps*)))
370 (gopath (map (cut string-append <>
371 "/lib/guile/" effective
372 "/site-ccache")
373 (delete #f deps*)))
374 (locpath (string-append locales "/lib/locale")))
375
376 ;; Modify 'guix' directly instead of using
377 ;; 'wrap-program'. This avoids the indirection
378 ;; through Bash, which in turn avoids getting Bash's
379 ;; own locale warnings.
380 (substitute* (string-append out "/bin/guix")
381 (("!#")
382 (string-append
383 "!#\n\n"
384 (object->string
385 `(set! %load-path (append ',path %load-path)))
386 "\n"
387 (object->string
388 `(set! %load-compiled-path
389 (append ',gopath %load-compiled-path)))
390 "\n"
391 (object->string
392 `(let ((path (getenv "GUIX_LOCPATH")))
393 (setenv "GUIX_LOCPATH"
394 (if path
395 (string-append path ":" ,locpath)
396 ,locpath))))
397 "\n\n"))))))
398
399 ;; The 'guix' executable has 'OUT/libexec/guix/guile' as
400 ;; its shebang; that should remain unchanged, thus remove
401 ;; the 'patch-shebangs' phase, which would otherwise
402 ;; change it to 'GUILE/bin/guile'.
403 (delete 'patch-shebangs))))
404 (native-inputs `(("pkg-config" ,pkg-config)
405
406 ;; Guile libraries are needed here for
407 ;; cross-compilation.
408 ("guile" ,guile-3.0-latest) ;for faster builds
409 ("guile-gnutls" ,guile-gnutls)
410 ,@(if (%current-target-system)
411 '()
412 `(("guile-avahi" ,guile-avahi)))
413 ("guile-gcrypt" ,guile-gcrypt)
414 ("guile-json" ,guile-json-4)
415 ("guile-lib" ,guile-lib)
416 ("guile-sqlite3" ,guile-sqlite3)
417 ("guile-zlib" ,guile-zlib)
418 ("guile-lzlib" ,guile-lzlib)
419 ("guile-zstd" ,guile-zstd)
420 ("guile-ssh" ,guile-ssh)
421 ("guile-git" ,guile-git)
422
423 ;; XXX: Keep the development inputs here even though
424 ;; they're unnecessary, just so that 'guix environment
425 ;; guix' always contains them.
426 ("autoconf" ,autoconf)
427 ("automake" ,automake)
428 ("gettext" ,gettext-minimal)
429 ("texinfo" ,texinfo)
430 ("graphviz" ,graphviz)
431 ("help2man" ,help2man)
432 ("po4a" ,po4a)))
433 (inputs
434 `(("bzip2" ,bzip2)
435 ("gzip" ,gzip)
436 ("sqlite" ,sqlite)
437 ("libgcrypt" ,libgcrypt)
438 ("zlib" ,zlib)
439
440 ("guile" ,guile-3.0-latest)
441
442 ;; Some of the tests use "unshare" when it is available.
443 ("util-linux" ,util-linux)
444
445 ;; Many tests rely on the 'guile-bootstrap' package, which is why we
446 ;; have it here.
447 ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
448 ,@(if (and (not (%current-target-system))
449 (string=? (%current-system) "x86_64-linux"))
450 `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
451 '())
452 ,@(if (%current-target-system)
453 `(("xz" ,xz))
454 '())
455
456 ;; Tests also rely on these bootstrap executables.
457 ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))
458 ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system)))
459 ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system)))
460 ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system)))
461
462 ("disarchive" ,disarchive) ;for 'guix perform-download'
463 ("guile-lzma" ,guile-lzma) ;for Disarchive
464
465 ("glibc-utf8-locales" ,glibc-utf8-locales)))
466 (propagated-inputs
467 `(("guile-gnutls" ,guile-gnutls)
468 ;; Avahi requires "glib" which doesn't cross-compile yet.
469 ,@(if (%current-target-system)
470 '()
471 `(("guile-avahi" ,guile-avahi)))
472 ("guile-gcrypt" ,guile-gcrypt)
473 ("guile-json" ,guile-json-4)
474 ("guile-lib" ,guile-lib)
475 ("guile-sqlite3" ,guile-sqlite3)
476 ("guile-ssh" ,guile-ssh)
477 ("guile-git" ,guile-git)
478 ("guile-zlib" ,guile-zlib)
479 ("guile-lzlib" ,guile-lzlib)
480 ("guile-zstd" ,guile-zstd)))
481 (native-search-paths
482 (list (search-path-specification
483 (variable "GUIX_EXTENSIONS_PATH")
484 (files '("share/guix/extensions")))
485 ;; (guix git) and (guix build download) honor this variable whose
486 ;; name comes from OpenSSL.
487 $SSL_CERT_DIR))
488 (home-page "https://www.gnu.org/software/guix/")
489 (synopsis "Functional package manager for installed software packages and versions")
490 (description
491 "GNU Guix is a functional package manager for the GNU system, and is
492 also a distribution thereof. It includes a virtual machine image. Besides
493 the usual package management features, it also supports transactional
494 upgrades and roll-backs, per-user profiles, and much more. It is based on
495 the Nix package manager.")
496 (license license:gpl3+)
497 (properties '((ftp-server . "alpha.gnu.org"))))))
498
499 (define* (channel-source->package source #:key commit)
500 "Return a package for the given channel SOURCE, a lowerable object."
501 (package
502 (inherit guix)
503 (version (string-append (package-version guix) "."
504 (if commit (string-take commit 7) "")))
505 (build-system channel-build-system)
506 (arguments `(#:source ,source
507 #:commit ,commit))
508 (inputs '())
509 (native-inputs '())
510 (propagated-inputs '())))
511
512 (export channel-source->package)
513
514 (define-public guix-for-cuirass
515 ;; Known-good revision before commit
516 ;; bd86bbd300474204878e927f6cd3f0defa1662a5, which introduced
517 ;; 'primitive-fork' in 'open-inferior'.
518 (let ((version "1.3.0")
519 (commit "a27e47f9d1e22dc32bb250cfeef88cfacb930e23")
520 (revision 23))
521 (package
522 (inherit guix)
523 (version (string-append version "-"
524 (number->string revision)
525 "." (string-take commit 7)))
526 (source (origin
527 (method git-fetch)
528 (uri (git-reference
529 (url "https://git.savannah.gnu.org/git/guix.git")
530 (commit commit)))
531 (sha256
532 (base32
533 "12jmvagbw05hmmlrb82i0qazhlv7mcfnl4dmknwx3a9hd760g9y1"))
534 (file-name (string-append "guix-" version "-checkout"))))
535 (properties `((hidden? . #t)
536 ,@(package-properties guix))))))
537
538 (define-public guix-daemon
539 ;; This package is for internal consumption: it allows us to quickly build
540 ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
541 ;; pull'.
542 (package
543 (inherit guix)
544 (properties `((hidden? . #t)))
545 (name "guix-daemon")
546
547 ;; Use a minimum set of dependencies.
548 (native-inputs
549 (modify-inputs (package-native-inputs guix)
550 (delete "po4a" "graphviz" "help2man")))
551 (inputs
552 (modify-inputs (package-inputs guix)
553 (delete "boot-guile" "boot-guile/i686" "util-linux")
554 (prepend guile-gnutls guile-git guile-json-3 guile-gcrypt)))
555
556 (propagated-inputs '())
557
558 (arguments
559 (substitute-keyword-arguments (package-arguments guix)
560 ((#:configure-flags flags '())
561 ;; Pretend we have those libraries; we don't actually need them.
562 `(append ,flags
563 '("guix_cv_have_recent_guile_sqlite3=yes"
564 "guix_cv_have_recent_guile_ssh=yes")))
565 ((#:tests? #f #f)
566 #f)
567 ((#:phases phases '%standard-phases)
568 `(modify-phases ,phases
569 (add-after 'unpack 'change-default-guix
570 (lambda _
571 ;; We need to tell 'guix-daemon' which 'guix' command to use.
572 ;; Here we use a questionable hack where we hard-code root's
573 ;; current guix, which could be wrong (XXX). Note that scripts
574 ;; like 'guix perform-download' do not run as root so we assume
575 ;; that they have access to /var/guix/profiles/per-user/root.
576 (substitute* "nix/libstore/globals.cc"
577 (("guixProgram = (.*)nixBinDir + \"/guix\"" _ before)
578 (string-append "guixProgram = " before
579 "/var/guix/profiles/per-user/root\
580 /current-guix/bin/guix")))
581 #t))
582 (replace 'build
583 (lambda _
584 (invoke "make" "nix/libstore/schema.sql.hh")
585 (invoke "make" "-j" (number->string
586 (parallel-job-count))
587 "guix-daemon")))
588 (delete 'copy-bootstrap-guile)
589 (replace 'install
590 (lambda* (#:key outputs #:allow-other-keys)
591 (invoke "make" "install-binPROGRAMS")))
592 (delete 'wrap-program)))))))
593
594 (define-public guix-minimal
595 ;; A version of Guix which is built with the minimal set of dependencies, as
596 ;; outlined in the README "Requirements" section. Intended as a CI job, so
597 ;; marked as hidden.
598 (hidden-package
599 (package
600 (inherit guix)
601 (name "guix-minimal")
602 (native-inputs
603 (modify-inputs (package-native-inputs guix)
604 (delete "guile-ssh")))
605 (propagated-inputs
606 (modify-inputs (package-propagated-inputs guix)
607 (delete "guile-ssh"))))))
608
609 (define-public current-guix-package
610 ;; This parameter allows callers to override the package that 'current-guix'
611 ;; returns. This is useful when 'current-guix' cannot compute it by itself,
612 ;; for instance because it's not running from a source code checkout.
613 ;;
614 ;; The default value is obtained by creating a package from the 'guix'
615 ;; channel returned by 'current-channels' or, if that's the empty list, that
616 ;; returned by 'repository->guix-channel' for the current directory (which
617 ;; assumes that we're running from a Git checkout). Delay computation so
618 ;; that the relevant modules can be loaded lazily.
619 (make-parameter
620 (delay (match (or (find guix-channel? (current-channels))
621 (repository->guix-channel
622 (current-source-directory)))
623 ((? channel? source)
624 (package
625 (inherit guix)
626 (source source)
627 (build-system channel-build-system)
628 (inputs '())
629 (native-inputs '())
630 (propagated-inputs '())))
631 (#f #f)))))
632
633 (define-public current-guix
634 (lambda ()
635 "Return a package representing the currently-used Guix. It can be
636 overridden by setting the 'current-guix-package' parameter."
637 (match (current-guix-package)
638 ((? promise? package) (force package))
639 (package package))))
640
641 (define-public guix-icons
642 (package
643 (inherit guix)
644 (name "guix-icons")
645 (version "0.1")
646 (source %artwork-repository)
647 (build-system trivial-build-system)
648 (native-inputs
649 (list imagemagick))
650 (inputs
651 '())
652 (arguments
653 `(#:modules ((guix build utils)
654 (gnu build svg))
655 #:builder
656 ,(with-extensions (list guile-rsvg guile-cairo)
657 #~(begin
658 (use-modules (guix build utils)
659 (gnu build svg))
660 (let* ((logo (string-append #$source "/logo/Guix.svg"))
661 (logo-white
662 (string-append #$source
663 "/logo/Guix-horizontal-white.svg"))
664 (theme "hicolor")
665 (category "apps")
666 (sizes '(16 24 32 48 64 72 96 128 256 512 1024))
667 (icons
668 (string-append #$output "/share/icons/" theme))
669 (scalable-dir
670 (string-append icons "/scalable/" category)))
671 (setenv "XDG_CACHE_HOME" (getcwd))
672
673 ;; Create the scalable icon files.
674 (mkdir-p scalable-dir)
675 (copy-file logo
676 (string-append scalable-dir "/guix-icon.svg"))
677 (copy-file logo-white
678 (string-append scalable-dir
679 "/guix-white-icon.svg"))
680
681 ;; Create the fixed dimensions icon files.
682 (for-each
683 (lambda (size)
684 (let* ((dimension
685 (format #f "~ax~a" size size))
686 (file
687 (string-append icons "/" dimension "/" category
688 "/guix-icon.png")))
689 (mkdir-p (dirname file))
690 (svg->png logo file
691 #:width size
692 #:height size)))
693 sizes))))))
694 (synopsis "GNU Guix icons")
695 (description "This package contains GNU Guix icons organized according to
696 the Icon Theme Specification. They can be used by applications querying the
697 GTK icon cache for instance.")))
698
699 (define-public guix-modules
700 (package
701 (name "guix-modules")
702 (version "0.1.0")
703 (home-page "https://gitlab.inria.fr/guix-hpc/guix-modules")
704 (source (origin
705 (method git-fetch)
706 (uri (git-reference (url home-page)
707 (commit (string-append "v" version))))
708 (file-name (string-append "guix-modules-" version "-checkout"))
709 (sha256
710 (base32
711 "1ckvrrmkgzz93i35sj1372wxs7ln4gzszpri1pcdf473z0p7nh7w"))))
712 (build-system guile-build-system)
713 (arguments
714 '(#:phases (modify-phases %standard-phases
715 (add-after 'install 'move-to-extension-directory
716 (lambda* (#:key outputs #:allow-other-keys)
717 (let* ((out (assoc-ref outputs "out"))
718 (target (string-append
719 out
720 "/share/guix/extensions/module.scm")))
721 (mkdir-p (dirname target))
722 (rename-file (car (find-files out "module.scm"))
723 target)))))))
724 (native-inputs (list (lookup-package-input guix "guile") guix))
725 (synopsis "Generate environment modules from Guix packages")
726 (description
727 "Guix-Modules is an extension of Guix that provides a new @command{guix
728 module} command. The @command{guix module create} sub-command creates
729 @dfn{environment modules}, allowing you to manipulate software environments
730 with the @command{module} command commonly found on @acronym{HPC,
731 high-performance computing} clusters.")
732 (license license:gpl3+)))
733
734 \f
735 ;;;
736 ;;; Other tools.
737 ;;;
738
739 (define-public nix
740 (package
741 (name "nix")
742 (version "2.5.1")
743 (source
744 (origin
745 (method git-fetch)
746 (uri (git-reference
747 (url "http://github.com/NixOS/nix")
748 (commit version)))
749 (file-name (git-file-name name version))
750 (sha256
751 (base32 "1m8rmv8i6lg83pmalvjlq1fn8mcghn3ngjv3kw1kqsa45ymj5sqq"))
752 (patches
753 (search-patches "nix-dont-build-html-doc.diff"))))
754 (build-system gnu-build-system)
755 (arguments
756 (list
757 #:configure-flags #~(list "--sysconfdir=/etc" "--enable-gc")
758 #:phases
759 #~(modify-phases %standard-phases
760 (replace 'install
761 ;; Don't try & fail to create subdirectories in /etc, but keep them
762 ;; in the output as examples.
763 (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
764 (let ((etc (string-append #$output "/etc")))
765 (apply invoke "make" "install"
766 (string-append "sysconfdir=" etc)
767 (string-append "profiledir=" etc "/profile.d")
768 make-flags)))))))
769 (native-inputs
770 (list autoconf
771 autoconf-archive
772 automake
773 bison
774 flex
775 googletest
776 jq
777 libtool
778 pkg-config))
779 (inputs
780 (append (list boost
781 brotli
782 bzip2
783 curl
784 editline
785 libarchive
786 libgc
787 libseccomp
788 libsodium
789 lowdown
790 openssl
791 sqlite
792 xz
793 zlib)
794 (if (or (target-x86-64?)
795 (target-x86-32?))
796 (list libcpuid)
797 '())))
798 (home-page "https://nixos.org/nix/")
799 (synopsis "The Nix package manager")
800 (description
801 "Nix is a purely functional package manager. This means that it treats
802 packages like values in purely functional programming languages such as
803 Haskell—they are built by functions that don't have side-effects, and they
804 never change after they have been built. Nix stores packages in the Nix
805 store, usually the directory /nix/store, where each package has its own unique
806 sub-directory.")
807 (license license:lgpl2.1+)))
808
809 (define-public stow
810 (package
811 (name "stow")
812 (version "2.3.1")
813 (source (origin
814 (method url-fetch)
815 (uri (string-append "mirror://gnu/stow/stow-"
816 version ".tar.gz"))
817 (sha256
818 (base32
819 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
820 (build-system gnu-build-system)
821 (inputs
822 (list perl))
823 (native-inputs
824 (list perl-test-simple perl-test-output perl-capture-tiny
825 perl-io-stringy))
826 (home-page "https://www.gnu.org/software/stow/")
827 (synopsis "Managing installed software packages")
828 (description
829 "GNU Stow is a symlink manager. It generates symlinks to directories
830 of data and makes them appear to be merged into the same directory. It is
831 typically used for managing software packages installed from source, by
832 letting you install them apart in distinct directories and then create
833 symlinks to the files in a common directory such as /usr/local.")
834 (license license:gpl3+)))
835
836 (define-public xstow
837 (package
838 (name "xstow")
839 (version "1.0.2")
840 (source (origin
841 (method url-fetch)
842 (uri (string-append "mirror://sourceforge/xstow/xstow-"
843 version ".tar.bz2"))
844 (sha256
845 (base32
846 "1vy6lcswpkixh7h5mvsmq2wbcih6lpsmcva3m7v6f5npllciy13g"))))
847 (build-system gnu-build-system)
848 (synopsis "Replacement of GNU Stow written in C++")
849 (description
850 "XStow is a replacement of GNU Stow written in C++. It supports all
851 features of Stow with some extensions.")
852 (home-page "http://xstow.sourceforge.net/")
853 (license license:gpl2)))
854
855 (define-public rpm
856 (package
857 (name "rpm")
858 (version "4.17.1")
859 (source (origin
860 (method url-fetch)
861 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
862 (version-major+minor version) ".x/rpm-"
863 version ".tar.bz2"))
864 (sha256
865 (base32
866 "0pbfj94ha59lbnd8dk0aqyxjv37xixfdcazq3y2mhwkf8s9vf48c"))))
867 (build-system gnu-build-system)
868 (arguments
869 '(#:configure-flags '("--with-external-db" ;use the system's bdb
870 "--enable-python")
871 #:phases (modify-phases %standard-phases
872 (add-after 'unpack 'fix-lua-check
873 (lambda _
874 (substitute* "configure"
875 (("lua >= 5.3")
876 "lua-5.3 >= 5.3"))))
877 (add-before 'configure 'set-nss-library-path
878 (lambda* (#:key inputs #:allow-other-keys)
879 (let ((nss (assoc-ref inputs "nss")))
880 (setenv "LIBRARY_PATH"
881 (string-append (getenv "LIBRARY_PATH") ":"
882 nss "/lib/nss"))))))))
883 (native-inputs
884 (list pkg-config))
885 (inputs
886 (list bdb
887 bzip2
888 cpio
889 file
890 libarchive
891 libgcrypt
892 lua
893 nspr
894 nss
895 python
896 sqlite
897 xz
898 zlib))
899 (propagated-inputs
900 ;; popt is listed in the 'Requires' of rpm.pc.
901 (list popt))
902 (home-page "https://rpm.org/")
903 (synopsis "The RPM Package Manager")
904 (description
905 "The RPM Package Manager (RPM) is a command-line driven package
906 management system capable of installing, uninstalling, verifying, querying,
907 and updating computer software packages. Each software package consists of an
908 archive of files along with information about the package like its version, a
909 description. There is also a library permitting developers to manage such
910 transactions from C or Python.")
911
912 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
913 (license license:gpl2+)))
914
915 (define-public python-anaconda-client
916 (package
917 (name "python-anaconda-client")
918 (version "1.8.0")
919 (source
920 (origin
921 (method git-fetch)
922 (uri (git-reference
923 (url "https://github.com/Anaconda-Platform/anaconda-client")
924 (commit version)))
925 (file-name (git-file-name name version))
926 (sha256
927 (base32
928 "1vyk0g0gci4z9psisb8h50zi3j1nwfdg1jw3j76cxv0brln0v3fw"))))
929 (build-system python-build-system)
930 (propagated-inputs
931 (list python-clyent python-nbformat python-pyyaml python-requests))
932 (native-inputs
933 (list python-coverage
934 python-dateutil
935 python-freezegun
936 python-mock
937 python-pillow
938 python-pytz))
939 (arguments
940 `(#:phases
941 (modify-phases %standard-phases
942 ;; This is needed for some tests.
943 (add-before 'check 'set-up-home
944 (lambda* _ (setenv "HOME" "/tmp") #t))
945 (add-before 'check 'remove-network-tests
946 (lambda* _
947 ;; Remove tests requiring a network connection
948 (let ((network-tests '("tests/test_upload.py"
949 "tests/test_authorizations.py"
950 "tests/test_login.py"
951 "tests/test_whoami.py"
952 "utils/notebook/tests/test_data_uri.py"
953 "utils/notebook/tests/test_base.py"
954 "utils/notebook/tests/test_downloader.py"
955 "inspect_package/tests/test_conda.py")))
956 (with-directory-excursion "binstar_client"
957 (for-each delete-file network-tests)))
958 #t)))))
959 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
960 (synopsis "Anaconda Cloud command line client library")
961 (description
962 "Anaconda Cloud command line client library provides an interface to
963 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
964 environments.")
965 (license license:bsd-3)))
966
967 (define-public python-conda-package-handling
968 (package
969 (name "python-conda-package-handling")
970 (version "1.7.3")
971 (source
972 (origin
973 (method git-fetch)
974 (uri (git-reference
975 (url "https://github.com/conda/conda-package-handling/")
976 (commit version)))
977 (file-name (git-file-name name version))
978 (sha256
979 (base32
980 "1dq6f5ks3cinb355x712bls9bvv6bli6x3c43sdkqvawdw8xgv9j"))))
981 (build-system python-build-system)
982 (arguments
983 `(#:phases
984 (modify-phases %standard-phases
985 (add-after 'unpack 'use-unmodified-libarchive
986 (lambda _
987 (substitute* "setup.py"
988 (("archive_and_deps") "archive"))))
989 (replace 'check
990 (lambda* (#:key inputs outputs #:allow-other-keys)
991 (add-installed-pythonpath inputs outputs)
992 (invoke "pytest" "-vv" "tests"))))))
993 (propagated-inputs
994 (list python-six python-tqdm))
995 (inputs
996 (list libarchive))
997 (native-inputs
998 (list python-cython python-pytest python-pytest-cov
999 python-pytest-mock python-mock))
1000 (home-page "https://conda.io")
1001 (synopsis "Create and extract conda packages of various formats")
1002 (description
1003 "This library is an abstraction of Conda package handling and a tool for
1004 extracting, creating, and converting between formats.")
1005 (license license:bsd-3)))
1006
1007 (define-public conda
1008 (package
1009 (name "conda")
1010 (version "4.10.3")
1011 (source
1012 (origin
1013 (method git-fetch)
1014 (uri (git-reference
1015 (url "https://github.com/conda/conda")
1016 (commit version)))
1017 (file-name (git-file-name name version))
1018 (sha256
1019 (base32
1020 "1w4yy62bsvkybjvcm5fspck4ns5j16nplzpbx6bxv7zhx69pcp4n"))))
1021 (build-system python-build-system)
1022 (arguments
1023 `(#:phases
1024 (modify-phases %standard-phases
1025 (add-after 'unpack 'fix-permissions
1026 (lambda _
1027 ;; This file is no longer writable after downloading with
1028 ;; 'git-fetch'
1029 (make-file-writable
1030 "tests/conda_env/support/saved-env/environment.yml")))
1031 (add-after 'unpack 'fix-ruamel-yaml-dependency
1032 (lambda _
1033 (substitute* "setup.py"
1034 (("ruamel_yaml_conda") "ruamel.yaml"))))
1035 (add-after 'unpack 'correct-python-executable-name
1036 (lambda* (#:key inputs #:allow-other-keys)
1037 (let ((python (assoc-ref inputs "python-wrapper")))
1038 #;
1039 (substitute* "conda/common/path.py"
1040 (("python_version or ''")
1041 "python_version or '3'"))
1042 (substitute* "conda/core/initialize.py"
1043 (("python_exe = join")
1044 (format #f "python_exe = \"~a/bin/python\" #"
1045 python))))
1046 #t))
1047 (add-after 'unpack 'do-not-use-python-root-as-prefix
1048 (lambda* (#:key inputs outputs #:allow-other-keys)
1049 (let ((out (assoc-ref outputs "out"))
1050 (python (assoc-ref inputs "python-wrapper")))
1051 (substitute* "tests/core/test_initialize.py"
1052 (("\"\"\"\\) % conda_prefix")
1053 (format #f "\"\"\") % \"~a\"" python))
1054 (("CONDA_PYTHON_EXE \"%s\"' % join\\(conda_prefix")
1055 (format #f "CONDA_PYTHON_EXE \"%s\"' % join(\"~a\""
1056 python))
1057 (("conda_prefix = abspath\\(sys.prefix\\)")
1058 (format #f "conda_prefix = abspath(\"~a\")" out)))
1059 (substitute* "conda/base/context.py"
1060 (("os.chdir\\(sys.prefix\\)")
1061 (format #f "os.chdir(\"~a\")" out))
1062 (("sys.prefix, '.condarc'")
1063 (format #f "\"~a\", '.condarc'" out))
1064 (("return abspath\\(sys.prefix\\)")
1065 (format #f "return abspath(\"~a\")" out))
1066 (("os.path.join\\(sys.prefix, bin_dir, exe\\)")
1067 (format #f "\"~a/bin/conda\"" out))
1068 (("'CONDA_EXE', sys.executable")
1069 (format #f "'CONDA_EXE', \"~a/bin/conda\"" out))))
1070 #t))
1071 (add-before 'build 'create-version-file
1072 (lambda _
1073 (with-output-to-file "conda/.version"
1074 (lambda () (display ,version)))
1075 #t))
1076 (replace 'check
1077 (lambda _
1078 (setenv "HOME" "/tmp")
1079 (invoke "py.test" "-vv"
1080 "-k"
1081 (string-append
1082 "not integration"
1083 ;; This one reports a newer version of conda than
1084 ;; expected.
1085 " and not test_auto_update_conda"
1086 ;; This fails because the output directory is not a
1087 ;; Conda environment.
1088 " and not test_list"
1089 ;; This fails because we patched the default root
1090 ;; prefix.
1091 " and not test_default_target_is_root_prefix"
1092
1093 ;; These fail because ...
1094 ;; TODO: conda patches its own shebang to
1095 ;; $conda-prefix/bin/python, which is obviously wrong.
1096 " and not test_run_returns_int"
1097 " and not test_run_returns_zero_errorlevel"
1098 " and not test_run_returns_nonzero_errorlevel"
1099
1100 ;; TODO: I don't understand what this failure means
1101 " and not test_PrefixData_return_value_contract"
1102 ;; TODO: same here
1103 " and not test_install_1"
1104 ;; Not sure if this is really wrong. This fails because
1105 ;; /gnu/store/...python-conda-4.8.3/bin/python
1106 ;; is not /gnu/store/...python-wrapper-3.8.2/bin/python
1107 " and not test_make_entry_point"))))
1108 (add-after 'install 'init
1109 ;; This writes a whole bunch of shell initialization files to the
1110 ;; prefix directory. Many features of conda can only be used after
1111 ;; running "conda init".
1112 (lambda* (#:key inputs outputs #:allow-other-keys)
1113 (add-installed-pythonpath inputs outputs)
1114 (setenv "HOME" "/tmp")
1115 (invoke (string-append (assoc-ref outputs "out")
1116 "/bin/conda")
1117 "init"))))))
1118 (inputs
1119 (list python-wrapper))
1120 (propagated-inputs
1121 (list python-anaconda-client
1122 python-conda-package-handling
1123 python-cytoolz
1124 python-pycosat
1125 python-pytest
1126 python-pyyaml
1127 python-requests
1128 python-responses
1129 python-ruamel.yaml
1130 python-tqdm
1131 ;; XXX: This is dragged in by libarchive and is needed at runtime.
1132 zstd))
1133 (native-inputs
1134 (list python-pytest-timeout))
1135 (home-page "https://github.com/conda/conda")
1136 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
1137 (description
1138 "Conda is a cross-platform, Python-agnostic binary package manager. It
1139 is the package manager used by Anaconda installations, but it may be used for
1140 other systems as well. Conda makes environments first-class citizens, making
1141 it easy to create independent environments even for C libraries. Conda is
1142 written entirely in Python.")
1143 (license license:bsd-3)))
1144
1145 (define-public conan
1146 (package
1147 (name "conan")
1148 (version "1.50.0")
1149 (source
1150 (origin
1151 (method git-fetch) ;no tests in PyPI archive
1152 (uri (git-reference
1153 (url "https://github.com/conan-io/conan")
1154 (commit version)))
1155 (file-name (git-file-name name version))
1156 (sha256
1157 (base32
1158 "1jjrinz5wkcxfvwdpldrv4h7vacdyz88cc4af5vi3sdnjra0i0m5"))))
1159 (build-system python-build-system)
1160 (arguments
1161 `(#:phases
1162 (modify-phases %standard-phases
1163 (add-after 'unpack 'relax-requirements
1164 (lambda _
1165 (substitute* "conans/requirements.txt"
1166 (("node-semver==0.6.1")
1167 "node-semver>=0.6.1")
1168 (("Jinja2>=2.9, <3")
1169 "Jinja2>=2.9")
1170 (("PyYAML>=3.11, <6.0")
1171 "PyYAML"))))
1172 (add-after 'unpack 'patch-paths
1173 (lambda* (#:key inputs #:allow-other-keys)
1174 (let ((coreutils (assoc-ref inputs "coreutils")))
1175 ;; It seems that PATH is manipulated, as printenv is not found
1176 ;; during tests. Patch in its exact location.
1177 (substitute* "conan/tools/env/environment.py"
1178 (("printenv")
1179 (string-append coreutils "/bin/printenv")))
1180 (substitute* "conans/client/envvars/environment.py"
1181 (("#!/usr/bin/env")
1182 (string-append "#!" coreutils "/bin/env"))))))
1183 (add-before 'check 'set-home
1184 (lambda _
1185 (setenv "HOME" "/tmp")))
1186 (replace 'check
1187 (lambda* (#:key tests? outputs #:allow-other-keys)
1188 (define system ,(or (%current-target-system)
1189 (%current-system)))
1190 (when tests?
1191 (setenv "PATH" (string-append (getenv "PATH") ":"
1192 (assoc-ref outputs "out") "/bin"))
1193 (invoke "python" "-m" "pytest"
1194 "-n" "auto" ;parallelize tests
1195 "-m" "not slow and not tool_svn"
1196 ;; Disable problematic tests.
1197 "-k"
1198 (string-append
1199 ;; These tests rely on networking.
1200 "not shallow_clone_remote "
1201 "and not remote_build "
1202 "and not download_retries_errors "
1203 "and not ftp "
1204 "and not build_local_different_folders "
1205 ;; These expect CMake available at fixed versions.
1206 "and not custom_cmake "
1207 "and not default_cmake "
1208 "and not bazel " ;bazel is not packaged
1209 ;; Guix sets PKG_CONFIG_PATH itself, which is not
1210 ;; expected by the following test.
1211 "and not pkg_config_path "
1212 "and not compare " ;caused by newer node-semver?
1213 ;; Guix is not currently a supported package manager.
1214 "and not system_package_tool "
1215 ;; These expect GCC 5 to be available.
1216 "and not test_reuse "
1217 "and not test_install "
1218 ;; The installed configure script trips on the /bin/sh
1219 ;; shebang. We'd have to patch it in the Python code.
1220 "and not test_autotools "
1221 "and not test_use_build_virtualenv "
1222 ;; This test is architecture-dependent.
1223 "and not test_toolchain_linux "
1224 ;; This one fails for unknown reasons (see:
1225 ;; https://github.com/conan-io/conan/issues/9671).
1226 "and not test_build "
1227 ;; These tests expect the 'apt' command to be available.
1228 "and not test_apt_check "
1229 "and not test_apt_install_substitutes "
1230 (if (not (string-prefix? "x86_64" system))
1231 ;; These tests either assume the machine is
1232 ;; x86_64, or require a cross-compiler to target
1233 ;; it.
1234 (string-append
1235 "and not cpp_package "
1236 "and not exclude_code_analysis "
1237 "and not cmakedeps_multi "
1238 "and not locally_build_linux "
1239 "and not custom_configuration "
1240 "and not package_from_system "
1241 "and not cross_build_command "
1242 "and not test_package "
1243 "and not test_deleted_os "
1244 "and not test_same ")
1245 "")
1246 (if (not (or (string-prefix? "x86_64" system)
1247 (string-prefix? "i686" system)))
1248 ;; These tests either assume the machine is i686,
1249 ;; or require a cross-compiler to target it.
1250 (string-append
1251 "and not vcvars_raises_when_not_found "
1252 "and not conditional_generators "
1253 "and not test_folders "
1254 "and not settings_as_a_dict_conanfile ")
1255 "")))))))))
1256 (propagated-inputs
1257 (list python-bottle
1258 python-colorama
1259 python-dateutil
1260 python-distro
1261 python-fasteners
1262 python-future
1263 python-jinja2
1264 python-node-semver
1265 python-patch-ng
1266 python-pluginbase
1267 python-pygments
1268 python-pyjwt
1269 python-pyyaml-5
1270 python-requests
1271 python-six
1272 python-tqdm
1273 python-urllib3))
1274 (inputs
1275 (list coreutils)) ;for printenv
1276 (native-inputs
1277 `(("autoconf" ,autoconf)
1278 ("automake" ,automake)
1279 ("cmake" ,cmake)
1280 ("git" ,git-minimal)
1281 ("meson" ,meson)
1282 ("ninja",ninja)
1283 ("pkg-config" ,pkg-config)
1284 ("python-bottle" ,python-bottle)
1285 ("python-mock" ,python-mock)
1286 ("python-parameterized" ,python-parameterized)
1287 ("python-pytest" ,python-pytest)
1288 ("python-pytest-xdist" ,python-pytest-xdist)
1289 ("python-webtest" ,python-webtest)
1290 ("which" ,which)))
1291 (home-page "https://conan.io")
1292 (synopsis "Decentralized C/C++ package manager")
1293 (description "Conan is a package manager for C and C++ developers that
1294 boasts the following features:
1295 @itemize
1296 @item
1297 It is fully decentralized. Users can host their packages on their own private
1298 servers.
1299 @item
1300 It can create, upload and download binaries for any configuration and
1301 platform, including cross-compiled ones.
1302 @item
1303 It integrates with any build system, including CMake, Makefiles, Meson, etc.
1304 @item
1305 It is extensible; its Python-based recipes, together with extensions points
1306 allow for great power and flexibility.
1307 @end itemize")
1308 (license license:expat)))
1309
1310 (define-public gwl
1311 (package
1312 (name "gwl")
1313 (version "0.5.0")
1314 (source (origin
1315 (method url-fetch)
1316 (uri (string-append "mirror://gnu/gwl/gwl-" version ".tar.gz"))
1317 (sha256
1318 (base32
1319 "09r22gqgaj2mxvlwvfach5j1n66y3yggmzc6d2gxq7lyywbcvjvs"))))
1320 (build-system gnu-build-system)
1321 (arguments
1322 `(#:parallel-build? #false ; for reproducibility
1323 #:make-flags
1324 '("GUILE_AUTO_COMPILE=0" "GWL_SKIP_INTEGRATION_TESTS=1")))
1325 (native-inputs
1326 (list autoconf automake pkg-config texinfo graphviz))
1327 (inputs
1328 (let ((p (package-input-rewriting
1329 `((,guile-3.0 . ,guile-3.0-latest))
1330 #:deep? #false)))
1331 (list guix
1332 guile-3.0-latest
1333 (p guile-commonmark)
1334 (p guile-config)
1335 (p guile-drmaa)
1336 (p guile-gcrypt)
1337 (p guile-pfds)
1338 (p guile-syntax-highlight)
1339 (p guile-wisp))))
1340 (home-page "https://workflows.guix.info")
1341 (synopsis "Workflow management extension for GNU Guix")
1342 (description "The @dfn{Guix Workflow Language} (GWL) provides an
1343 extension to GNU Guix's declarative language for package management to
1344 automate the execution of programs in scientific workflows. The GWL
1345 can use process engines to integrate with various computing
1346 environments.")
1347 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
1348 ;; the web interface modules in gwl/ are licensed AGPL3+,
1349 ;; and the fonts included in this package are licensed OFL1.1.
1350 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
1351
1352 (define-public gwl/next
1353 (let ((commit "706a0895f639ed3ed77d0fe88382f51a6638b514")
1354 (revision "1"))
1355 (package
1356 (inherit gwl)
1357 (name "gwl-next")
1358 (version (git-version "0.5.0" revision commit))
1359 (source (origin
1360 (method git-fetch)
1361 (uri (git-reference
1362 (url "https://git.savannah.gnu.org/git/gwl.git")
1363 (commit commit)))
1364 (file-name (git-file-name name version))
1365 (sha256
1366 (base32
1367 "0k9zkdyyzir3fvlbcfcqy17k28b51i20rpbjwlx2i1mwd2pw9cxc")))))))
1368
1369 (define-public guix-build-coordinator
1370 (let ((commit "6cd8bd854332301edef6eee68080881b8349d768")
1371 (revision "67"))
1372 (package
1373 (name "guix-build-coordinator")
1374 (version (git-version "0" revision commit))
1375 (source (origin
1376 (method git-fetch)
1377 (uri (git-reference
1378 (url "https://git.cbaines.net/git/guix/build-coordinator")
1379 (commit commit)))
1380 (sha256
1381 (base32
1382 "125dq7xr5crwq5l33dnxcyba90axkki0kw4m290qvz6xv21ydmj0"))
1383 (file-name (string-append name "-" version "-checkout"))))
1384 (build-system gnu-build-system)
1385 (arguments
1386 `(#:modules (((guix build guile-build-system)
1387 #:select (target-guile-effective-version))
1388 ,@%gnu-build-system-modules)
1389 #:imported-modules ((guix build guile-build-system)
1390 ,@%gnu-build-system-modules)
1391 #:phases
1392 (modify-phases %standard-phases
1393 (add-before 'build 'set-GUILE_AUTO_COMPILE
1394 (lambda _
1395 ;; To avoid warnings relating to 'guild'.
1396 (setenv "GUILE_AUTO_COMPILE" "0")
1397 #t))
1398 (add-after 'install 'wrap-executable
1399 (lambda* (#:key inputs outputs target #:allow-other-keys)
1400 (let* ((out (assoc-ref outputs "out"))
1401 (bin (string-append out "/bin"))
1402 (guile (assoc-ref inputs "guile"))
1403 (version (target-guile-effective-version))
1404 (scm (string-append out "/share/guile/site/" version))
1405 (go (string-append out "/lib/guile/" version "/site-ccache")))
1406 (for-each
1407 (lambda (file)
1408 (simple-format (current-error-port) "wrapping: ~A\n" file)
1409 (let ((guile-inputs (list
1410 "guile-json"
1411 "guile-gcrypt"
1412 "guix"
1413 "guile-prometheus"
1414 "guile-lib"
1415 "guile-lzlib"
1416 "guile-zlib"
1417 "guile-sqlite3"
1418 "guile-gnutls"
1419 ,@(if (hurd-target?)
1420 '()
1421 '("guile-fibers")))))
1422 (wrap-program file
1423 `("PATH" ":" prefix
1424 (,bin
1425 ;; Support building without sqitch as an input, as it
1426 ;; can't be cross-compiled yet
1427 ,@(or (and=> (assoc-ref inputs "sqitch")
1428 list)
1429 '())))
1430 `("GUILE_LOAD_PATH" ":" prefix
1431 (,scm ,(string-join
1432 (map (lambda (input)
1433 (simple-format
1434 #f "~A/share/guile/site/~A"
1435 (assoc-ref inputs input)
1436 version))
1437 guile-inputs)
1438 ":")))
1439 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1440 (,go ,(string-join
1441 (map (lambda (input)
1442 (simple-format
1443 #f "~A/lib/guile/~A/site-ccache"
1444 (assoc-ref inputs input)
1445 version))
1446 guile-inputs)
1447 ":"))))
1448 (when target
1449 ;; XXX work around wrap-program picking bash for the
1450 ;; host rather than target
1451 (let ((bash (assoc-ref inputs "bash")))
1452 (substitute* file
1453 (("^#!.*/bash")
1454 (string-append "#! " bash "/bin/bash")))))))
1455 (find-files bin)))
1456 #t))
1457 (delete 'strip)))) ; As the .go files aren't compatible
1458 (native-inputs
1459 (list pkg-config
1460 autoconf
1461 automake
1462 guile-gnutls
1463
1464 ;; Guile libraries are needed here for cross-compilation.
1465 guile-json-4
1466 guile-gcrypt
1467 guix
1468 guile-prometheus
1469 guile-fibers-1.1
1470 guile-lib
1471 (first (assoc-ref (package-native-inputs guix) "guile"))))
1472 (inputs
1473 (append
1474 (list (first (assoc-ref (package-native-inputs guix) "guile"))
1475 sqlite
1476 bash-minimal)
1477 (if (hurd-target?)
1478 '()
1479 (list sqitch))))
1480 (propagated-inputs
1481 (append
1482 (list guile-prometheus
1483 guile-gcrypt
1484 guile-json-4
1485 guile-lib
1486 guile-lzlib
1487 guile-zlib
1488 guile-sqlite3
1489 guix
1490 guile-gnutls)
1491 (if (hurd-target?)
1492 '()
1493 (list guile-fibers-1.1))))
1494 (home-page "https://git.cbaines.net/guix/build-coordinator/")
1495 (synopsis "Tool to help build derivations")
1496 (description
1497 "The Guix Build Coordinator helps with performing lots of builds across
1498 potentially many machines, and with doing something with the results and
1499 outputs of those builds.")
1500 (license license:gpl3+))))
1501
1502 (define-public guix-build-coordinator/agent-only
1503 (package
1504 (inherit guix-build-coordinator)
1505 (name "guix-build-coordinator-agent-only")
1506 (arguments
1507 `(#:modules (((guix build guile-build-system)
1508 #:select (target-guile-effective-version))
1509 ,@%gnu-build-system-modules)
1510 #:imported-modules ((guix build guile-build-system)
1511 ,@%gnu-build-system-modules)
1512 #:phases
1513 (modify-phases %standard-phases
1514 (add-before 'build 'set-GUILE_AUTO_COMPILE
1515 (lambda _
1516 ;; To avoid warnings relating to 'guild'.
1517 (setenv "GUILE_AUTO_COMPILE" "0")
1518 #t))
1519 (add-after 'install 'wrap-executable
1520 (lambda* (#:key inputs outputs target #:allow-other-keys)
1521 (let* ((out (assoc-ref outputs "out"))
1522 (bin (string-append out "/bin"))
1523 (guile (assoc-ref inputs "guile"))
1524 (version (target-guile-effective-version))
1525 (scm (string-append out "/share/guile/site/" version))
1526 (go (string-append out "/lib/guile/" version "/site-ccache")))
1527 (for-each
1528 (lambda (file)
1529 (simple-format (current-error-port) "wrapping: ~A\n" file)
1530 (let ((guile-inputs (list
1531 "guile-json"
1532 "guile-gcrypt"
1533 "guix"
1534 "guile-prometheus"
1535 "guile-lib"
1536 "guile-lzlib"
1537 "guile-zlib"
1538 "guile-sqlite3"
1539 "guile-gnutls")))
1540 (wrap-program file
1541 `("PATH" ":" prefix (,bin))
1542 `("GUILE_LOAD_PATH" ":" prefix
1543 (,scm ,(string-join
1544 (map (lambda (input)
1545 (simple-format
1546 #f "~A/share/guile/site/~A"
1547 (assoc-ref inputs input)
1548 version))
1549 guile-inputs)
1550 ":")))
1551 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1552 (,go ,(string-join
1553 (map (lambda (input)
1554 (simple-format
1555 #f "~A/lib/guile/~A/site-ccache"
1556 (assoc-ref inputs input)
1557 version))
1558 guile-inputs)
1559 ":"))))))
1560 (find-files bin)))
1561 #t))
1562 (delete 'strip)))) ; As the .go files aren't compatible
1563 (native-inputs
1564 (list pkg-config
1565 autoconf
1566 automake
1567 guile-gnutls
1568
1569 ;; Guile libraries are needed here for cross-compilation.
1570 guile-json-4
1571 guile-gcrypt
1572 guix
1573 guile-prometheus
1574 guile-lib
1575 (first (assoc-ref (package-native-inputs guix) "guile"))))
1576 (inputs
1577 (list (first (assoc-ref (package-native-inputs guix) "guile"))
1578 bash-minimal))
1579 (propagated-inputs
1580 (append
1581 (list guile-prometheus
1582 guile-gcrypt
1583 guile-json-4
1584 guile-lib
1585 guile-lzlib
1586 guile-zlib
1587 guix
1588 guile-gnutls)))
1589 (description
1590 "The Guix Build Coordinator helps with performing lots of builds across
1591 potentially many machines, and with doing something with the results and
1592 outputs of those builds.
1593
1594 This package just includes the agent component.")))
1595
1596 (define-public guix-jupyter
1597 (package
1598 (name "guix-jupyter")
1599 (version "0.2.2")
1600 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
1601 (source (origin
1602 (method git-fetch)
1603 (uri (git-reference (url home-page)
1604 (commit (string-append "v" version))))
1605 (sha256
1606 (base32
1607 "17m6970wnvwlbarq4gxz5bakhzyhq5ch8qd8jw55ydccpv6473kq"))
1608 (file-name (string-append "guix-jupyter-" version "-checkout"))))
1609 (build-system gnu-build-system)
1610 (arguments
1611 `(#:modules ((srfi srfi-26)
1612 (ice-9 match)
1613 (ice-9 popen)
1614 (ice-9 rdelim)
1615 (guix build utils)
1616 (guix build gnu-build-system))
1617 #:parallel-tests? #f ;kernels.scm frequently breaks in parallel
1618 #:phases
1619 (modify-phases %standard-phases
1620 (add-after 'install 'sed-kernel-json
1621 (lambda* (#:key inputs outputs #:allow-other-keys)
1622 (let* ((out (assoc-ref outputs "out"))
1623 (guix (assoc-ref inputs "guix"))
1624 (guile (assoc-ref inputs "guile"))
1625 (json (assoc-ref inputs "guile-json"))
1626 (git (assoc-ref inputs "guile-git"))
1627 (bs (assoc-ref inputs "guile-bytestructures"))
1628 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
1629 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1630 (deps (list out s-zmq guix json git bs gcrypt))
1631 (effective
1632 (read-line
1633 (open-pipe* OPEN_READ
1634 (string-append guile "/bin/guile")
1635 "-c" "(display (effective-version))")))
1636 (path (map (cut string-append "-L\", \"" <>
1637 "/share/guile/site/"
1638 effective)
1639 deps))
1640 (gopath (map (cut string-append "-C\", \"" <>
1641 "/lib/guile/" effective
1642 "/site-ccache")
1643 deps))
1644 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
1645 (substitute* (string-append kernel-dir "kernel.json")
1646 (("-s")
1647 (string-join
1648 (list (string-join path "\",\n\t\t\"")
1649 (string-join gopath "\",\n\t\t\"")
1650 "-s")
1651 "\",\n\t\t\""))
1652 (("guix-jupyter-kernel.scm")
1653 (string-append out "/share/guile/site/3.0/"
1654 "guix-jupyter-kernel.scm")))
1655 #t))))))
1656 (native-inputs
1657 (list autoconf
1658 automake
1659 pkg-config
1660 ;; For testing.
1661 jupyter
1662 python-ipython
1663 python-ipykernel))
1664 (inputs
1665 `(("guix" ,guix)
1666 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
1667 (propagated-inputs
1668 (list guile-json-4 guile-simple-zmq guile-gcrypt))
1669 (synopsis "Guix kernel for Jupyter")
1670 (description
1671 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
1672 with information about their software dependencies, such that code is executed
1673 in the right software environment. Guix-Jupyter spawns the actual kernels
1674 such as @code{python-ipykernel} on behalf of the notebook user and runs them
1675 in an isolated environment, in separate namespaces.")
1676 (license license:gpl3+)))
1677
1678 (define-public nar-herder
1679 (let ((commit "5acfcc0a9d99d78a167c365534aa5bf592f5625e")
1680 (revision "9"))
1681 (package
1682 (name "nar-herder")
1683 (version (git-version "0" revision commit))
1684 (source (origin
1685 (method git-fetch)
1686 (uri (git-reference
1687 (url "https://git.cbaines.net/git/guix/nar-herder")
1688 (commit commit)))
1689 (sha256
1690 (base32
1691 "1mxdkay3l1la7b6m0455s8cansd6qcdhv0k231aik0ayhbck8kby"))
1692 (file-name (string-append name "-" version "-checkout"))))
1693 (build-system gnu-build-system)
1694 (arguments
1695 `(#:modules (((guix build guile-build-system)
1696 #:select (target-guile-effective-version))
1697 ,@%gnu-build-system-modules)
1698 #:imported-modules ((guix build guile-build-system)
1699 ,@%gnu-build-system-modules)
1700 #:phases
1701 (modify-phases %standard-phases
1702 (add-before 'build 'set-GUILE_AUTO_COMPILE
1703 (lambda _
1704 ;; To avoid warnings relating to 'guild'.
1705 (setenv "GUILE_AUTO_COMPILE" "0")))
1706 (add-after 'install 'wrap-executable
1707 (lambda* (#:key inputs outputs target #:allow-other-keys)
1708 (let* ((out (assoc-ref outputs "out"))
1709 (bin (string-append out "/bin"))
1710 (guile (assoc-ref inputs "guile"))
1711 (version (target-guile-effective-version))
1712 (scm (string-append out "/share/guile/site/" version))
1713 (go (string-append out "/lib/guile/" version "/site-ccache")))
1714 (for-each
1715 (lambda (file)
1716 (simple-format (current-error-port) "wrapping: ~A\n" file)
1717 (let ((guile-inputs (list
1718 "guile-json"
1719 "guile-gcrypt"
1720 "guix"
1721 "guile-lib"
1722 "guile-lzlib"
1723 "guile-prometheus"
1724 "guile-sqlite3"
1725 "guile-gnutls"
1726 "guile-fibers")))
1727 (wrap-program file
1728 `("GUILE_LOAD_PATH" ":" prefix
1729 (,scm ,(string-join
1730 (map (lambda (input)
1731 (string-append
1732 (assoc-ref inputs input)
1733 "/share/guile/site/"
1734 version))
1735 guile-inputs)
1736 ":")))
1737 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
1738 (,go ,(string-join
1739 (map (lambda (input)
1740 (string-append
1741 (assoc-ref inputs input)
1742 "/lib/guile/" version "/site-ccache"))
1743 guile-inputs)
1744 ":"))))))
1745 (find-files bin)))
1746 #t))
1747 (delete 'strip)))) ; As the .go files aren't compatible
1748 (native-inputs
1749 (list pkg-config
1750 autoconf
1751 automake
1752 guile-gnutls
1753
1754 ;; Guile libraries are needed here for cross-compilation.
1755 (car (assoc-ref (package-native-inputs guix) "guile"))
1756 guile-json-4
1757 guile-gcrypt
1758 guix
1759 guile-fibers-1.1
1760 guile-prometheus
1761 guile-lib
1762 guile-lzlib
1763 guile-sqlite3))
1764 (inputs
1765 (list bash-minimal
1766 (car (assoc-ref (package-native-inputs guix) "guile"))))
1767 (propagated-inputs
1768 (list guile-json-4
1769 guile-gcrypt
1770 guix
1771 guile-fibers-1.1
1772 guile-prometheus
1773 guile-lib
1774 guile-lzlib
1775 guile-sqlite3
1776 guile-gnutls))
1777 (home-page "https://git.cbaines.net/guix/nar-herder")
1778 (synopsis "Utility for managing and serving nars")
1779 (description
1780 "The Nar Herder is a utility for managing a collection of
1781 nars (normalized archives, in the context of Guix) along with the
1782 corresponding narinfo files which contain some signed metadata.
1783
1784 It can assist in serving a collection of nars, moving them between machines,
1785 or mirroring an existing collection of nars.
1786
1787 It's currently a working prototype, many designed features aren't implemented,
1788 and the error handling is very rough.")
1789 (license license:agpl3+))))
1790
1791 (define-public gcab
1792 (package
1793 (name "gcab")
1794 (version "1.4")
1795 (source (origin
1796 (method url-fetch)
1797 (uri (string-append "mirror://gnome/sources/gcab/"
1798 version "/gcab-" version ".tar.xz"))
1799 (sha256
1800 (base32
1801 "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7"))))
1802 (build-system meson-build-system)
1803 (native-inputs
1804 `(("glib:bin" ,glib "bin") ; for glib-mkenums
1805 ("intltool" ,intltool)
1806 ("pkg-config" ,pkg-config)
1807 ("vala" ,vala)))
1808 (inputs
1809 (list glib zlib))
1810 (arguments
1811 `(#:configure-flags
1812 ;; XXX This ‘documentation’ is for developers, and fails informatively:
1813 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
1814 (list "-Ddocs=false"
1815 "-Dintrospection=false")))
1816 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
1817 (synopsis "Microsoft Cabinet file manipulation library")
1818 (description
1819 "The libgcab library provides GObject functions to read, write, and modify
1820 Microsoft cabinet (.@dfn{CAB}) files.")
1821 (license (list license:gpl2+ ; tests/testsuite.at
1822 license:lgpl2.1+)))) ; the rest
1823
1824 (define-public msitools
1825 (package
1826 (name "msitools")
1827 (version "0.100")
1828 (source (origin
1829 (method url-fetch)
1830 (uri (string-append "mirror://gnome/sources/msitools/"
1831 version "/msitools-" version ".tar.xz"))
1832 (sha256
1833 (base32
1834 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
1835 (build-system gnu-build-system)
1836 (native-inputs
1837 (list bison pkg-config))
1838 (inputs
1839 (list gcab glib libgsf libxml2
1840 `(,util-linux "lib")))
1841 (home-page "https://wiki.gnome.org/msitools")
1842 (synopsis "Windows Installer file manipulation tool")
1843 (description
1844 "msitools is a collection of command-line tools to inspect, extract, build,
1845 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
1846 for packaging and deployment of cross-compiled Windows applications.")
1847 (license license:lgpl2.1+)))
1848
1849 (define-public libostree
1850 (package
1851 (name "libostree")
1852 (version "2022.6")
1853 (source
1854 (origin
1855 (method url-fetch)
1856 (uri (string-append
1857 "https://github.com/ostreedev/ostree/releases/download/v"
1858 (version-major+minor version) "/libostree-" version ".tar.xz"))
1859 (sha256
1860 (base32 "135dzxqzy19a8hkxm25mriy7zf72sbxz1mzzfw6a2d8bk9yz8pl3"))))
1861 (build-system gnu-build-system)
1862 (arguments
1863 '(#:phases
1864 (modify-phases %standard-phases
1865 (add-before 'check 'pre-check
1866 (lambda _
1867 ;; Don't try to use the non-existing '/var/tmp' as test
1868 ;; directory.
1869 (setenv "TEST_TMPDIR" (getenv "TMPDIR")))))
1870 ;; XXX: fails with:
1871 ;; tap-driver.sh: missing test plan
1872 ;; tap-driver.sh: internal error getting exit status
1873 ;; tap-driver.sh: fatal: I/O or internal error
1874 #:tests? #f))
1875 (native-inputs
1876 (list attr ; for tests
1877 bison
1878 `(,glib "bin") ; for 'glib-mkenums'
1879 gobject-introspection
1880 pkg-config
1881 libxslt))
1882 (inputs
1883 (list avahi
1884 docbook-xml
1885 docbook-xsl
1886 e2fsprogs
1887 fuse
1888 glib
1889 gpgme
1890 libarchive
1891 libsoup-minimal-2 ; needs libsoup-2.4
1892 util-linux))
1893 (home-page "https://ostree.readthedocs.io/en/latest/")
1894 (synopsis "Operating system and container binary deployment and upgrades")
1895 (description
1896 "@code{libostree} is both a shared library and suite of command line
1897 tools that combines a \"git-like\" model for committing and downloading
1898 bootable file system trees, along with a layer for deploying them and managing
1899 the boot loader configuration.")
1900 (license license:lgpl2.0+)))
1901
1902 (define-public flatpak
1903 (package
1904 (name "flatpak")
1905 (version "1.14.0")
1906 (source
1907 (origin
1908 (method url-fetch)
1909 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
1910 version "/flatpak-" version ".tar.xz"))
1911 (sha256
1912 (base32 "05bqy9kwmaj32y7f94fydcz3k63bsgn4mbcp4pglv8hffxrnj9wf"))
1913 (patches
1914 (search-patches "flatpak-fix-path.patch"
1915 "flatpak-unset-gdk-pixbuf-for-sandbox.patch"))))
1916
1917 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1918 ;; find the TLS backend in glib-networking.
1919 (build-system glib-or-gtk-build-system)
1920
1921 (arguments
1922 (list
1923 #:configure-flags
1924 #~(list
1925 "--enable-documentation=no" ;; FIXME
1926 "--enable-system-helper=no"
1927 "--localstatedir=/var"
1928 (string-append "--with-system-bubblewrap="
1929 (assoc-ref %build-inputs "bubblewrap")
1930 "/bin/bwrap")
1931 (string-append "--with-system-dbus-proxy="
1932 (assoc-ref %build-inputs "xdg-dbus-proxy")
1933 "/bin/xdg-dbus-proxy"))
1934 #:phases
1935 #~(modify-phases %standard-phases
1936 (add-after 'unpack 'fix-tests
1937 (lambda* (#:key inputs #:allow-other-keys)
1938 (copy-recursively
1939 (search-input-directory inputs "lib/locale")
1940 "/tmp/locale")
1941 (for-each make-file-writable (find-files "/tmp"))
1942 (substitute* "tests/make-test-runtime.sh"
1943 (("cp `which.*") "echo guix\n")
1944 (("cp -r /usr/lib/locale/C\\.\\*")
1945 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
1946 cp -r /tmp/locale/*/en_US.*")))
1947 (substitute* "tests/libtest.sh"
1948 (("/bin/kill") (which "kill"))
1949 (("/usr/bin/python3") (which "python3")))
1950 #t))
1951 (add-after 'unpack 'p11-kit-fix
1952 (lambda* (#:key inputs #:allow-other-keys)
1953 (let ((p11-path (search-input-file inputs "/bin/p11-kit")))
1954 (substitute* "session-helper/flatpak-session-helper.c"
1955 (("\"p11-kit\",")
1956 (string-append "\"" p11-path "\","))
1957 (("if \\(g_find_program_in_path \\(\"p11-kit\"\\)\\)")
1958 (string-append "if (g_find_program_in_path (\""
1959 p11-path "\"))"))))))
1960 ;; Many tests fail for unknown reasons, so we just run a few basic
1961 ;; tests.
1962 (replace 'check
1963 (lambda _
1964 (setenv "HOME" "/tmp")
1965 (invoke "make" "check"
1966 "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
1967 (native-inputs
1968 (list bison
1969 dbus ; for dbus-daemon
1970 gettext-minimal
1971 `(,glib "bin") ; for glib-mkenums + gdbus-codegen
1972 glibc-utf8-locales
1973 gobject-introspection
1974 libcap
1975 pkg-config
1976 python
1977 python-pyparsing
1978 socat
1979 which))
1980 (inputs
1981 (list appstream
1982 appstream-glib
1983 bubblewrap
1984 curl
1985 dconf
1986 fuse
1987 gdk-pixbuf
1988 gpgme
1989 json-glib
1990 libarchive
1991 libostree
1992 libseccomp
1993 libsoup-minimal-2
1994 libxau
1995 libxml2
1996 p11-kit-next
1997 util-linux
1998 xdg-dbus-proxy))
1999 (propagated-inputs (list glib-networking gnupg gsettings-desktop-schemas))
2000 (home-page "https://flatpak.org")
2001 (synopsis "System for building, distributing, and running sandboxed desktop
2002 applications")
2003 (description "Flatpak is a system for building, distributing, and running
2004 sandboxed desktop applications on GNU/Linux.")
2005 (license license:lgpl2.1+)))
2006
2007 (define-public akku
2008 (package
2009 (name "akku")
2010 (version "1.1.0")
2011 (source (origin
2012 (method git-fetch)
2013 (uri (git-reference
2014 (url "https://gitlab.com/akkuscm/akku.git")
2015 (commit (string-append "v" version))))
2016 (file-name (git-file-name name version))
2017 (sha256 (base32 "1pi18aamg1fd6f9ynfl7zx92052xzf0zwmhi2pwcwjs1kbah19f5"))))
2018 (build-system gnu-build-system)
2019 (arguments
2020 '(#:phases (modify-phases %standard-phases
2021 (replace 'bootstrap
2022 (lambda* (#:key outputs #:allow-other-keys)
2023 (for-each patch-shebang
2024 '("bootstrap"
2025 ".akku/env"))
2026 (let* ((home "/tmp")
2027 (datadir (string-append home "/.local/share/akku/")))
2028 (mkdir-p datadir)
2029 (invoke "touch" (string-append datadir "index.db"))
2030 (setenv "HOME" home))
2031 (invoke "./bootstrap")
2032 #t))
2033 (add-after 'install 'wrap-executables
2034 (lambda* (#:key outputs inputs #:allow-other-keys)
2035 (let ((out (assoc-ref outputs "out"))
2036 (curl (assoc-ref inputs "curl")))
2037 (wrap-program (string-append out "/bin/akku")
2038 `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
2039 #t))))))
2040 (native-inputs
2041 (list which autoconf automake pkg-config))
2042 (inputs
2043 (list guile-3.0 curl))
2044 (home-page "https://akkuscm.org/")
2045 (synopsis "Language package manager for Scheme")
2046 (description
2047 "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
2048 It is mainly meant for programmers who develop portable programs or libraries in Scheme,
2049 but could potentially work for end-users of those programs. It also has a translator
2050 from R7RS, which allows most R7RS code to run on R6RS implementations.")
2051 (license license:gpl3+)))
2052
2053 (define-public modules
2054 (package
2055 (name "modules")
2056 (version "4.8.0")
2057 (source
2058 (origin
2059 (method url-fetch)
2060 (uri (string-append "mirror://sourceforge/modules/Modules/modules-"
2061 version "/modules-" version ".tar.bz2"))
2062 (sha256 (base32 "1amz8qdqbvfdc8jv0j4720vywbz2gi7l3sr1lh37ilfbxy9lq9g9"))))
2063 (build-system gnu-build-system)
2064 (arguments
2065 `(#:configure-flags
2066 (list (string-append "--with-bin-search-path="
2067 (assoc-ref %build-inputs "tcl") "/bin" ":"
2068 (assoc-ref %build-inputs "procps") "/bin" ":"
2069 (assoc-ref %build-inputs "less") "/bin" ":"
2070 (assoc-ref %build-inputs "coreutils") "/bin")
2071 (string-append "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib")
2072 "--disable-compat-version")
2073 #:test-target "test"
2074 #:phases
2075 (modify-phases %standard-phases
2076 (add-before 'configure 'patch-add-modules
2077 (lambda* (#:key inputs #:allow-other-keys)
2078 (let ((coreutils (assoc-ref inputs "coreutils")))
2079 (substitute* "script/add.modules.in"
2080 (("/bin/(cat|cp|rm)" _ command)
2081 (string-append coreutils "/bin/" command))
2082 (("/bin/echo")
2083 "echo")))))
2084 (add-before 'configure 'patch-scripts-for-python-3
2085 (lambda _
2086 ;; Patch the script for python-3.
2087 (substitute* "script/createmodule.py.in"
2088 (("pathkeys.sort\\(\\)") "pathkeys = sorted(pathkeys)")
2089 (("print\\(\"\\\\t\"\\*") "print(\"\\t\"*int")
2090 (("@PYTHON@") (which "python3")))))
2091 (add-before 'check 'patch-/bin/sh-and-nixbld-groups-in-tests
2092 (lambda _
2093 (use-modules (srfi srfi-1))
2094 (let* ((groups-file (string-append (getcwd) "/nixbld-groups"))
2095 (groups-file-z (string-append groups-file "-z"))
2096 (nixbld-groups
2097 (fold
2098 (lambda (id prev)
2099 (catch #t
2100 (lambda () (cons (group:name (getgrnam id)) prev))
2101 (lambda _ prev)))
2102 '()
2103 (vector->list (getgroups)))))
2104 ;; Simulate "id -G -n" command output.
2105 (call-with-output-file groups-file
2106 (lambda (port)
2107 (display (string-join nixbld-groups " ") port)
2108 (display #\newline port)))
2109 ;; Simulate "id -G -n -z" command output.
2110 (call-with-output-file groups-file-z
2111 (lambda (port)
2112 (for-each
2113 (lambda (group-name)
2114 (display group-name port)
2115 (display #\null port))
2116 nixbld-groups)))
2117 ;; Generate "modulecmd-test.tcl" before running "make test".
2118 (invoke "make" "modulecmd-test.tcl")
2119 ;; Substitute shell.
2120 (substitute*
2121 '("modulecmd-test.tcl"
2122 "modulecmd.tcl"
2123 "testsuite/modules.70-maint/380-edit.exp"
2124 "compat/init/filter")
2125 (("/bin/sh") (which "sh")))
2126 ;; Skip tests that use supplementary groups.
2127 (for-each
2128 delete-file
2129 '("testsuite/modules.20-locate/112-hide-user-group.exp"
2130 "testsuite/modules.20-locate/117-forbid-user-group.exp"
2131 "testsuite/modules.20-locate/119-hide-cascading.exp"
2132 "testsuite/modules.50-cmds/140-system.exp"
2133 "testsuite/modules.50-cmds/287-info-usergroups.exp"
2134 "testsuite/modules.50-cmds/440-module-tag.exp"
2135 "testsuite/modules.70-maint/220-config.exp"))
2136 (for-each
2137 (lambda (file)
2138 (substitute* file
2139 (("/bin/sh") (which "bash"))
2140 ;; For some reason "kvm" group cannot be resolved for
2141 ;; "nixbld" user. We replace "id ..." commands with
2142 ;; "cat ..." that simulates them.
2143 (("exec id -G -n -z") (string-append "exec cat " groups-file-z))
2144 (("exec id -G -n") (string-append "exec cat " groups-file))))
2145 '("testsuite/modules.00-init/005-init_ts.exp"
2146 "testsuite/install.00-init/005-init_ts.exp"
2147 "modulecmd-test.tcl"))))))))
2148 (native-inputs
2149 (list dejagnu autoconf which))
2150 (inputs
2151 (list tcl less procps coreutils python-3))
2152 (home-page "http://modules.sourceforge.net/")
2153 (synopsis "Shell environment variables and aliases management")
2154 (description "Modules simplify shell initialization and let users
2155 modify their environment during the session with modulefiles. Modules are
2156 used on high-performance clusters to dynamically add and remove paths
2157 to specific versions of applications.")
2158 (license license:gpl2+)))