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