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