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