gnu: Move testing packages from python.scm to check.scm.
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
CommitLineData
bbe8d8f0 1;;; GNU Guix --- Functional package management for GNU
a9174065 2;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
5dbeccf5 3;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
513d35f1 4;;; Copyright © 2017 Muriithi Frederick Muriuki <fredmanglis@gmail.com>
a881a40c 5;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
58a308e0 6;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
bbe8d8f0
LC
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages package-management)
24 #:use-module (guix packages)
25 #:use-module (guix download)
480af4d6 26 #:use-module (guix git-download)
04eb0fab 27 #:use-module (guix gexp)
480af4d6 28 #:use-module (guix utils)
bbe8d8f0 29 #:use-module (guix build-system gnu)
e3e1ecf6 30 #:use-module (guix build-system python)
a881a40c 31 #:use-module (guix build-system emacs)
58a308e0
RJ
32 #:use-module ((guix licenses) #:select (gpl2+ gpl3+ agpl3+ lgpl2.1+ asl2.0
33 bsd-3 silofl1.1))
8a43ff10 34 #:use-module (gnu packages)
bbe8d8f0 35 #:use-module (gnu packages guile)
e3e1ecf6
LC
36 #:use-module (gnu packages file)
37 #:use-module (gnu packages backup)
ac257f12 38 #:use-module (gnu packages check)
38cf2ba0 39 #:use-module (gnu packages compression)
bbe8d8f0 40 #:use-module (gnu packages gnupg)
5f96f303 41 #:use-module (gnu packages databases)
480af4d6
LC
42 #:use-module (gnu packages graphviz)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages gettext)
58a308e0 46 #:use-module (gnu packages lisp)
fcb0109d 47 #:use-module (gnu packages texinfo)
e3e1ecf6 48 #:use-module (gnu packages nettle)
fcb0109d 49 #:use-module (gnu packages perl)
5ccde207 50 #:use-module (gnu packages perl-check)
fcb0109d
LC
51 #:use-module (gnu packages curl)
52 #:use-module (gnu packages web)
e21adc76 53 #:use-module (gnu packages man)
a7fd7b68 54 #:use-module (gnu packages bdw-gc)
5dbeccf5 55 #:use-module (gnu packages patchutils)
e3e1ecf6 56 #:use-module (gnu packages python)
1b2f753d 57 #:use-module (gnu packages python-web)
e3e1ecf6
LC
58 #:use-module (gnu packages popt)
59 #:use-module (gnu packages gnuzilla)
60 #:use-module (gnu packages cpio)
04eb0fab 61 #:use-module (gnu packages tls)
43ddcd72 62 #:use-module (gnu packages ssh)
5dbeccf5 63 #:use-module (gnu packages vim)
4bc08b6e 64 #:use-module (gnu packages serialization)
82ce81ba 65 #:use-module (srfi srfi-1)
04eb0fab 66 #:use-module (ice-9 match))
bbe8d8f0 67
39de700c
LC
68(define (boot-guile-uri arch)
69 "Return the URI for the bootstrap Guile tarball for ARCH."
aef81a81
LC
70 (cond ((string=? "armhf" arch)
71 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
72 arch "-linux"
73 "/20150101/guile-2.0.11.tar.xz"))
74 ((string=? "aarch64" arch)
b31b0155
LC
75 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
76 arch "-linux/20170217/guile-2.0.14.tar.xz"))
aef81a81
LC
77 (else
78 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
79 arch "-linux"
80 "/20131110/guile-2.0.9.tar.xz"))))
39de700c 81
994a1494
LC
82(define-public guix
83 ;; Latest version of Guix, which may or may not correspond to a release.
94fa8d76
LC
84 ;; Note: the 'update-guix-package.scm' script expects this definition to
85 ;; start precisely like this.
a6d728b7 86 (let ((version "0.13.0")
b9184731
LC
87 (commit "ff23b47dbee038236386ddc2ed2fff4c77ad3aa1")
88 (revision 9))
994a1494
LC
89 (package
90 (name "guix")
ab2419e5 91
994a1494
LC
92 (version (if (zero? revision)
93 version
94 (string-append version "-"
95 (number->string revision)
4b7917f2 96 "." (string-take commit 7))))
994a1494
LC
97 (source (origin
98 (method git-fetch)
99 (uri (git-reference
100 (url "https://git.savannah.gnu.org/r/guix.git")
101 (commit commit)))
102 (sha256
103 (base32
b9184731 104 "19y39fm4bjvq4rz3360p8avxpsmflsgrz83l8ig49819a38qs6zm"))
994a1494
LC
105 (file-name (string-append "guix-" version "-checkout"))))
106 (build-system gnu-build-system)
107 (arguments
108 `(#:configure-flags (list
109 "--localstatedir=/var"
110 "--sysconfdir=/etc"
111 (string-append "--with-bash-completion-dir="
112 (assoc-ref %outputs "out")
113 "/etc/bash_completion.d")
114 (string-append "--with-libgcrypt-prefix="
115 (assoc-ref %build-inputs
116 "libgcrypt"))
117
118 ;; Set 'DOT_USER_PROGRAM' to the empty string so
119 ;; we don't keep a reference to Graphviz, whose
120 ;; closure is pretty big (too big for the GuixSD
121 ;; installation image.)
4b7917f2
LC
122 "ac_cv_path_DOT_USER_PROGRAM=dot"
123
124 ;; To avoid problems with the length of shebangs,
125 ;; choose a fixed-width and short directory name
126 ;; for tests.
127 "ac_cv_guix_test_root=/tmp/guix-tests")
994a1494
LC
128 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
129
130 #:modules ((guix build gnu-build-system)
131 (guix build utils)
c9117162 132 (srfi srfi-26)
994a1494
LC
133 (ice-9 popen)
134 (ice-9 rdelim))
135
136 #:phases (modify-phases %standard-phases
137 (add-after 'unpack 'bootstrap
138 (lambda _
139 ;; Make sure 'msgmerge' can modify the PO files.
140 (for-each (lambda (po)
141 (chmod po #o666))
142 (find-files "." "\\.po$"))
ab2419e5 143
994a1494
LC
144 (zero? (system* "sh" "bootstrap"))))
145 (add-before
146 'configure 'copy-bootstrap-guile
147 (lambda* (#:key system inputs #:allow-other-keys)
148 (define (boot-guile-version arch)
149 (cond ((string=? "armhf" arch) "2.0.11")
150 ((string=? "aarch64" arch) "2.0.14")
151 (else "2.0.9")))
39de700c 152
994a1494
LC
153 (define (copy arch)
154 (let ((guile (assoc-ref inputs
155 (string-append "boot-guile/"
156 arch)))
157 (target (string-append "gnu/packages/bootstrap/"
158 arch "-linux/"
159 "/guile-"
160 (boot-guile-version arch)
161 ".tar.xz")))
162 (mkdir-p (dirname target)) ;XXX: eventually unneeded
163 (copy-file guile target)))
bbe8d8f0 164
994a1494
LC
165 (copy "i686")
166 (copy "x86_64")
167 (copy "mips64el")
168 (copy "armhf")
169 (copy "aarch64")
170 #t))
171 (add-after
172 'unpack 'disable-container-tests
173 ;; XXX FIXME: These tests fail within the build container.
174 (lambda _
175 (substitute* "tests/syscalls.scm"
176 (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
177 (string-append "(test-skip 1)\n" all)))
178 (substitute* "tests/containers.scm"
179 (("^\\(test-(assert|equal)" all)
180 (string-append "(test-skip 1)\n" all)))
181 (when (file-exists? "tests/guix-environment-container.sh")
182 (substitute* "tests/guix-environment-container.sh"
183 (("guix environment --version")
184 "exit 77\n")))
185 #t))
186 (add-before 'check 'set-SHELL
187 (lambda _
188 ;; 'guix environment' tests rely on 'SHELL' having a
189 ;; correct value, so set it.
190 (setenv "SHELL" (which "sh"))
191 #t))
192 (add-after 'install 'wrap-program
193 (lambda* (#:key inputs outputs #:allow-other-keys)
194 ;; Make sure the 'guix' command finds GnuTLS and
195 ;; Guile-JSON automatically.
196 (let* ((out (assoc-ref outputs "out"))
197 (guile (assoc-ref inputs "guile"))
198 (json (assoc-ref inputs "guile-json"))
9ca8aa38 199 (git (assoc-ref inputs "guile-git"))
994a1494
LC
200 (ssh (assoc-ref inputs "guile-ssh"))
201 (gnutls (assoc-ref inputs "gnutls"))
c9117162 202 (deps (list json gnutls git ssh))
994a1494
LC
203 (effective
204 (read-line
205 (open-pipe* OPEN_READ
206 (string-append guile "/bin/guile")
207 "-c" "(display (effective-version))")))
c9117162
LC
208 (path (string-join
209 (map (cut string-append <>
210 "/share/guile/site/"
211 effective)
212 deps)
213 ":"))
214 (gopath (string-join
215 (map (cut string-append <>
216 "/lib/guile/" effective
217 "/site-ccache")
218 deps)
219 ":")))
61cdad35 220
994a1494
LC
221 (wrap-program (string-append out "/bin/guix")
222 `("GUILE_LOAD_PATH" ":" prefix (,path))
c9117162 223 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath)))
61cdad35 224
994a1494
LC
225 #t))))))
226 (native-inputs `(("pkg-config" ,pkg-config)
a7db8540 227
994a1494
LC
228 ;; XXX: Keep the development inputs here even though
229 ;; they're unnecessary, just so that 'guix environment
230 ;; guix' always contains them.
231 ("autoconf" ,(autoconf-wrapper))
232 ("automake" ,automake)
233 ("gettext" ,gettext-minimal)
234 ("texinfo" ,texinfo)
235 ("graphviz" ,graphviz)
236 ("help2man" ,help2man)))
237 (inputs
238 (let ((boot-guile (lambda (arch hash)
239 (origin
240 (method url-fetch)
241 (uri (boot-guile-uri arch))
242 (sha256 hash)))))
243 `(("bzip2" ,bzip2)
244 ("gzip" ,gzip)
245 ("zlib" ,zlib) ;for 'guix publish'
2d195e67 246
994a1494
LC
247 ("sqlite" ,sqlite)
248 ("libgcrypt" ,libgcrypt)
7561881f 249 ("guile" ,guile-2.2)
bbe8d8f0 250
994a1494
LC
251 ("boot-guile/i686"
252 ,(boot-guile "i686"
253 (base32
254 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")))
255 ("boot-guile/x86_64"
256 ,(boot-guile "x86_64"
257 (base32
258 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")))
259 ("boot-guile/mips64el"
260 ,(boot-guile "mips64el"
261 (base32
262 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")))
263 ("boot-guile/armhf"
264 ,(boot-guile "armhf"
265 (base32
266 "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5")))
267 ("boot-guile/aarch64"
268 ,(boot-guile "aarch64"
269 (base32
270 "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r"))))))
271 (propagated-inputs
52cabc6f 272 `(("gnutls" ,gnutls)
2252f087 273 ("guile-json" ,guile-json)
9ca8aa38
LC
274 ("guile-ssh" ,guile-ssh)
275 ("guile-git" ,guile-git)))
f1082ec1 276
994a1494
LC
277 (home-page "https://www.gnu.org/software/guix/")
278 (synopsis "Functional package manager for installed software packages and versions")
279 (description
280 "GNU Guix is a functional package manager for the GNU system, and is
c5779c93 281also a distribution thereof. It includes a virtual machine image. Besides
79c311b8 282the usual package management features, it also supports transactional
c5779c93
LC
283upgrades and roll-backs, per-user profiles, and much more. It is based on
284the Nix package manager.")
994a1494
LC
285 (license gpl3+)
286 (properties '((ftp-server . "alpha.gnu.org"))))))
3ad9a0b1 287
994a1494
LC
288;; Alias for backward compatibility.
289(define-public guix-devel guix)
fcb0109d 290
82ce81ba
LC
291(define-public guile2.0-guix
292 (package
293 (inherit guix)
294 (name "guile2.0-guix")
295 (inputs
296 `(("guile" ,guile-2.0)
297 ,@(alist-delete "guile" (package-inputs guix))))
298 (propagated-inputs
52cabc6f 299 `(("gnutls" ,gnutls/guile-2.0)
82ce81ba 300 ("guile-json" ,guile2.0-json)
9ca8aa38
LC
301 ("guile-ssh" ,guile2.0-ssh)
302 ("guile-git" ,guile2.0-git)))))
82ce81ba 303
04eb0fab
LC
304(define (source-file? file stat)
305 "Return true if FILE is likely a source file, false if it is a typical
306generated file."
307 (define (wrong-extension? file)
308 (or (string-suffix? "~" file)
309 (member (file-extension file)
310 '("o" "a" "lo" "so" "go"))))
311
312 (match (basename file)
313 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
314 #f)
315 ((? wrong-extension?)
316 #f)
317 (_
318 #t)))
319
04eb0fab 320(define-public current-guix
a9d5e4be
CB
321 (let* ((repository-root (canonicalize-path
322 (string-append (current-source-directory)
323 "/../..")))
324 (select? (delay (or (git-predicate repository-root)
325 source-file?))))
04eb0fab
LC
326 (lambda ()
327 "Return a package representing Guix built from the current source tree.
328This works by adding the current source tree to the store (after filtering it
329out) and returning a package that uses that as its 'source'."
330 (package
331 (inherit guix)
332 (version (string-append (package-version guix) "+"))
a9d5e4be 333 (source (local-file repository-root "guix-current"
04eb0fab
LC
334 #:recursive? #t
335 #:select? (force select?)))))))
336
337\f
338;;;
339;;; Other tools.
340;;;
341
fcb0109d
LC
342(define-public nix
343 (package
344 (name "nix")
a041d56e 345 (version "1.11.9")
fcb0109d
LC
346 (source (origin
347 (method url-fetch)
348 (uri (string-append "http://nixos.org/releases/nix/nix-"
349 version "/nix-" version ".tar.xz"))
350 (sha256
351 (base32
a041d56e 352 "1qg7qrfr60dysmyfg3ijgani71l23p1kqadhjs8kz11pgwkkx50f"))))
fcb0109d
LC
353 (build-system gnu-build-system)
354 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
355 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
356 ;; instead of /var/guix. So in the end, we do nothing special.
9083788a
SB
357 (arguments
358 '(#:configure-flags
359 ;; Set the prefixes of Perl libraries to avoid propagation.
360 (let ((perl-libdir (lambda (p)
361 (string-append
362 (assoc-ref %build-inputs p)
363 "/lib/perl5/site_perl"))))
364 (list (string-append "--with-dbi="
365 (perl-libdir "perl-dbi"))
366 (string-append "--with-dbd-sqlite="
367 (perl-libdir "perl-dbd-sqlite"))
368 (string-append "--with-www-curl="
369 (perl-libdir "perl-www-curl"))))))
fcb0109d
LC
370 (native-inputs `(("perl" ,perl)
371 ("pkg-config" ,pkg-config)))
372 (inputs `(("curl" ,curl)
373 ("openssl" ,openssl)
374 ("libgc" ,libgc)
375 ("sqlite" ,sqlite)
9083788a
SB
376 ("bzip2" ,bzip2)
377 ("perl-www-curl" ,perl-www-curl)
378 ("perl-dbi" ,perl-dbi)
379 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
fcb0109d
LC
380 (home-page "http://nixos.org/nix/")
381 (synopsis "The Nix package manager")
382 (description
383 "Nix is a purely functional package manager. This means that it treats
384packages like values in purely functional programming languages such as
385Haskell—they are built by functions that don't have side-effects, and they
386never change after they have been built. Nix stores packages in the Nix
387store, usually the directory /nix/store, where each package has its own unique
388sub-directory.")
389 (license lgpl2.1+)))
8d422e25 390
a881a40c
LC
391(define-public emacs-nix-mode
392 (package
393 (inherit nix)
394 (name "emacs-nix-mode")
395 (build-system emacs-build-system)
396 (arguments
397 `(#:phases
398 (modify-phases %standard-phases
399 (add-after 'unpack 'chdir-elisp
400 ;; Elisp directory is not in root of the source.
401 (lambda _
402 (chdir "misc/emacs"))))))
403 (synopsis "Emacs major mode for editing Nix expressions")
404 (description "@code{nixos-mode} provides an Emacs major mode for editing
405Nix expressions. It supports syntax highlighting, indenting and refilling of
406comments.")))
407
8d422e25
RW
408(define-public stow
409 (package
410 (name "stow")
ddfd70da 411 (version "2.2.2")
8d422e25
RW
412 (source (origin
413 (method url-fetch)
414 (uri (string-append "mirror://gnu/stow/stow-"
415 version ".tar.gz"))
416 (sha256
417 (base32
ddfd70da 418 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
8d422e25
RW
419 (build-system gnu-build-system)
420 (inputs
421 `(("perl" ,perl)))
422 (native-inputs
423 `(("perl-test-simple" ,perl-test-simple)
424 ("perl-test-output" ,perl-test-output)
ddfd70da
LC
425 ("perl-capture-tiny" ,perl-capture-tiny)
426 ("perl-io-stringy" ,perl-io-stringy)))
8d422e25
RW
427 (home-page "https://www.gnu.org/software/stow/")
428 (synopsis "Managing installed software packages")
429 (description
430 "GNU Stow is a symlink manager. It generates symlinks to directories
431of data and makes them appear to be merged into the same directory. It is
432typically used for managing software packages installed from source, by
433letting you install them apart in distinct directories and then create
434symlinks to the files in a common directory such as /usr/local.")
435 (license gpl2+)))
e3e1ecf6
LC
436
437(define-public rpm
438 (package
439 (name "rpm")
a3dd13ae 440 (version "4.13.0.2")
e3e1ecf6
LC
441 (source (origin
442 (method url-fetch)
623cc34c
EB
443 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
444 (version-major+minor version) ".x/rpm-"
e3e1ecf6
LC
445 version ".tar.bz2"))
446 (sha256
447 (base32
a3dd13ae 448 "1521y4ghjns449kzpwkjn9cksh686383xnfx0linzlalqc3jqgig"))))
e3e1ecf6
LC
449 (build-system gnu-build-system)
450 (arguments
451 '(#:configure-flags '("--with-external-db" ;use the system's bdb
452 "--enable-python"
453 "--without-lua")
454 #:phases (modify-phases %standard-phases
455 (add-before 'configure 'set-nspr-search-path
456 (lambda* (#:key inputs #:allow-other-keys)
457 ;; nspr.pc contains the right -I flag pointing to
458 ;; 'include/nspr', but unfortunately 'configure' doesn't
459 ;; use 'pkg-config'. Thus, augment CPATH.
460 ;; Likewise for NSS.
461 (let ((nspr (assoc-ref inputs "nspr"))
462 (nss (assoc-ref inputs "nss")))
463 (setenv "CPATH"
e8e2e18b 464 (string-append (getenv "C_INCLUDE_PATH") ":"
e3e1ecf6
LC
465 nspr "/include/nspr:"
466 nss "/include/nss"))
467 (setenv "LIBRARY_PATH"
468 (string-append (getenv "LIBRARY_PATH") ":"
469 nss "/lib/nss"))
470 #t)))
471 (add-after 'install 'fix-rpm-symlinks
472 (lambda* (#:key outputs #:allow-other-keys)
473 ;; 'make install' gets these symlinks wrong. Fix them.
474 (let* ((out (assoc-ref outputs "out"))
475 (bin (string-append out "/bin")))
476 (with-directory-excursion bin
477 (for-each (lambda (file)
478 (delete-file file)
479 (symlink "rpm" file))
480 '("rpmquery" "rpmverify"))
481 #t)))))))
482 (native-inputs
483 `(("pkg-config" ,pkg-config)))
484 (inputs
485 `(("python" ,python-2)
486 ("xz" ,xz)
487 ("bdb" ,bdb)
488 ("popt" ,popt)
489 ("nss" ,nss)
490 ("nspr" ,nspr)
491 ("libarchive" ,libarchive)
492 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
493 ("file" ,file)
494 ("bzip2" ,bzip2)
495 ("zlib" ,zlib)
496 ("cpio" ,cpio)))
497 (home-page "http://www.rpm.org/")
498 (synopsis "The RPM Package Manager")
499 (description
500 "The RPM Package Manager (RPM) is a command-line driven package
501management system capable of installing, uninstalling, verifying, querying,
502and updating computer software packages. Each software package consists of an
503archive of files along with information about the package like its version, a
504description. There is also a library permitting developers to manage such
505transactions from C or Python.")
506
507 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
508 (license gpl2+)))
509
08dcff47
LC
510(define-public diffoscope
511 (package
512 (name "diffoscope")
63b7fbe1 513 (version "88")
08dcff47 514 (source (origin
7dd21101
LF
515 (method url-fetch)
516 (uri (pypi-uri name version))
08dcff47
LC
517 (sha256
518 (base32
63b7fbe1 519 "1zp6nb37igssxg4bqsi3cw5klx4prhcx50mzg4463l50mssn8mp2"))))
08dcff47
LC
520 (build-system python-build-system)
521 (arguments
7dd21101 522 `(#:phases (modify-phases %standard-phases
a7ccfefd 523 (add-before 'unpack 'n (lambda _ #t))
7dd21101
LF
524 ;; setup.py mistakenly requires python-magic from PyPi, even
525 ;; though the Python bindings of `file` are sufficient.
526 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
527 (add-after 'unpack 'dependency-on-python-magic
528 (lambda _
529 (substitute* "setup.py"
5dbeccf5
RW
530 (("'python-magic',") ""))))
531 (add-after 'unpack 'embed-tool-references
532 (lambda* (#:key inputs #:allow-other-keys)
025519fa 533 (substitute* "diffoscope/comparators/utils/compare.py"
5dbeccf5
RW
534 (("\\['xxd',")
535 (string-append "['" (which "xxd") "',")))
536 (substitute* "diffoscope/comparators/elf.py"
537 (("@tool_required\\('readelf'\\)") "")
538 (("\\['readelf',")
539 (string-append "['" (which "readelf") "',")))
63b7fbe1
GB
540 #t))
541 (add-before 'check 'delete-failing-test
542 (lambda _
543 (delete-file "tests/test_tools.py") ;this requires /sbin to be on the path
5dbeccf5 544 #t)))))
08dcff47 545 (inputs `(("rpm" ,rpm) ;for rpm-python
7dd21101
LF
546 ("python-file" ,python-file)
547 ("python-debian" ,python-debian)
548 ("python-libarchive-c" ,python-libarchive-c)
549 ("python-tlsh" ,python-tlsh)
5dbeccf5 550 ("colordiff" ,colordiff)
9fc513ad 551 ("xxd" ,xxd)
08dcff47
LC
552
553 ;; Below are modules used for tests.
7dd21101
LF
554 ("python-pytest" ,python-pytest)
555 ("python-chardet" ,python-chardet)))
54360c91 556 (home-page "https://diffoscope.org/")
08dcff47
LC
557 (synopsis "Compare files, archives, and directories in depth")
558 (description
559 "Diffoscope tries to get to the bottom of what makes files or directories
560different. It recursively unpacks archives of many kinds and transforms
561various binary formats into more human readable forms to compare them. It can
562compare two tarballs, ISO images, or PDFs just as easily.")
563 (license gpl3+)))
513d35f1
MFM
564
565(define-public python-anaconda-client
566 (package
567 (name "python-anaconda-client")
568 (version "1.6.3")
569 (source
570 (origin
571 (method url-fetch)
572 (uri (string-append "https://github.com/Anaconda-Platform/"
573 "anaconda-client/archive/" version ".tar.gz"))
574 (file-name (string-append name "-" version ".tar.gz"))
575 (sha256
576 (base32
577 "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
578 (build-system python-build-system)
579 (propagated-inputs
580 `(("python-pyyaml" ,python-pyyaml)
581 ("python-requests" ,python-requests)
582 ("python-clyent" ,python-clyent)))
583 (native-inputs
584 `(("python-pytz" ,python-pytz)
585 ("python-dateutil" ,python-dateutil)
586 ("python-mock" ,python-mock)
587 ("python-coverage" ,python-coverage)
588 ("python-pillow" ,python-pillow)))
589 (arguments
590 `(#:phases
591 (modify-phases %standard-phases
592 ;; This is needed for some tests.
593 (add-before 'check 'set-up-home
594 (lambda* _ (setenv "HOME" "/tmp") #t))
595 (add-before 'check 'remove-network-tests
596 (lambda* _
597 ;; Remove tests requiring a network connection
598 (let ((network-tests '("tests/test_upload.py"
599 "tests/test_authorizations.py"
600 "tests/test_login.py"
601 "tests/test_whoami.py"
602 "utils/notebook/tests/test_data_uri.py"
603 "utils/notebook/tests/test_base.py"
604 "utils/notebook/tests/test_downloader.py"
605 "inspect_package/tests/test_conda.py")))
606 (with-directory-excursion "binstar_client"
607 (for-each delete-file network-tests)))
608 #t)))))
609 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
610 (synopsis "Anaconda Cloud command line client library")
611 (description
612 "Anaconda Cloud command line client library provides an interface to
613Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
614environments.")
615 (license bsd-3)))
616
617(define-public python2-anaconda-client
618 (package-with-python2 python-anaconda-client))
4bc08b6e
MFM
619
620(define-public python-conda
621 (package
622 (name "python-conda")
623 (version "4.3.16")
624 (source
625 (origin
626 (method url-fetch)
627 (uri (string-append "https://github.com/conda/conda/archive/"
628 version ".tar.gz"))
629 (file-name (string-append name "-" version ".tar.gz"))
630 (sha256
631 (base32
632 "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
633 (build-system python-build-system)
634 (arguments
635 `(#:phases
636 (modify-phases %standard-phases
637 (add-before 'build 'create-version-file
638 (lambda _
639 (with-output-to-file "conda/.version"
640 (lambda () (display ,version)))
641 #t))
642 (add-before 'check 'remove-failing-tests
643 (lambda _
644 ;; These tests require internet/network access
645 (let ((network-tests '("test_cli.py"
646 "test_create.py"
647 "test_export.py"
648 "test_fetch.py"
649 "test_history.py"
650 "test_info.py"
651 "test_install.py"
652 "test_priority.py"
653 "conda_env/test_cli.py"
654 "conda_env/test_create.py"
655 "conda_env/specs/test_notebook.py"
656 "conda_env/utils/test_notebooks.py"
657 "core/test_index.py"
658 "core/test_repodata.py")))
659 (with-directory-excursion "tests"
660 (for-each delete-file network-tests)
661
662 ;; FIXME: This test creates a file, then deletes it and tests
663 ;; that the file was deleted. For some reason it fails when
664 ;; building with guix, but does not when you run it in the
665 ;; directory left when you build with the --keep-failed
666 ;; option
667 (delete-file "gateways/disk/test_delete.py")
668 #t))))
669 (replace 'check
670 (lambda _
671 (setenv "HOME" "/tmp")
672 (zero? (system* "py.test")))))))
673 (native-inputs
674 `(("python-ruamel.yaml" ,python-ruamel.yaml)
675 ("python-requests" ,python-requests)
676 ("python-pycosat" ,python-pycosat)
677 ("python-pytest" ,python-pytest)
678 ("python-responses" ,python-responses)
679 ("python-pyyaml" ,python-pyyaml)
680 ("python-anaconda-client" ,python-anaconda-client)))
681 (home-page "https://github.com/conda/conda")
682 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
683 (description
684 "Conda is a cross-platform, Python-agnostic binary package manager. It
685is the package manager used by Anaconda installations, but it may be used for
686other systems as well. Conda makes environments first-class citizens, making
687it easy to create independent environments even for C libraries. Conda is
688written entirely in Python.
689
690This package provides Conda as a library.")
691 (license bsd-3)))
692
693(define-public python2-conda
2c5cf844
LF
694 (let ((base (package-with-python2
695 (strip-python2-variant python-conda))))
696 (package (inherit base)
697 (native-inputs
698 `(("python2-enum34" ,python2-enum34)
699 ,@(package-native-inputs base))))))
84fcb580
MFM
700
701(define-public conda
702 (package (inherit python-conda)
703 (name "conda")
704 (arguments
705 (substitute-keyword-arguments (package-arguments python-conda)
706 ((#:phases phases)
707 `(modify-phases ,phases
708 (replace 'build
709 (lambda* (#:key outputs #:allow-other-keys)
710 ;; This test fails when run before installation.
711 (delete-file "tests/test_activate.py")
712
713 ;; Fix broken defaults
714 (substitute* "conda/base/context.py"
715 (("return sys.prefix")
716 (string-append "return \"" (assoc-ref outputs "out") "\""))
717 (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
718 (string-append "return False if self.root_prefix == self.conda_prefix else "
719 match)))
720
721 ;; The util/setup-testing.py is used to build conda in
722 ;; application form, rather than the default, library form.
723 ;; With this, we are able to run commands like `conda --help`
724 ;; directly on the command line
725 (zero? (system* "python" "utils/setup-testing.py" "build_py"))))
726 (replace 'install
727 (lambda* (#:key inputs outputs #:allow-other-keys)
728 (let* ((out (assoc-ref outputs "out"))
729 (target (string-append out "/lib/python"
730 ((@@ (guix build python-build-system)
731 get-python-version)
732 (assoc-ref inputs "python"))
733 "/site-packages/")))
734 ;; The installer aborts if the target directory is not on
735 ;; PYTHONPATH.
736 (setenv "PYTHONPATH"
737 (string-append target ":" (getenv "PYTHONPATH")))
738
739 ;; And it aborts if the directory doesn't exist.
740 (mkdir-p target)
741 (zero? (system* "python" "utils/setup-testing.py" "install"
1d84500a
RW
742 (string-append "--prefix=" out))))))
743 ;; The "activate" and "deactivate" scripts don't need wrapping.
744 ;; They also break when they are renamed.
745 (add-after 'wrap 'undo-wrap
746 (lambda* (#:key outputs #:allow-other-keys)
747 (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/")
748 (delete-file "deactivate")
749 (rename-file ".deactivate-real" "deactivate")
750 (delete-file "activate")
751 (rename-file ".activate-real" "activate")
752 #t)))))))
84fcb580
MFM
753 (description
754 "Conda is a cross-platform, Python-agnostic binary package manager. It
755is the package manager used by Anaconda installations, but it may be used for
756other systems as well. Conda makes environments first-class citizens, making
757it easy to create independent environments even for C libraries. Conda is
758written entirely in Python.")))
58a308e0
RJ
759
760(define-public gwl
761 (package
762 (name "gwl")
763 (version "0.1.0")
764 (source (origin
765 (method url-fetch)
766 (uri (string-append "https://www.guixwl.org/releases/gwl-"
767 version ".tar.gz"))
768 (sha256
769 (base32
770 "1x4swwp7kmhd57j3scii5c4h8swkcvab2r6mz7wxwwbx300wcqpy"))))
771 (build-system gnu-build-system)
772 (native-inputs
773 `(("autoconf" ,autoconf)
774 ("automake" ,automake)
775 ("pkg-config" ,pkg-config)))
776 (inputs
777 `(("guile" ,guile-2.2)))
778 (propagated-inputs
779 `(("guix" ,guix)
780 ("guile-commonmark" ,guile-commonmark)))
781 (home-page "https://www.guixwl.org")
782 (synopsis "Workflow management extension for GNU Guix")
783 (description "This project provides two subcommands to GNU Guix and
784introduces two record types that provide a workflow management extension built
785on top of GNU Guix.")
786 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
787 ;; the web interface modules in gwl/ are licensed AGPL3+,
788 ;; and the fonts included in this package are licensed OFL1.1.
789 (license (list gpl3+ agpl3+ silofl1.1))))