gnu: Generalize the variable name of the test-only tzdata package.
[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 compression)
40 #:use-module (gnu packages gnupg)
41 #:use-module (gnu packages databases)
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)
46 #:use-module (gnu packages lisp)
47 #:use-module (gnu packages texinfo)
48 #:use-module (gnu packages nettle)
49 #:use-module (gnu packages perl)
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 "357ab93aacbd882a48cd7961ab301afa78c941d0")
86 (revision 8))
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 "19cf4gpdkqv8lxpqg4ibmxhmnsm2ggi3wrhaslfmypa2a5b5jls1"))
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 `(("bzip2" ,bzip2)
237 ("gzip" ,gzip)
238 ("zlib" ,zlib) ;for 'guix publish'
239
240 ("sqlite" ,sqlite)
241 ("libgcrypt" ,libgcrypt)
242 ("guile" ,guile-2.2)
243
244 ("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux"))
245 ("boot-guile/x86_64" ,(bootstrap-guile-origin "x86_64-linux"))
246 ("boot-guile/mips64el" ,(bootstrap-guile-origin "mips64el-linux"))
247 ("boot-guile/armhf" ,(bootstrap-guile-origin "armhf-linux"))
248 ("boot-guile/aarch64" ,(bootstrap-guile-origin "aarch64-linux"))))
249 (propagated-inputs
250 `(("gnutls" ,gnutls)
251 ("guile-json" ,guile-json)
252 ("guile-ssh" ,guile-ssh)
253 ("guile-git" ,guile-git)))
254
255 (home-page "https://www.gnu.org/software/guix/")
256 (synopsis "Functional package manager for installed software packages and versions")
257 (description
258 "GNU Guix is a functional package manager for the GNU system, and is
259 also a distribution thereof. It includes a virtual machine image. Besides
260 the usual package management features, it also supports transactional
261 upgrades and roll-backs, per-user profiles, and much more. It is based on
262 the Nix package manager.")
263 (license gpl3+)
264 (properties '((ftp-server . "alpha.gnu.org"))))))
265
266 ;; Alias for backward compatibility.
267 (define-public guix-devel guix)
268
269 (define-public guile2.0-guix
270 (package
271 (inherit guix)
272 (name "guile2.0-guix")
273 (inputs
274 `(("guile" ,guile-2.0)
275 ,@(alist-delete "guile" (package-inputs guix))))
276 (propagated-inputs
277 `(("gnutls" ,gnutls/guile-2.0)
278 ("guile-json" ,guile2.0-json)
279 ("guile-ssh" ,guile2.0-ssh)
280 ("guile-git" ,guile2.0-git)))))
281
282 (define (source-file? file stat)
283 "Return true if FILE is likely a source file, false if it is a typical
284 generated file."
285 (define (wrong-extension? file)
286 (or (string-suffix? "~" file)
287 (member (file-extension file)
288 '("o" "a" "lo" "so" "go"))))
289
290 (match (basename file)
291 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
292 #f)
293 ((? wrong-extension?)
294 #f)
295 (_
296 #t)))
297
298 (define-public current-guix
299 (let* ((repository-root (canonicalize-path
300 (string-append (current-source-directory)
301 "/../..")))
302 (select? (delay (or (git-predicate repository-root)
303 source-file?))))
304 (lambda ()
305 "Return a package representing Guix built from the current source tree.
306 This works by adding the current source tree to the store (after filtering it
307 out) and returning a package that uses that as its 'source'."
308 (package
309 (inherit guix)
310 (version (string-append (package-version guix) "+"))
311 (source (local-file repository-root "guix-current"
312 #:recursive? #t
313 #:select? (force select?)))))))
314
315 \f
316 ;;;
317 ;;; Other tools.
318 ;;;
319
320 (define-public nix
321 (package
322 (name "nix")
323 (version "1.11.9")
324 (source (origin
325 (method url-fetch)
326 (uri (string-append "http://nixos.org/releases/nix/nix-"
327 version "/nix-" version ".tar.xz"))
328 (sha256
329 (base32
330 "1qg7qrfr60dysmyfg3ijgani71l23p1kqadhjs8kz11pgwkkx50f"))))
331 (build-system gnu-build-system)
332 ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also
333 ;; need '--localstatedir=/var'. But then! The thing would use /var/nix
334 ;; instead of /var/guix. So in the end, we do nothing special.
335 (arguments
336 '(#:configure-flags
337 ;; Set the prefixes of Perl libraries to avoid propagation.
338 (let ((perl-libdir (lambda (p)
339 (string-append
340 (assoc-ref %build-inputs p)
341 "/lib/perl5/site_perl"))))
342 (list (string-append "--with-dbi="
343 (perl-libdir "perl-dbi"))
344 (string-append "--with-dbd-sqlite="
345 (perl-libdir "perl-dbd-sqlite"))
346 (string-append "--with-www-curl="
347 (perl-libdir "perl-www-curl"))))))
348 (native-inputs `(("perl" ,perl)
349 ("pkg-config" ,pkg-config)))
350 (inputs `(("curl" ,curl)
351 ("openssl" ,openssl)
352 ("libgc" ,libgc)
353 ("sqlite" ,sqlite)
354 ("bzip2" ,bzip2)
355 ("perl-www-curl" ,perl-www-curl)
356 ("perl-dbi" ,perl-dbi)
357 ("perl-dbd-sqlite" ,perl-dbd-sqlite)))
358 (home-page "http://nixos.org/nix/")
359 (synopsis "The Nix package manager")
360 (description
361 "Nix is a purely functional package manager. This means that it treats
362 packages like values in purely functional programming languages such as
363 Haskell—they are built by functions that don't have side-effects, and they
364 never change after they have been built. Nix stores packages in the Nix
365 store, usually the directory /nix/store, where each package has its own unique
366 sub-directory.")
367 (license lgpl2.1+)))
368
369 (define-public emacs-nix-mode
370 (package
371 (inherit nix)
372 (name "emacs-nix-mode")
373 (build-system emacs-build-system)
374 (arguments
375 `(#:phases
376 (modify-phases %standard-phases
377 (add-after 'unpack 'chdir-elisp
378 ;; Elisp directory is not in root of the source.
379 (lambda _
380 (chdir "misc/emacs"))))))
381 (synopsis "Emacs major mode for editing Nix expressions")
382 (description "@code{nixos-mode} provides an Emacs major mode for editing
383 Nix expressions. It supports syntax highlighting, indenting and refilling of
384 comments.")))
385
386 (define-public stow
387 (package
388 (name "stow")
389 (version "2.2.2")
390 (source (origin
391 (method url-fetch)
392 (uri (string-append "mirror://gnu/stow/stow-"
393 version ".tar.gz"))
394 (sha256
395 (base32
396 "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
397 (build-system gnu-build-system)
398 (inputs
399 `(("perl" ,perl)))
400 (native-inputs
401 `(("perl-test-simple" ,perl-test-simple)
402 ("perl-test-output" ,perl-test-output)
403 ("perl-capture-tiny" ,perl-capture-tiny)
404 ("perl-io-stringy" ,perl-io-stringy)))
405 (home-page "https://www.gnu.org/software/stow/")
406 (synopsis "Managing installed software packages")
407 (description
408 "GNU Stow is a symlink manager. It generates symlinks to directories
409 of data and makes them appear to be merged into the same directory. It is
410 typically used for managing software packages installed from source, by
411 letting you install them apart in distinct directories and then create
412 symlinks to the files in a common directory such as /usr/local.")
413 (license gpl2+)))
414
415 (define-public rpm
416 (package
417 (name "rpm")
418 (version "4.13.0.1")
419 (source (origin
420 (method url-fetch)
421 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
422 (version-major+minor version) ".x/rpm-"
423 version ".tar.bz2"))
424 (sha256
425 (base32
426 "03cvbwbfrhm0fa02j7828k1qp05hf2m0fradwcf2nqhrsjkppz17"))))
427 (build-system gnu-build-system)
428 (arguments
429 '(#:configure-flags '("--with-external-db" ;use the system's bdb
430 "--enable-python"
431 "--without-lua")
432 #:phases (modify-phases %standard-phases
433 (add-before 'configure 'set-nspr-search-path
434 (lambda* (#:key inputs #:allow-other-keys)
435 ;; nspr.pc contains the right -I flag pointing to
436 ;; 'include/nspr', but unfortunately 'configure' doesn't
437 ;; use 'pkg-config'. Thus, augment CPATH.
438 ;; Likewise for NSS.
439 (let ((nspr (assoc-ref inputs "nspr"))
440 (nss (assoc-ref inputs "nss")))
441 (setenv "CPATH"
442 (string-append (getenv "C_INCLUDE_PATH") ":"
443 nspr "/include/nspr:"
444 nss "/include/nss"))
445 (setenv "LIBRARY_PATH"
446 (string-append (getenv "LIBRARY_PATH") ":"
447 nss "/lib/nss"))
448 #t)))
449 (add-after 'install 'fix-rpm-symlinks
450 (lambda* (#:key outputs #:allow-other-keys)
451 ;; 'make install' gets these symlinks wrong. Fix them.
452 (let* ((out (assoc-ref outputs "out"))
453 (bin (string-append out "/bin")))
454 (with-directory-excursion bin
455 (for-each (lambda (file)
456 (delete-file file)
457 (symlink "rpm" file))
458 '("rpmquery" "rpmverify"))
459 #t)))))))
460 (native-inputs
461 `(("pkg-config" ,pkg-config)))
462 (inputs
463 `(("python" ,python-2)
464 ("xz" ,xz)
465 ("bdb" ,bdb)
466 ("popt" ,popt)
467 ("nss" ,nss)
468 ("nspr" ,nspr)
469 ("libarchive" ,libarchive)
470 ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
471 ("file" ,file)
472 ("bzip2" ,bzip2)
473 ("zlib" ,zlib)
474 ("cpio" ,cpio)))
475 (home-page "http://www.rpm.org/")
476 (synopsis "The RPM Package Manager")
477 (description
478 "The RPM Package Manager (RPM) is a command-line driven package
479 management system capable of installing, uninstalling, verifying, querying,
480 and updating computer software packages. Each software package consists of an
481 archive of files along with information about the package like its version, a
482 description. There is also a library permitting developers to manage such
483 transactions from C or Python.")
484
485 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
486 (license gpl2+)))
487
488 (define-public diffoscope
489 (package
490 (name "diffoscope")
491 (version "81")
492 (source (origin
493 (method url-fetch)
494 (uri (pypi-uri name version))
495 (sha256
496 (base32
497 "093lxy6zj69i19fxdkj3jnai3b1ajqbksyqcvy8wqj3plaaxjna5"))))
498 (build-system python-build-system)
499 (arguments
500 `(#:phases (modify-phases %standard-phases
501 (add-before 'unpack 'n (lambda _ #t))
502 ;; setup.py mistakenly requires python-magic from PyPi, even
503 ;; though the Python bindings of `file` are sufficient.
504 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
505 (add-after 'unpack 'dependency-on-python-magic
506 (lambda _
507 (substitute* "setup.py"
508 (("'python-magic',") ""))))
509 (add-after 'unpack 'embed-tool-references
510 (lambda* (#:key inputs #:allow-other-keys)
511 (substitute* "diffoscope/comparators/utils/compare.py"
512 (("\\['xxd',")
513 (string-append "['" (which "xxd") "',")))
514 (substitute* "diffoscope/comparators/elf.py"
515 (("@tool_required\\('readelf'\\)") "")
516 (("\\['readelf',")
517 (string-append "['" (which "readelf") "',")))
518 #t)))))
519 (inputs `(("rpm" ,rpm) ;for rpm-python
520 ("python-file" ,python-file)
521 ("python-debian" ,python-debian)
522 ("python-libarchive-c" ,python-libarchive-c)
523 ("python-tlsh" ,python-tlsh)
524 ("colordiff" ,colordiff)
525 ("xxd" ,xxd)
526
527 ;; Below are modules used for tests.
528 ("python-pytest" ,python-pytest)
529 ("python-chardet" ,python-chardet)))
530 (home-page "https://diffoscope.org/")
531 (synopsis "Compare files, archives, and directories in depth")
532 (description
533 "Diffoscope tries to get to the bottom of what makes files or directories
534 different. It recursively unpacks archives of many kinds and transforms
535 various binary formats into more human readable forms to compare them. It can
536 compare two tarballs, ISO images, or PDFs just as easily.")
537 (license gpl3+)))
538
539 (define-public python-anaconda-client
540 (package
541 (name "python-anaconda-client")
542 (version "1.6.3")
543 (source
544 (origin
545 (method url-fetch)
546 (uri (string-append "https://github.com/Anaconda-Platform/"
547 "anaconda-client/archive/" version ".tar.gz"))
548 (file-name (string-append name "-" version ".tar.gz"))
549 (sha256
550 (base32
551 "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
552 (build-system python-build-system)
553 (propagated-inputs
554 `(("python-pyyaml" ,python-pyyaml)
555 ("python-requests" ,python-requests)
556 ("python-clyent" ,python-clyent)))
557 (native-inputs
558 `(("python-pytz" ,python-pytz)
559 ("python-dateutil" ,python-dateutil)
560 ("python-mock" ,python-mock)
561 ("python-coverage" ,python-coverage)
562 ("python-pillow" ,python-pillow)))
563 (arguments
564 `(#:phases
565 (modify-phases %standard-phases
566 ;; This is needed for some tests.
567 (add-before 'check 'set-up-home
568 (lambda* _ (setenv "HOME" "/tmp") #t))
569 (add-before 'check 'remove-network-tests
570 (lambda* _
571 ;; Remove tests requiring a network connection
572 (let ((network-tests '("tests/test_upload.py"
573 "tests/test_authorizations.py"
574 "tests/test_login.py"
575 "tests/test_whoami.py"
576 "utils/notebook/tests/test_data_uri.py"
577 "utils/notebook/tests/test_base.py"
578 "utils/notebook/tests/test_downloader.py"
579 "inspect_package/tests/test_conda.py")))
580 (with-directory-excursion "binstar_client"
581 (for-each delete-file network-tests)))
582 #t)))))
583 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
584 (synopsis "Anaconda Cloud command line client library")
585 (description
586 "Anaconda Cloud command line client library provides an interface to
587 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
588 environments.")
589 (license bsd-3)))
590
591 (define-public python2-anaconda-client
592 (package-with-python2 python-anaconda-client))
593
594 (define-public python-conda
595 (package
596 (name "python-conda")
597 (version "4.3.16")
598 (source
599 (origin
600 (method url-fetch)
601 (uri (string-append "https://github.com/conda/conda/archive/"
602 version ".tar.gz"))
603 (file-name (string-append name "-" version ".tar.gz"))
604 (sha256
605 (base32
606 "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
607 (build-system python-build-system)
608 (arguments
609 `(#:phases
610 (modify-phases %standard-phases
611 (add-before 'build 'create-version-file
612 (lambda _
613 (with-output-to-file "conda/.version"
614 (lambda () (display ,version)))
615 #t))
616 (add-before 'check 'remove-failing-tests
617 (lambda _
618 ;; These tests require internet/network access
619 (let ((network-tests '("test_cli.py"
620 "test_create.py"
621 "test_export.py"
622 "test_fetch.py"
623 "test_history.py"
624 "test_info.py"
625 "test_install.py"
626 "test_priority.py"
627 "conda_env/test_cli.py"
628 "conda_env/test_create.py"
629 "conda_env/specs/test_notebook.py"
630 "conda_env/utils/test_notebooks.py"
631 "core/test_index.py"
632 "core/test_repodata.py")))
633 (with-directory-excursion "tests"
634 (for-each delete-file network-tests)
635
636 ;; FIXME: This test creates a file, then deletes it and tests
637 ;; that the file was deleted. For some reason it fails when
638 ;; building with guix, but does not when you run it in the
639 ;; directory left when you build with the --keep-failed
640 ;; option
641 (delete-file "gateways/disk/test_delete.py")
642 #t))))
643 (replace 'check
644 (lambda _
645 (setenv "HOME" "/tmp")
646 (zero? (system* "py.test")))))))
647 (native-inputs
648 `(("python-ruamel.yaml" ,python-ruamel.yaml)
649 ("python-requests" ,python-requests)
650 ("python-pycosat" ,python-pycosat)
651 ("python-pytest" ,python-pytest)
652 ("python-responses" ,python-responses)
653 ("python-pyyaml" ,python-pyyaml)
654 ("python-anaconda-client" ,python-anaconda-client)))
655 (home-page "https://github.com/conda/conda")
656 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
657 (description
658 "Conda is a cross-platform, Python-agnostic binary package manager. It
659 is the package manager used by Anaconda installations, but it may be used for
660 other systems as well. Conda makes environments first-class citizens, making
661 it easy to create independent environments even for C libraries. Conda is
662 written entirely in Python.
663
664 This package provides Conda as a library.")
665 (license bsd-3)))
666
667 (define-public python2-conda
668 (let ((base (package-with-python2
669 (strip-python2-variant python-conda))))
670 (package (inherit base)
671 (native-inputs
672 `(("python2-enum34" ,python2-enum34)
673 ,@(package-native-inputs base))))))
674
675 (define-public conda
676 (package (inherit python-conda)
677 (name "conda")
678 (arguments
679 (substitute-keyword-arguments (package-arguments python-conda)
680 ((#:phases phases)
681 `(modify-phases ,phases
682 (replace 'build
683 (lambda* (#:key outputs #:allow-other-keys)
684 ;; This test fails when run before installation.
685 (delete-file "tests/test_activate.py")
686
687 ;; Fix broken defaults
688 (substitute* "conda/base/context.py"
689 (("return sys.prefix")
690 (string-append "return \"" (assoc-ref outputs "out") "\""))
691 (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
692 (string-append "return False if self.root_prefix == self.conda_prefix else "
693 match)))
694
695 ;; The util/setup-testing.py is used to build conda in
696 ;; application form, rather than the default, library form.
697 ;; With this, we are able to run commands like `conda --help`
698 ;; directly on the command line
699 (zero? (system* "python" "utils/setup-testing.py" "build_py"))))
700 (replace 'install
701 (lambda* (#:key inputs outputs #:allow-other-keys)
702 (let* ((out (assoc-ref outputs "out"))
703 (target (string-append out "/lib/python"
704 ((@@ (guix build python-build-system)
705 get-python-version)
706 (assoc-ref inputs "python"))
707 "/site-packages/")))
708 ;; The installer aborts if the target directory is not on
709 ;; PYTHONPATH.
710 (setenv "PYTHONPATH"
711 (string-append target ":" (getenv "PYTHONPATH")))
712
713 ;; And it aborts if the directory doesn't exist.
714 (mkdir-p target)
715 (zero? (system* "python" "utils/setup-testing.py" "install"
716 (string-append "--prefix=" out))))))))))
717 (description
718 "Conda is a cross-platform, Python-agnostic binary package manager. It
719 is the package manager used by Anaconda installations, but it may be used for
720 other systems as well. Conda makes environments first-class citizens, making
721 it easy to create independent environments even for C libraries. Conda is
722 written entirely in Python.")))
723
724 (define-public gwl
725 (package
726 (name "gwl")
727 (version "0.1.0")
728 (source (origin
729 (method url-fetch)
730 (uri (string-append "https://www.guixwl.org/releases/gwl-"
731 version ".tar.gz"))
732 (sha256
733 (base32
734 "1x4swwp7kmhd57j3scii5c4h8swkcvab2r6mz7wxwwbx300wcqpy"))))
735 (build-system gnu-build-system)
736 (native-inputs
737 `(("autoconf" ,autoconf)
738 ("automake" ,automake)
739 ("pkg-config" ,pkg-config)))
740 (inputs
741 `(("guile" ,guile-2.2)))
742 (propagated-inputs
743 `(("guix" ,guix)
744 ("guile-commonmark" ,guile-commonmark)))
745 (home-page "https://www.guixwl.org")
746 (synopsis "Workflow management extension for GNU Guix")
747 (description "This project provides two subcommands to GNU Guix and
748 introduces two record types that provide a workflow management extension built
749 on top of GNU Guix.")
750 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
751 ;; the web interface modules in gwl/ are licensed AGPL3+,
752 ;; and the fonts included in this package are licensed OFL1.1.
753 (license (list gpl3+ agpl3+ silofl1.1))))