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