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