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