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