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