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