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