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