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