gnu: guix: Update to 44c6e6f.
[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
TGR
570 (arguments
571 `(#:configure-flags
572 (list "--sysconfdir=/etc")
573 #:phases
574 (modify-phases %standard-phases
575 (replace 'install
576 ;; Don't try & fail to create subdirectories in /etc, but keep them
577 ;; in the output as examples.
578 (lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
579 (let* ((out (assoc-ref outputs "out"))
580 (etc (string-append out "/etc")))
581 (apply invoke "make" "install"
582 (string-append "sysconfdir=" etc)
583 (string-append "profiledir=" etc "/profile.d")
584 make-flags)))))))
e6c8199b 585 (native-inputs `(("pkg-config" ,pkg-config)))
13c18af1
GL
586 (inputs `(("boost" ,boost)
587 ("brotli" ,brotli)
e6c8199b 588 ("bzip2" ,bzip2)
13c18af1
GL
589 ("curl" ,curl)
590 ("editline" ,editline)
fcb0109d 591 ("libgc" ,libgc)
e6c8199b
SB
592 ("libseccomp" ,libseccomp)
593 ("libsodium" ,libsodium)
594 ("openssl" ,openssl)
fcb0109d 595 ("sqlite" ,sqlite)
e6c8199b 596 ("xz" ,xz)))
775989c7 597 (home-page "https://nixos.org/nix/")
fcb0109d
LC
598 (synopsis "The Nix package manager")
599 (description
600 "Nix is a purely functional package manager. This means that it treats
601packages like values in purely functional programming languages such as
602Haskell—they are built by functions that don't have side-effects, and they
603never change after they have been built. Nix stores packages in the Nix
604store, usually the directory /nix/store, where each package has its own unique
605sub-directory.")
7ed6343f 606 (license license:lgpl2.1+)))
a881a40c 607
8d422e25
RW
608(define-public stow
609 (package
610 (name "stow")
7cc98992 611 (version "2.3.1")
8d422e25
RW
612 (source (origin
613 (method url-fetch)
614 (uri (string-append "mirror://gnu/stow/stow-"
615 version ".tar.gz"))
616 (sha256
617 (base32
7cc98992 618 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
8d422e25
RW
619 (build-system gnu-build-system)
620 (inputs
7cc98992 621 `(("perl" ,perl)))
8d422e25
RW
622 (native-inputs
623 `(("perl-test-simple" ,perl-test-simple)
624 ("perl-test-output" ,perl-test-output)
ddfd70da
LC
625 ("perl-capture-tiny" ,perl-capture-tiny)
626 ("perl-io-stringy" ,perl-io-stringy)))
8d422e25
RW
627 (home-page "https://www.gnu.org/software/stow/")
628 (synopsis "Managing installed software packages")
629 (description
630 "GNU Stow is a symlink manager. It generates symlinks to directories
631of data and makes them appear to be merged into the same directory. It is
632typically used for managing software packages installed from source, by
633letting you install them apart in distinct directories and then create
634symlinks to the files in a common directory such as /usr/local.")
bdb51ed6 635 (license license:gpl3+)))
e3e1ecf6
LC
636
637(define-public rpm
638 (package
639 (name "rpm")
c0023514 640 (version "4.14.2.1")
e3e1ecf6
LC
641 (source (origin
642 (method url-fetch)
623cc34c
EB
643 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
644 (version-major+minor version) ".x/rpm-"
e3e1ecf6
LC
645 version ".tar.bz2"))
646 (sha256
647 (base32
c0023514 648 "1nmck2fq9h85fgs3zhh6w1avlw5y16cbz5khd459ry3jfd5w4f8i"))))
e3e1ecf6
LC
649 (build-system gnu-build-system)
650 (arguments
651 '(#:configure-flags '("--with-external-db" ;use the system's bdb
652 "--enable-python"
653 "--without-lua")
654 #:phases (modify-phases %standard-phases
91a3c800 655 (add-before 'configure 'set-nss-library-path
e3e1ecf6 656 (lambda* (#:key inputs #:allow-other-keys)
91a3c800 657 (let ((nss (assoc-ref inputs "nss")))
e3e1ecf6
LC
658 (setenv "LIBRARY_PATH"
659 (string-append (getenv "LIBRARY_PATH") ":"
660 nss "/lib/nss"))
91a3c800 661 #t))))))
e3e1ecf6
LC
662 (native-inputs
663 `(("pkg-config" ,pkg-config)))
664 (inputs
c0023514 665 `(("python" ,python)
e3e1ecf6
LC
666 ("xz" ,xz)
667 ("bdb" ,bdb)
668 ("popt" ,popt)
669 ("nss" ,nss)
670 ("nspr" ,nspr)
671 ("libarchive" ,libarchive)
e3e1ecf6
LC
672 ("file" ,file)
673 ("bzip2" ,bzip2)
674 ("zlib" ,zlib)
675 ("cpio" ,cpio)))
c0023514 676 (home-page "https://rpm.org/")
e3e1ecf6
LC
677 (synopsis "The RPM Package Manager")
678 (description
679 "The RPM Package Manager (RPM) is a command-line driven package
680management system capable of installing, uninstalling, verifying, querying,
681and updating computer software packages. Each software package consists of an
682archive of files along with information about the package like its version, a
683description. There is also a library permitting developers to manage such
684transactions from C or Python.")
685
686 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
7ed6343f 687 (license license:gpl2+)))
e3e1ecf6 688
513d35f1
MFM
689(define-public python-anaconda-client
690 (package
691 (name "python-anaconda-client")
692 (version "1.6.3")
693 (source
694 (origin
837da4d3
EF
695 (method git-fetch)
696 (uri (git-reference
697 (url "https://github.com/Anaconda-Platform/anaconda-client")
698 (commit version)))
699 (file-name (git-file-name name version))
513d35f1
MFM
700 (sha256
701 (base32
837da4d3 702 "0w1bfxnydjl9qp53r2gcvr6vlpdqqilcrzqxrll9sgg6vwdyiyyp"))))
513d35f1
MFM
703 (build-system python-build-system)
704 (propagated-inputs
705 `(("python-pyyaml" ,python-pyyaml)
706 ("python-requests" ,python-requests)
707 ("python-clyent" ,python-clyent)))
708 (native-inputs
709 `(("python-pytz" ,python-pytz)
710 ("python-dateutil" ,python-dateutil)
711 ("python-mock" ,python-mock)
712 ("python-coverage" ,python-coverage)
713 ("python-pillow" ,python-pillow)))
714 (arguments
715 `(#:phases
716 (modify-phases %standard-phases
717 ;; This is needed for some tests.
718 (add-before 'check 'set-up-home
719 (lambda* _ (setenv "HOME" "/tmp") #t))
720 (add-before 'check 'remove-network-tests
721 (lambda* _
722 ;; Remove tests requiring a network connection
723 (let ((network-tests '("tests/test_upload.py"
724 "tests/test_authorizations.py"
725 "tests/test_login.py"
726 "tests/test_whoami.py"
727 "utils/notebook/tests/test_data_uri.py"
728 "utils/notebook/tests/test_base.py"
729 "utils/notebook/tests/test_downloader.py"
730 "inspect_package/tests/test_conda.py")))
731 (with-directory-excursion "binstar_client"
732 (for-each delete-file network-tests)))
733 #t)))))
734 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
735 (synopsis "Anaconda Cloud command line client library")
736 (description
737 "Anaconda Cloud command line client library provides an interface to
738Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
739environments.")
7ed6343f 740 (license license:bsd-3)))
513d35f1
MFM
741
742(define-public python2-anaconda-client
743 (package-with-python2 python-anaconda-client))
4bc08b6e 744
c9a16728
RW
745(define-public python-conda-package-handling
746 (package
747 (name "python-conda-package-handling")
748 (version "1.6.0")
749 (source
750 (origin
751 (method git-fetch)
752 (uri (git-reference
753 (url "https://github.com/conda/conda-package-handling/")
754 (commit version)))
755 (file-name (git-file-name name version))
756 (sha256
757 (base32
758 "0bqbs6a8jbjmbn47n5n1p529cx7pf4vgfnhqca9mflgidfb5i0jf"))))
759 (build-system python-build-system)
760 (arguments
761 `(#:phases
762 (modify-phases %standard-phases
763 (add-after 'unpack 'use-unmodified-libarchive
764 (lambda _
765 (substitute* "setup.py"
766 (("archive_and_deps") "archive"))
767 #t))
768 (replace 'check
769 (lambda* (#:key inputs outputs #:allow-other-keys)
770 (add-installed-pythonpath inputs outputs)
771 (invoke "pytest" "-vv" "tests"
772 "-k"
773 (string-append
774 ;; TODO: these three fail because the mocker fixture
775 ;; cannot be found
776 "not test_rename_to_trash"
777 " and not test_api_extract_tarball_with_libarchive_import_error"
778 " and not test_delete_trash"
779 ;; TODO: this one does not raise an exception when it
780 ;; should.
781 " and not test_secure_refusal_to_extract_abs_paths")))))))
782 (propagated-inputs
783 `(("python-six" ,python-six)
784 ("python-tqdm" ,python-tqdm)))
785 (inputs
786 `(("libarchive" ,libarchive)))
787 (native-inputs
788 `(("python-cython" ,python-cython)
789 ("python-pytest" ,python-pytest)
790 ("python-pytest-cov" ,python-pytest-cov)
791 ("python-mock" ,python-mock)))
792 (home-page "https://conda.io")
793 (synopsis "Create and extract conda packages of various formats")
794 (description
795 "This library is an abstraction of Conda package handling and a tool for
796extracting, creating, and converting between formats.")
797 (license license:bsd-3)))
798
638ef1e8 799(define-public conda
4bc08b6e 800 (package
638ef1e8
RW
801 (name "conda")
802 (version "4.8.3")
4bc08b6e
MFM
803 (source
804 (origin
6def31e8
EF
805 (method git-fetch)
806 (uri (git-reference
807 (url "https://github.com/conda/conda")
808 (commit version)))
809 (file-name (git-file-name name version))
4bc08b6e
MFM
810 (sha256
811 (base32
638ef1e8 812 "0iv1qzk21jsk6vdp3106xvpvl68zgfdqb3kyzpya87jhkl204l7r"))))
4bc08b6e
MFM
813 (build-system python-build-system)
814 (arguments
815 `(#:phases
816 (modify-phases %standard-phases
638ef1e8
RW
817 (add-after 'unpack 'fix-permissions
818 (lambda _
819 ;; This file is no longer writable after downloading with
820 ;; 'git-fetch'
821 (make-file-writable
822 "tests/conda_env/support/saved-env/environment.yml")
823 #t))
824 (add-after 'unpack 'correct-python-executable-name
825 (lambda* (#:key inputs #:allow-other-keys)
826 (let ((python (assoc-ref inputs "python-wrapper")))
827 #;
828 (substitute* "conda/common/path.py"
829 (("python_version or ''")
830 "python_version or '3'"))
831 (substitute* "conda/core/initialize.py"
832 (("python_exe = join")
833 (format #f "python_exe = \"~a/bin/python\" #"
834 python))))
835 #t))
836 (add-after 'unpack 'do-not-use-python-root-as-prefix
837 (lambda* (#:key inputs outputs #:allow-other-keys)
838 (let ((out (assoc-ref outputs "out"))
839 (python (assoc-ref inputs "python-wrapper")))
840 (substitute* "tests/core/test_initialize.py"
841 (("\"\"\"\\) % conda_prefix")
842 (format #f "\"\"\") % \"~a\"" python))
843 (("CONDA_PYTHON_EXE \"%s\"' % join\\(conda_prefix")
844 (format #f "CONDA_PYTHON_EXE \"%s\"' % join(\"~a\""
845 python))
846 (("conda_prefix = abspath\\(sys.prefix\\)")
847 (format #f "conda_prefix = abspath(\"~a\")" out)))
848 (substitute* "conda/base/context.py"
849 (("os.chdir\\(sys.prefix\\)")
850 (format #f "os.chdir(\"~a\")" out))
851 (("sys.prefix, '.condarc'")
852 (format #f "\"~a\", '.condarc'" out))
853 (("return abspath\\(sys.prefix\\)")
854 (format #f "return abspath(\"~a\")" out))
855 (("os.path.join\\(sys.prefix, bin_dir, exe\\)")
856 (format #f "\"~a/bin/conda\"" out))
857 (("'CONDA_EXE', sys.executable")
858 (format #f "'CONDA_EXE', \"~a/bin/conda\"" out))))
859 #t))
4bc08b6e
MFM
860 (add-before 'build 'create-version-file
861 (lambda _
862 (with-output-to-file "conda/.version"
863 (lambda () (display ,version)))
864 #t))
4bc08b6e
MFM
865 (replace 'check
866 (lambda _
867 (setenv "HOME" "/tmp")
638ef1e8
RW
868 (invoke "py.test" "-vv"
869 "-k"
870 (string-append
871 "not integration"
872 ;; This one reports a newer version of conda than
873 ;; expected.
874 " and not test_auto_update_conda"
875 ;; This fails because the output directory is not a
876 ;; Conda environment.
877 " and not test_list"
878 ;; This fails because we patched the default root
879 ;; prefix.
880 " and not test_default_target_is_root_prefix"
881 ;; TODO: I don't understand what this failure means
882 " and not test_PrefixData_return_value_contract"
883 ;; TODO: same here
884 " and not test_install_1"
885 ;; Not sure if this is really wrong. This fails because
886 ;; /gnu/store/...python-conda-4.8.3/bin/python
887 ;; is not /gnu/store/...python-wrapper-3.8.2/bin/python
888 " and not test_make_entry_point"))))
889 (add-after 'install 'init
890 ;; This writes a whole bunch of shell initialization files to the
891 ;; prefix directory. Many features of conda can only be used after
892 ;; running "conda init".
893 (lambda* (#:key inputs outputs #:allow-other-keys)
894 (add-installed-pythonpath inputs outputs)
895 (setenv "HOME" "/tmp")
896
897 ;; "conda init" insists on using sudo, because it is hell-bent on
898 ;; modifying system files.
899 (mkdir-p "/tmp/fake-sudo")
900 (with-output-to-file "/tmp/fake-sudo/sudo"
901 (lambda () (format #t "#!~/bin/sh~%exec $@" (which "sh"))))
902 (chmod "/tmp/fake-sudo/sudo" #o700)
903 (setenv "PATH" (string-append "/tmp/fake-sudo:"
904 (getenv "PATH")))
905
906 (invoke (string-append (assoc-ref outputs "out")
907 "/bin/conda")
908 "init"))))))
909 (inputs
910 `(("python-wrapper" ,python-wrapper)))
911 (propagated-inputs
912 `(("python-anaconda-client" ,python-anaconda-client)
913 ("python-conda-package-handling" ,python-conda-package-handling)
914 ("python-cytoolz" ,python-cytoolz)
4bc08b6e
MFM
915 ("python-pycosat" ,python-pycosat)
916 ("python-pytest" ,python-pytest)
4bc08b6e 917 ("python-pyyaml" ,python-pyyaml)
638ef1e8
RW
918 ("python-requests" ,python-requests)
919 ("python-responses" ,python-responses)
920 ("python-ruamel.yaml" ,python-ruamel.yaml)
921 ("python-tqdm" ,python-tqdm)
922 ;; XXX: This is dragged in by libarchive and is needed at runtime.
923 ("zstd" ,zstd)))
4bc08b6e
MFM
924 (home-page "https://github.com/conda/conda")
925 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
926 (description
927 "Conda is a cross-platform, Python-agnostic binary package manager. It
928is the package manager used by Anaconda installations, but it may be used for
929other systems as well. Conda makes environments first-class citizens, making
930it easy to create independent environments even for C libraries. Conda is
638ef1e8 931written entirely in Python.")
7ed6343f 932 (license license:bsd-3)))
4bc08b6e 933
638ef1e8
RW
934(define-public python-conda
935 (deprecated-package "python-conda" conda))
58a308e0
RJ
936
937(define-public gwl
938 (package
939 (name "gwl")
efb98dd0 940 (version "0.2.1")
58a308e0
RJ
941 (source (origin
942 (method url-fetch)
598ea80f 943 (uri (string-append "mirror://gnu/gwl/gwl-" version ".tar.gz"))
58a308e0
RJ
944 (sha256
945 (base32
efb98dd0 946 "1ji5jvzni8aml9fmimlr11g3k8isrnlvnbzhmwgdjh72hils0alc"))))
58a308e0 947 (build-system gnu-build-system)
efb98dd0
RW
948 (arguments
949 `(#:phases
950 (modify-phases %standard-phases
951 (add-before 'build 'fix-tests
952 (lambda _
953 ;; Avoid cross-device link.
954 (substitute* "tests/cache.scm"
955 (("/tmp/gwl-test-input-XXXXXX")
956 (string-append (getcwd) "/gwl-test-input-XXXXXX")))
957 #t)))))
58a308e0
RJ
958 (native-inputs
959 `(("autoconf" ,autoconf)
960 ("automake" ,automake)
598ea80f
RW
961 ("pkg-config" ,pkg-config)
962 ("texinfo" ,texinfo)
963 ("graphviz" ,graphviz)))
58a308e0 964 (inputs
a2991de0 965 `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
58a308e0 966 (propagated-inputs
b6bee63b
LC
967 `(("guix" ,guix)
968 ("guile-commonmark" ,guile-commonmark)
969 ("guile-gcrypt" ,guile-gcrypt)
970 ("guile-pfds" ,guile-pfds)
971 ("guile-syntax-highlight" ,guile-syntax-highlight)
972 ("guile-wisp" ,guile-wisp)))
598ea80f 973 (home-page "https://workflows.guix.info")
58a308e0 974 (synopsis "Workflow management extension for GNU Guix")
598ea80f
RW
975 (description "The @dfn{Guix Workflow Language} (GWL) provides an
976extension to GNU Guix's declarative language for package management to
977automate the execution of programs in scientific workflows. The GWL
978can use process engines to integrate with various computing
979environments.")
58a308e0
RJ
980 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
981 ;; the web interface modules in gwl/ are licensed AGPL3+,
982 ;; and the fonts included in this package are licensed OFL1.1.
7ed6343f 983 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
98a11b7f 984
fc1fe722
LC
985(define-public guix-jupyter
986 (package
987 (name "guix-jupyter")
988 (version "0.1.0")
989 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
990 (source (origin
991 (method git-fetch)
992 (uri (git-reference (url home-page)
993 (commit (string-append "v" version))))
994 (sha256
995 (base32
996 "01z7jjkc7r7lj6637rcgpz40v8xqqyfp6871h94yvcnwm7zy9h1n"))
b6bee63b
LC
997 (modules '((guix build utils)))
998 (snippet
999 '(begin
1000 ;; Allow builds with Guile 3.0.
1001 (substitute* "configure.ac"
1002 (("^GUILE_PKG.*")
1003 "GUILE_PKG([3.0 2.2])\n"))
1004 #t))
fc1fe722
LC
1005 (file-name (string-append "guix-jupyter-" version "-checkout"))))
1006 (build-system gnu-build-system)
1007 (arguments
1008 `(#:modules ((srfi srfi-26)
1009 (ice-9 match)
1010 (ice-9 popen)
1011 (ice-9 rdelim)
1012 (guix build utils)
1013 (guix build gnu-build-system))
1014 #:phases
1015 (modify-phases %standard-phases
1016 (add-after 'install 'sed-kernel-json
1017 (lambda* (#:key inputs outputs #:allow-other-keys)
1018 (let* ((out (assoc-ref outputs "out"))
1019 (guix (assoc-ref inputs "guix"))
1020 (guile (assoc-ref inputs "guile"))
1021 (json (assoc-ref inputs "guile-json"))
1022 (git (assoc-ref inputs "guile-git"))
1023 (bs (assoc-ref inputs "guile-bytestructures"))
1024 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
1025 (gcrypt (assoc-ref inputs "guile-gcrypt"))
1026 (deps (list out s-zmq guix json git bs gcrypt))
1027 (effective
1028 (read-line
1029 (open-pipe* OPEN_READ
1030 (string-append guile "/bin/guile")
1031 "-c" "(display (effective-version))")))
1032 (path (map (cut string-append "-L\", \"" <>
1033 "/share/guile/site/"
1034 effective)
1035 deps))
1036 (gopath (map (cut string-append "-C\", \"" <>
1037 "/lib/guile/" effective
1038 "/site-ccache")
1039 deps))
1040 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
1041 (substitute* (string-append kernel-dir "kernel.json")
1042 (("-s")
1043 (string-join
1044 (list (string-join path "\",\n\t\t\"")
1045 (string-join gopath "\",\n\t\t\"")
1046 "-s")
1047 "\",\n\t\t\""))
1048 (("guix-jupyter-kernel.scm")
3a27a3dc 1049 (string-append out "/share/guile/site/3.0/"
fc1fe722
LC
1050 "guix-jupyter-kernel.scm")))
1051 #t))))))
1052 (native-inputs
1053 `(("autoconf" ,autoconf)
1054 ("automake" ,automake)
1055 ("pkg-config" ,pkg-config)
1056
1057 ;; For testing.
d3650775
LC
1058 ("jupyter" ,jupyter)
1059 ("python-ipython" ,python-ipython)
1060 ("python-ipykernel" ,python-ipykernel)))
fc1fe722
LC
1061 (inputs
1062 `(("guix" ,guix)
a2991de0 1063 ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
fc1fe722 1064 (propagated-inputs
8f7cf3b5 1065 `(("guile-json" ,guile-json-4)
fc1fe722
LC
1066 ("guile-simple-zmq" ,guile-simple-zmq)
1067 ("guile-gcrypt" ,guile-gcrypt)))
1068 (synopsis "Guix kernel for Jupyter")
1069 (description
1070 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
1071with information about their software dependencies, such that code is executed
1072in the right software environment. Guix-Jupyter spawns the actual kernels
1073such as @code{python-ipykernel} on behalf of the notebook user and runs them
1074in an isolated environment, in separate namespaces.")
1075 (license license:gpl3+)))
1076
98a11b7f
TGR
1077(define-public gcab
1078 (package
1079 (name "gcab")
78a684f5 1080 (version "1.4")
98a11b7f
TGR
1081 (source (origin
1082 (method url-fetch)
41eac186
TGR
1083 (uri (string-append "mirror://gnome/sources/gcab/"
1084 version "/gcab-" version ".tar.xz"))
98a11b7f
TGR
1085 (sha256
1086 (base32
78a684f5 1087 "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7"))))
44118720 1088 (build-system meson-build-system)
98a11b7f 1089 (native-inputs
44118720
TGR
1090 `(("glib:bin" ,glib "bin") ; for glib-mkenums
1091 ("intltool" ,intltool)
1092 ("pkg-config" ,pkg-config)
1093 ("vala" ,vala)))
98a11b7f
TGR
1094 (inputs
1095 `(("glib" ,glib)
1096 ("zlib" ,zlib)))
44118720
TGR
1097 (arguments
1098 `(#:configure-flags
1099 ;; XXX This ‘documentation’ is for developers, and fails informatively:
1100 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
1101 (list "-Ddocs=false"
1102 "-Dintrospection=false")))
98a11b7f
TGR
1103 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
1104 (synopsis "Microsoft Cabinet file manipulation library")
1105 (description
1106 "The libgcab library provides GObject functions to read, write, and modify
1107Microsoft cabinet (.@dfn{CAB}) files.")
1108 (license (list license:gpl2+ ; tests/testsuite.at
1109 license:lgpl2.1+)))) ; the rest
cb390925
TGR
1110
1111(define-public msitools
1112 (package
1113 (name "msitools")
84748e71 1114 (version "0.100")
cb390925
TGR
1115 (source (origin
1116 (method url-fetch)
a4469936
TGR
1117 (uri (string-append "mirror://gnome/sources/msitools/"
1118 version "/msitools-" version ".tar.xz"))
cb390925
TGR
1119 (sha256
1120 (base32
84748e71 1121 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
cb390925
TGR
1122 (build-system gnu-build-system)
1123 (native-inputs
9e4da9f2
TGR
1124 `(("bison" ,bison)
1125 ("pkg-config" ,pkg-config)))
cb390925
TGR
1126 (inputs
1127 `(("gcab" ,gcab)
1128 ("glib" ,glib)
1129 ("libgsf" ,libgsf)
1130 ("libxml2" ,libxml2)
bb93042c 1131 ("uuid" ,util-linux "lib")))
cb390925
TGR
1132 (home-page "https://wiki.gnome.org/msitools")
1133 (synopsis "Windows Installer file manipulation tool")
1134 (description
1135 "msitools is a collection of command-line tools to inspect, extract, build,
1136and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
1137for packaging and deployment of cross-compiled Windows applications.")
1138 (license license:lgpl2.1+)))
3d391309
SB
1139
1140(define-public libostree
1141 (package
1142 (name "libostree")
cecaa0b3 1143 (version "2020.5")
3d391309
SB
1144 (source (origin
1145 (method url-fetch)
1146 (uri (string-append
1147 "https://github.com/ostreedev/ostree/releases/download/v"
83d4da12 1148 (version-major+minor version) "/libostree-" version ".tar.xz"))
3d391309
SB
1149 (sha256
1150 (base32
cecaa0b3 1151 "1k92177hjalbdpmg45ymwwrni68vh9rs5x9zvy5fzl9lng12fgpb"))))
3d391309
SB
1152 (build-system gnu-build-system)
1153 (arguments
1154 '(#:phases
1155 (modify-phases %standard-phases
1156 (add-before 'check 'pre-check
1157 (lambda _
1158 ;; Don't try to use the non-existing '/var/tmp' as test
1159 ;; directory.
1160 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
1161 #t)))
1162 ;; XXX: fails with:
5f97cc23 1163 ;; tap-driver.sh: missing test plan
3d391309
SB
1164 ;; tap-driver.sh: internal error getting exit status
1165 ;; tap-driver.sh: fatal: I/O or internal error
1166 #:tests? #f))
1167 (native-inputs
1168 `(("attr" ,attr) ; for tests
1169 ("bison" ,bison)
5f97cc23 1170 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
3d391309
SB
1171 ("gobject-introspection" ,gobject-introspection)
1172 ("pkg-config" ,pkg-config)
1173 ("xsltproc" ,libxslt)))
1174 (inputs
1175 `(("avahi" ,avahi)
1176 ("docbook-xml" ,docbook-xml-4.2)
1177 ("docbook-xsl" ,docbook-xsl)
1178 ("e2fsprogs" ,e2fsprogs)
1179 ("fuse" ,fuse)
1180 ("glib" ,glib)
1181 ("gpgme" ,gpgme)
1182 ("libarchive" ,libarchive)
1183 ("libsoup" ,libsoup)
3d391309
SB
1184 ("util-linux" ,util-linux)))
1185 (home-page "https://ostree.readthedocs.io/en/latest/")
1186 (synopsis "Operating system and container binary deployment and upgrades")
1187 (description
1188 "@code{libostree} is both a shared library and suite of command line
1189tools that combines a \"git-like\" model for committing and downloading
52beae7b
TGR
1190bootable file system trees, along with a layer for deploying them and managing
1191the boot loader configuration.")
3d391309 1192 (license license:lgpl2.0+)))
36e1ab84
RH
1193
1194(define-public flatpak
1195 (package
122db9a6 1196 (name "flatpak")
8f940793 1197 (version "1.8.2")
122db9a6
RH
1198 (source
1199 (origin
1200 (method url-fetch)
1201 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
1202 version "/flatpak-" version ".tar.xz"))
1203 (sha256
8f940793 1204 (base32 "1c45a0k7wx685n5b3ihv7dk0mm2kmwbw7cx8w5g2la62yxfn49kr"))))
16360cc8
LC
1205
1206 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1207 ;; find the TLS backend in glib-networking.
1208 (build-system glib-or-gtk-build-system)
1209
122db9a6 1210 (arguments
ac68fb3b
RW
1211 '(#:configure-flags
1212 (list
1213 "--enable-documentation=no" ;; FIXME
1214 "--enable-system-helper=no"
1215 "--localstatedir=/var"
1216 (string-append "--with-system-bubblewrap="
1217 (assoc-ref %build-inputs "bubblewrap")
1218 "/bin/bwrap")
753d75d4
RT
1219 (string-append "--with-system-dbus-proxy="
1220 (assoc-ref %build-inputs "xdg-dbus-proxy")
1221 "/bin/xdg-dbus-proxy"))
ac68fb3b
RW
1222 #:phases
1223 (modify-phases %standard-phases
1224 (add-after 'unpack 'fix-tests
1225 (lambda* (#:key inputs #:allow-other-keys)
1226 (copy-recursively
1227 (string-append (assoc-ref inputs "glibc-utf8-locales")
1228 "/lib/locale/") "/tmp/locale")
1229 (for-each make-file-writable (find-files "/tmp"))
1230 (substitute* "tests/make-test-runtime.sh"
1231 (("cp `which.*") "echo guix\n")
1232 (("cp -r /usr/lib/locale/C\\.\\*")
1233 (string-append "mkdir ${DIR}/usr/lib/locale/en_US; \
1234cp -r /tmp/locale/*/en_US.*")))
1235 (substitute* "tests/libtest.sh"
1236 (("/bin/kill") (which "kill"))
1237 (("/usr/bin/python3") (which "python3")))
1238 #t))
1239 ;; Many tests fail for unknown reasons, so we just run a few basic
8f940793 1240 ;; tests.
ac68fb3b
RW
1241 (replace 'check
1242 (lambda _
1243 (setenv "HOME" "/tmp")
1244 (invoke "make" "check"
1245 "TESTS=tests/test-basic.sh tests/test-config.sh testcommon"))))))
1246 (native-inputs
1247 `(("bison" ,bison)
1248 ("dbus" ,dbus) ; for dbus-daemon
1249 ("gettext" ,gettext-minimal)
1250 ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
1251 ("glibc-utf8-locales" ,glibc-utf8-locales)
1252 ("gobject-introspection" ,gobject-introspection)
1253 ("libcap" ,libcap)
1254 ("pkg-config" ,pkg-config)
1255 ("python" ,python)
b9478f33 1256 ("python-pyparsing" ,python-pyparsing)
ac68fb3b
RW
1257 ("socat" ,socat)
1258 ("which" ,which)))
75f0bda7
RH
1259 (propagated-inputs `(("glib-networking" ,glib-networking)
1260 ("gnupg" ,gnupg)
1261 ("gsettings-desktop-schemas"
1262 ,gsettings-desktop-schemas)))
ac68fb3b
RW
1263 (inputs
1264 `(("appstream-glib" ,appstream-glib)
1265 ("bubblewrap" ,bubblewrap)
1266 ("dconf" ,dconf)
1267 ("fuse" ,fuse)
1268 ("gdk-pixbuf" ,gdk-pixbuf)
1269 ("gpgme" ,gpgme)
1270 ("json-glib" ,json-glib)
1271 ("libarchive" ,libarchive)
1272 ("libostree" ,libostree)
1273 ("libseccomp" ,libseccomp)
1274 ("libsoup" ,libsoup)
1275 ("libxau" ,libxau)
1276 ("libxml2" ,libxml2)
1277 ("util-linux" ,util-linux)
1278 ("xdg-dbus-proxy" ,xdg-dbus-proxy)))
122db9a6
RH
1279 (home-page "https://flatpak.org")
1280 (synopsis "System for building, distributing, and running sandboxed desktop
36e1ab84 1281applications")
122db9a6 1282 (description "Flatpak is a system for building, distributing, and running
36e1ab84 1283sandboxed desktop applications on GNU/Linux.")
122db9a6 1284 (license license:lgpl2.1+)))
e343816d
MB
1285
1286(define-public akku
1287 (package
1288 (name "akku")
1289 (version "1.0.1")
1290 (source (origin
1291 (method git-fetch)
1292 (uri (git-reference
1293 (url "https://gitlab.com/akkuscm/akku.git")
1294 (commit (string-append "v" version))))
1295 (file-name (git-file-name name version))
1296 (sha256 (base32 "1dm32ws3nshnnscd7k75zswxxs1pp25y2q4k8j5ms241hz47by3c"))))
1297 (build-system gnu-build-system)
1298 (arguments
1299 '(#:phases (modify-phases %standard-phases
1300 (replace 'bootstrap
1301 (lambda* (#:key outputs #:allow-other-keys)
1302 (for-each patch-shebang
1303 '("bootstrap"
1304 ".akku/env"))
1305 (let* ((home "/tmp")
1306 (datadir (string-append home "/.local/share/akku/")))
1307 (mkdir-p datadir)
1308 (invoke "touch" (string-append datadir "index.db"))
1309 (setenv "HOME" home))
1310 (invoke "./bootstrap")
1311 #t))
1312 (add-after 'install 'wrap-executables
1313 (lambda* (#:key outputs inputs #:allow-other-keys)
1314 (let ((out (assoc-ref outputs "out"))
1315 (curl (assoc-ref inputs "curl")))
1316 (wrap-program (string-append out "/bin/akku")
1317 `("LD_LIBRARY_PATH" ":" prefix (,(string-append curl "/lib"))))
1318 #t))))))
1319 (native-inputs
1320 `(("which" ,which)
1321 ("autoconf" ,autoconf)
1322 ("automake" ,automake)
1323 ("pkg-config" ,pkg-config)))
1324 (inputs
1325 `(("guile" ,guile-3.0)
1326 ("curl" ,curl)))
1327 (home-page "https://akkuscm.org/")
1328 (synopsis "Language package manager for Scheme")
1329 (description
1330 "Akku.scm is a project-based language package manager for R6RS and R7RS Scheme.
1331It is mainly meant for programmers who develop portable programs or libraries in Scheme,
1332but could potentially work for end-users of those programs. It also has a translator
1333from R7RS, which allows most R7RS code to run on R6RS implementations.")
1334 (license license:gpl3+)))