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