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