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