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