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