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