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