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