gnu: Add external-program.
[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, 2019 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, 2018 Oleg Pykhalov <go.wigust@gmail.com>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
10 ;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
11 ;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
12 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
13 ;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages package-management)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages acl)
33 #:use-module (gnu packages attr)
34 #:use-module (gnu packages avahi)
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages backup)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bdw-gc)
39 #:use-module (gnu packages bison)
40 #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
41 #:use-module (gnu packages check)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages cpio)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages curl)
46 #:use-module (gnu packages dbm)
47 #:use-module (gnu packages docbook)
48 #:use-module (gnu packages file)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages glib)
51 #:use-module (gnu packages gnome)
52 #:use-module (gnu packages gnupg)
53 #:use-module (gnu packages graphviz)
54 #:use-module (gnu packages gtk)
55 #:use-module (gnu packages guile)
56 #:use-module (gnu packages guile-xyz)
57 #:use-module (gnu packages linux)
58 #:use-module (gnu packages lisp)
59 #:use-module (gnu packages man)
60 #:use-module (gnu packages nettle)
61 #:use-module (gnu packages nss)
62 #:use-module (gnu packages patchutils)
63 #:use-module (gnu packages perl)
64 #:use-module (gnu packages perl-check)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages popt)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages python-web)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages serialization)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages ssh)
73 #:use-module (gnu packages texinfo)
74 #:use-module (gnu packages time)
75 #:use-module (gnu packages tls)
76 #:use-module (gnu packages vim)
77 #:use-module (gnu packages virtualization)
78 #:use-module (gnu packages web)
79 #:use-module (gnu packages xml)
80 #:use-module (gnu packages xorg)
81 #:use-module (guix build-system glib-or-gtk)
82 #:use-module (guix build-system gnu)
83 #:use-module (guix build-system meson)
84 #:use-module (guix build-system python)
85 #:use-module (guix download)
86 #:use-module (guix gexp)
87 #:use-module (guix git-download)
88 #:use-module ((guix licenses) #:prefix license:)
89 #:use-module (guix packages)
90 #:use-module (guix utils)
91 #:use-module (ice-9 match)
92 #:use-module (srfi srfi-1))
93
94 (define (boot-guile-uri arch)
95 "Return the URI for the bootstrap Guile tarball for ARCH."
96 (cond ((string=? "armhf" arch)
97 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
98 arch "-linux"
99 "/20150101/guile-2.0.11.tar.xz"))
100 ((string=? "aarch64" arch)
101 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
102 arch "-linux/20170217/guile-2.0.14.tar.xz"))
103 (else
104 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
105 arch "-linux"
106 "/20131110/guile-2.0.9.tar.xz"))))
107
108 (define-public guix
109 ;; Latest version of Guix, which may or may not correspond to a release.
110 ;; Note: the 'update-guix-package.scm' script expects this definition to
111 ;; start precisely like this.
112 (let ((version "1.0.1")
113 (commit "41b4b713f4892918a9a1950acdd89f33b977d143")
114 (revision 10))
115 (package
116 (name "guix")
117
118 (version (if (zero? revision)
119 version
120 (string-append version "-"
121 (number->string revision)
122 "." (string-take commit 7))))
123 (source (origin
124 (method git-fetch)
125 (uri (git-reference
126 (url "https://git.savannah.gnu.org/r/guix.git")
127 (commit commit)))
128 (sha256
129 (base32
130 "08sblj4xy78va6zlxmxdq2id58pjr8rjqxxycd77hiacsqbjh9g6"))
131 (file-name (string-append "guix-" version "-checkout"))))
132 (build-system gnu-build-system)
133 (arguments
134 `(#:configure-flags (list
135 "--localstatedir=/var"
136 "--sysconfdir=/etc"
137 (string-append "--with-bash-completion-dir="
138 (assoc-ref %outputs "out")
139 "/etc/bash_completion.d")
140
141 ;; Set 'DOT_USER_PROGRAM' to the empty string so
142 ;; we don't keep a reference to Graphviz, whose
143 ;; closure is pretty big (too big for the Guix
144 ;; system installation image.)
145 "ac_cv_path_DOT_USER_PROGRAM=dot"
146
147 ;; To avoid problems with the length of shebangs,
148 ;; choose a fixed-width and short directory name
149 ;; for tests.
150 "ac_cv_guix_test_root=/tmp/guix-tests")
151 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
152
153 #:modules ((guix build gnu-build-system)
154 (guix build utils)
155 (srfi srfi-26)
156 (ice-9 popen)
157 (ice-9 rdelim))
158
159 #:phases (modify-phases %standard-phases
160 (replace 'bootstrap
161 (lambda _
162 ;; Make sure 'msgmerge' can modify the PO files.
163 (for-each (lambda (po)
164 (chmod po #o666))
165 (find-files "." "\\.po$"))
166
167 (patch-shebang "build-aux/git-version-gen")
168
169 (call-with-output-file ".tarball-version"
170 (lambda (port)
171 (display ,version port)))
172
173 (invoke "sh" "bootstrap")))
174 (add-before 'check 'copy-bootstrap-guile
175 (lambda* (#:key system inputs #:allow-other-keys)
176 ;; Copy the bootstrap guile tarball in the store used
177 ;; by the test suite.
178 (define (intern file recursive?)
179 (let ((base (strip-store-file-name file)))
180 ;; Note: don't use 'guix download' here because we
181 ;; need to set the 'recursive?' argument.
182 (invoke "./test-env" "guile" "-c"
183 (object->string
184 `(begin
185 (use-modules (guix))
186 (with-store store
187 (add-to-store store ,base ,recursive?
188 "sha256" ,file)))))))
189
190 (intern (assoc-ref inputs "boot-guile") #f)
191
192 ;; On x86_64 some tests need the i686 Guile.
193 ,@(if (and (not (%current-target-system))
194 (string=? (%current-system)
195 "x86_64-linux"))
196 '((intern (assoc-ref inputs "boot-guile/i686") #f))
197 '())
198
199 ;; Copy the bootstrap executables.
200 (for-each (lambda (input)
201 (intern (assoc-ref inputs input) #t))
202 '("bootstrap/bash" "bootstrap/mkdir"
203 "bootstrap/tar" "bootstrap/xz"))
204 #t))
205 (add-after 'unpack 'disable-failing-tests
206 ;; XXX FIXME: These tests fail within the build container.
207 (lambda _
208 (substitute* "tests/syscalls.scm"
209 (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all)
210 (string-append "(test-skip 1)\n" all)))
211 (substitute* "tests/containers.scm"
212 (("^\\(test-(assert|equal)" all)
213 (string-append "(test-skip 1)\n" all)))
214 (when (file-exists? "tests/guix-environment-container.sh")
215 (substitute* "tests/guix-environment-container.sh"
216 (("guix environment --version")
217 "exit 77\n")))
218 #t))
219 (add-before 'check 'set-SHELL
220 (lambda _
221 ;; 'guix environment' tests rely on 'SHELL' having a
222 ;; correct value, so set it.
223 (setenv "SHELL" (which "sh"))
224 #t))
225 (add-after 'install 'wrap-program
226 (lambda* (#:key inputs outputs #:allow-other-keys)
227 ;; Make sure the 'guix' command finds GnuTLS,
228 ;; Guile-JSON, and Guile-Git automatically.
229 (let* ((out (assoc-ref outputs "out"))
230 (guile (assoc-ref inputs "guile"))
231 (gcrypt (assoc-ref inputs "guile-gcrypt"))
232 (json (assoc-ref inputs "guile-json"))
233 (sqlite (assoc-ref inputs "guile-sqlite3"))
234 (git (assoc-ref inputs "guile-git"))
235 (bs (assoc-ref inputs
236 "guile-bytestructures"))
237 (ssh (assoc-ref inputs "guile-ssh"))
238 (gnutls (assoc-ref inputs "gnutls"))
239 (locales (assoc-ref inputs "glibc-utf8-locales"))
240 (deps (list gcrypt json sqlite gnutls
241 git bs ssh))
242 (effective
243 (read-line
244 (open-pipe* OPEN_READ
245 (string-append guile "/bin/guile")
246 "-c" "(display (effective-version))")))
247 (path (string-join
248 (map (cut string-append <>
249 "/share/guile/site/"
250 effective)
251 (delete #f deps))
252 ":"))
253 (gopath (string-join
254 (map (cut string-append <>
255 "/lib/guile/" effective
256 "/site-ccache")
257 (delete #f deps))
258 ":"))
259 (locpath (string-append locales "/lib/locale")))
260
261 (wrap-program (string-append out "/bin/guix")
262 `("GUILE_LOAD_PATH" ":" prefix (,path))
263 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))
264 `("GUIX_LOCPATH" ":" suffix (,locpath)))
265
266 #t))))))
267 (native-inputs `(("pkg-config" ,pkg-config)
268
269 ;; XXX: Keep the development inputs here even though
270 ;; they're unnecessary, just so that 'guix environment
271 ;; guix' always contains them.
272 ("autoconf" ,autoconf-wrapper)
273 ("automake" ,automake)
274 ("gettext" ,gettext-minimal)
275 ("texinfo" ,texinfo)
276 ("graphviz" ,graphviz)
277 ("help2man" ,help2man)
278 ("po4a" ,po4a)))
279 (inputs
280 `(("bzip2" ,bzip2)
281 ("gzip" ,gzip)
282 ("zlib" ,zlib) ;for 'guix publish'
283 ("lzlib" ,lzlib) ;for 'guix publish' and 'guix substitute'
284
285 ("sqlite" ,sqlite)
286 ("libgcrypt" ,libgcrypt)
287
288 ("guile" ,guile-2.2)
289
290 ;; Some of the tests use "unshare" when it is available.
291 ("util-linux" ,util-linux)
292
293 ;; Many tests rely on the 'guile-bootstrap' package, which is why we
294 ;; have it here.
295 ("boot-guile" ,(bootstrap-guile-origin (%current-system)))
296 ,@(if (and (not (%current-target-system))
297 (string=? (%current-system) "x86_64-linux"))
298 `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux")))
299 '())
300
301 ;; Tests also rely on these bootstrap executables.
302 ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))
303 ("bootstrap/mkdir" ,(bootstrap-executable "mkdir" (%current-system)))
304 ("bootstrap/tar" ,(bootstrap-executable "tar" (%current-system)))
305 ("bootstrap/xz" ,(bootstrap-executable "xz" (%current-system)))
306
307 ("glibc-utf8-locales" ,glibc-utf8-locales)))
308 (propagated-inputs
309 `(("gnutls" ,gnutls)
310 ("guile-gcrypt" ,guile-gcrypt)
311 ("guile-json" ,guile-json-3)
312 ("guile-sqlite3" ,guile-sqlite3)
313 ("guile-ssh" ,guile-ssh)
314 ("guile-git" ,guile-git)))
315
316 (home-page "https://www.gnu.org/software/guix/")
317 (synopsis "Functional package manager for installed software packages and versions")
318 (description
319 "GNU Guix is a functional package manager for the GNU system, and is
320 also a distribution thereof. It includes a virtual machine image. Besides
321 the usual package management features, it also supports transactional
322 upgrades and roll-backs, per-user profiles, and much more. It is based on
323 the Nix package manager.")
324 (license license:gpl3+)
325 (properties '((ftp-server . "alpha.gnu.org"))))))
326
327 (define-public guix-daemon
328 ;; This package is for internal consumption: it allows us to quickly build
329 ;; the 'guix-daemon' program and use that in (guix self), used by 'guix
330 ;; pull'.
331 (package
332 (inherit guix)
333 (properties `((hidden? . #t)))
334 (name "guix-daemon")
335
336 ;; Use a minimum set of dependencies.
337 (native-inputs
338 (fold alist-delete (package-native-inputs guix)
339 '("po4a" "graphviz" "help2man")))
340 (inputs
341 `(("gnutls" ,gnutls)
342 ("guile-git" ,guile-git)
343 ("guile-json" ,guile-json-3)
344 ("guile-gcrypt" ,guile-gcrypt)
345 ,@(fold alist-delete (package-inputs guix)
346 '("boot-guile" "boot-guile/i686" "util-linux"))))
347
348 (propagated-inputs '())
349
350 (arguments
351 (substitute-keyword-arguments (package-arguments guix)
352 ((#:configure-flags flags '())
353 ;; Pretend we have those libraries; we don't actually need them.
354 `(append ,flags
355 '("guix_cv_have_recent_guile_sqlite3=yes"
356 "guix_cv_have_recent_guile_ssh=yes")))
357 ((#:tests? #f #f)
358 #f)
359 ((#:phases phases '%standard-phases)
360 `(modify-phases ,phases
361 (add-after 'unpack 'change-default-guix
362 (lambda _
363 ;; We need to tell 'guix-daemon' which 'guix' command to use.
364 ;; Here we use a questionable hack where we hard-code root's
365 ;; current guix, which could be wrong (XXX). Note that scripts
366 ;; like 'guix perform-download' do not run as root so we assume
367 ;; that they have access to /var/guix/profiles/per-user/root.
368 (substitute* "nix/libstore/globals.cc"
369 (("guixProgram = (.*)nixBinDir + \"/guix\"" _ before)
370 (string-append "guixProgram = " before
371 "/var/guix/profiles/per-user/root\
372 /current-guix/bin/guix")))
373 #t))
374 (replace 'build
375 (lambda _
376 (invoke "make" "nix/libstore/schema.sql.hh")
377 (invoke "make" "-j" (number->string
378 (parallel-job-count))
379 "guix-daemon")))
380 (delete 'copy-bootstrap-guile)
381 (replace 'install
382 (lambda* (#:key outputs #:allow-other-keys)
383 (invoke "make" "install-binPROGRAMS")))
384 (delete 'wrap-program)))))))
385
386 (define-public guile2.0-guix
387 (deprecated-package "guile2.0-guix" guix))
388
389 (define-public guix-minimal
390 ;; A version of Guix which is built with the minimal set of dependencies, as
391 ;; outlined in the README "Requirements" section. Intended as a CI job, so
392 ;; marked as hidden.
393 (hidden-package
394 (package
395 (inherit guix)
396 (name "guix-minimal")
397 (inputs
398 `(("guile" ,guile-2.2)
399 ,@(alist-delete "guile" (package-inputs guix))))
400 (propagated-inputs
401 (fold alist-delete
402 (package-propagated-inputs guix)
403 '("guile-ssh"))))))
404
405 (define (source-file? file stat)
406 "Return true if FILE is likely a source file, false if it is a typical
407 generated file."
408 (define (wrong-extension? file)
409 (or (string-suffix? "~" file)
410 (member (file-extension file)
411 '("o" "a" "lo" "so" "go"))))
412
413 (match (basename file)
414 ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
415 #f)
416 ((? wrong-extension?)
417 #f)
418 (_
419 #t)))
420
421 (define-public current-guix-package
422 ;; This parameter allows callers to override the package that 'current-guix'
423 ;; returns. This is useful when 'current-guix' cannot compute it by itself,
424 ;; for instance because it's not running from a source code checkout.
425 (make-parameter #f))
426
427 (define-public current-guix
428 (let* ((repository-root (delay (canonicalize-path
429 (string-append (current-source-directory)
430 "/../.."))))
431 (select? (delay (or (git-predicate (force repository-root))
432 source-file?))))
433 (lambda ()
434 "Return a package representing Guix built from the current source tree.
435 This works by adding the current source tree to the store (after filtering it
436 out) and returning a package that uses that as its 'source'."
437 (or (current-guix-package)
438 (package
439 (inherit guix)
440 (version (string-append (package-version guix) "+"))
441 (source (local-file (force repository-root) "guix-current"
442 #:recursive? #t
443 #:select? (force select?))))))))
444
445 \f
446 ;;;
447 ;;; Other tools.
448 ;;;
449
450 (define-public nix
451 (package
452 (name "nix")
453 (version "2.0.4")
454 (source (origin
455 (method url-fetch)
456 (uri (string-append "http://nixos.org/releases/nix/nix-"
457 version "/nix-" version ".tar.xz"))
458 (sha256
459 (base32
460 "0ss9svxlh1pvrdmnqjvjyqjmbqmrdbyfarvbb14i9d4bggzl0r8n"))))
461 (build-system gnu-build-system)
462 (native-inputs `(("pkg-config" ,pkg-config)))
463 (inputs `(("curl" ,curl)
464 ("bzip2" ,bzip2)
465 ("libgc" ,libgc)
466 ("libseccomp" ,libseccomp)
467 ("libsodium" ,libsodium)
468 ("openssl" ,openssl)
469 ("sqlite" ,sqlite)
470 ("xz" ,xz)))
471 (home-page "https://nixos.org/nix/")
472 (synopsis "The Nix package manager")
473 (description
474 "Nix is a purely functional package manager. This means that it treats
475 packages like values in purely functional programming languages such as
476 Haskell—they are built by functions that don't have side-effects, and they
477 never change after they have been built. Nix stores packages in the Nix
478 store, usually the directory /nix/store, where each package has its own unique
479 sub-directory.")
480 (license license:lgpl2.1+)))
481
482 (define-public stow
483 (package
484 (name "stow")
485 (version "2.3.1")
486 (source (origin
487 (method url-fetch)
488 (uri (string-append "mirror://gnu/stow/stow-"
489 version ".tar.gz"))
490 (sha256
491 (base32
492 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
493 (build-system gnu-build-system)
494 (inputs
495 `(("perl" ,perl)))
496 (native-inputs
497 `(("perl-test-simple" ,perl-test-simple)
498 ("perl-test-output" ,perl-test-output)
499 ("perl-capture-tiny" ,perl-capture-tiny)
500 ("perl-io-stringy" ,perl-io-stringy)))
501 (home-page "https://www.gnu.org/software/stow/")
502 (synopsis "Managing installed software packages")
503 (description
504 "GNU Stow is a symlink manager. It generates symlinks to directories
505 of data and makes them appear to be merged into the same directory. It is
506 typically used for managing software packages installed from source, by
507 letting you install them apart in distinct directories and then create
508 symlinks to the files in a common directory such as /usr/local.")
509 (license license:gpl3+)))
510
511 (define-public rpm
512 (package
513 (name "rpm")
514 (version "4.14.2.1")
515 (source (origin
516 (method url-fetch)
517 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
518 (version-major+minor version) ".x/rpm-"
519 version ".tar.bz2"))
520 (sha256
521 (base32
522 "1nmck2fq9h85fgs3zhh6w1avlw5y16cbz5khd459ry3jfd5w4f8i"))))
523 (build-system gnu-build-system)
524 (arguments
525 '(#:configure-flags '("--with-external-db" ;use the system's bdb
526 "--enable-python"
527 "--without-lua")
528 #:phases (modify-phases %standard-phases
529 (add-before 'configure 'set-nss-library-path
530 (lambda* (#:key inputs #:allow-other-keys)
531 (let ((nss (assoc-ref inputs "nss")))
532 (setenv "LIBRARY_PATH"
533 (string-append (getenv "LIBRARY_PATH") ":"
534 nss "/lib/nss"))
535 #t))))))
536 (native-inputs
537 `(("pkg-config" ,pkg-config)))
538 (inputs
539 `(("python" ,python)
540 ("xz" ,xz)
541 ("bdb" ,bdb)
542 ("popt" ,popt)
543 ("nss" ,nss)
544 ("nspr" ,nspr)
545 ("libarchive" ,libarchive)
546 ("file" ,file)
547 ("bzip2" ,bzip2)
548 ("zlib" ,zlib)
549 ("cpio" ,cpio)))
550 (home-page "https://rpm.org/")
551 (synopsis "The RPM Package Manager")
552 (description
553 "The RPM Package Manager (RPM) is a command-line driven package
554 management system capable of installing, uninstalling, verifying, querying,
555 and updating computer software packages. Each software package consists of an
556 archive of files along with information about the package like its version, a
557 description. There is also a library permitting developers to manage such
558 transactions from C or Python.")
559
560 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
561 (license license:gpl2+)))
562
563 (define-public python-anaconda-client
564 (package
565 (name "python-anaconda-client")
566 (version "1.6.3")
567 (source
568 (origin
569 (method url-fetch)
570 (uri (string-append "https://github.com/Anaconda-Platform/"
571 "anaconda-client/archive/" version ".tar.gz"))
572 (file-name (string-append name "-" version ".tar.gz"))
573 (sha256
574 (base32
575 "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
576 (build-system python-build-system)
577 (propagated-inputs
578 `(("python-pyyaml" ,python-pyyaml)
579 ("python-requests" ,python-requests)
580 ("python-clyent" ,python-clyent)))
581 (native-inputs
582 `(("python-pytz" ,python-pytz)
583 ("python-dateutil" ,python-dateutil)
584 ("python-mock" ,python-mock)
585 ("python-coverage" ,python-coverage)
586 ("python-pillow" ,python-pillow)))
587 (arguments
588 `(#:phases
589 (modify-phases %standard-phases
590 ;; This is needed for some tests.
591 (add-before 'check 'set-up-home
592 (lambda* _ (setenv "HOME" "/tmp") #t))
593 (add-before 'check 'remove-network-tests
594 (lambda* _
595 ;; Remove tests requiring a network connection
596 (let ((network-tests '("tests/test_upload.py"
597 "tests/test_authorizations.py"
598 "tests/test_login.py"
599 "tests/test_whoami.py"
600 "utils/notebook/tests/test_data_uri.py"
601 "utils/notebook/tests/test_base.py"
602 "utils/notebook/tests/test_downloader.py"
603 "inspect_package/tests/test_conda.py")))
604 (with-directory-excursion "binstar_client"
605 (for-each delete-file network-tests)))
606 #t)))))
607 (home-page "https://github.com/Anaconda-Platform/anaconda-client")
608 (synopsis "Anaconda Cloud command line client library")
609 (description
610 "Anaconda Cloud command line client library provides an interface to
611 Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
612 environments.")
613 (license license:bsd-3)))
614
615 (define-public python2-anaconda-client
616 (package-with-python2 python-anaconda-client))
617
618 (define-public python-conda
619 (package
620 (name "python-conda")
621 (version "4.3.16")
622 (source
623 (origin
624 (method url-fetch)
625 (uri (string-append "https://github.com/conda/conda/archive/"
626 version ".tar.gz"))
627 (file-name (string-append name "-" version ".tar.gz"))
628 (sha256
629 (base32
630 "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
631 (build-system python-build-system)
632 (arguments
633 `(#:phases
634 (modify-phases %standard-phases
635 (add-before 'build 'create-version-file
636 (lambda _
637 (with-output-to-file "conda/.version"
638 (lambda () (display ,version)))
639 #t))
640 (add-before 'check 'remove-failing-tests
641 (lambda _
642 ;; These tests require internet/network access
643 (let ((network-tests '("test_cli.py"
644 "test_create.py"
645 "test_export.py"
646 "test_fetch.py"
647 "test_history.py"
648 "test_info.py"
649 "test_install.py"
650 "test_priority.py"
651 "conda_env/test_cli.py"
652 "conda_env/test_create.py"
653 "conda_env/specs/test_notebook.py"
654 "conda_env/utils/test_notebooks.py"
655 "core/test_index.py"
656 "core/test_repodata.py")))
657 (with-directory-excursion "tests"
658 (for-each delete-file network-tests)
659
660 ;; FIXME: This test creates a file, then deletes it and tests
661 ;; that the file was deleted. For some reason it fails when
662 ;; building with guix, but does not when you run it in the
663 ;; directory left when you build with the --keep-failed
664 ;; option
665 (delete-file "gateways/disk/test_delete.py")
666 #t))))
667 (replace 'check
668 (lambda _
669 (setenv "HOME" "/tmp")
670 (invoke "py.test"))))))
671 (native-inputs
672 `(("python-cytoolz" ,python-cytoolz)
673 ("python-ruamel.yaml" ,python-ruamel.yaml)
674 ("python-requests" ,python-requests)
675 ("python-pycosat" ,python-pycosat)
676 ("python-pytest" ,python-pytest)
677 ("python-responses" ,python-responses)
678 ("python-pyyaml" ,python-pyyaml)
679 ("python-anaconda-client" ,python-anaconda-client)))
680 (home-page "https://github.com/conda/conda")
681 (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
682 (description
683 "Conda is a cross-platform, Python-agnostic binary package manager. It
684 is the package manager used by Anaconda installations, but it may be used for
685 other systems as well. Conda makes environments first-class citizens, making
686 it easy to create independent environments even for C libraries. Conda is
687 written entirely in Python.
688
689 This package provides Conda as a library.")
690 (license license:bsd-3)))
691
692 (define-public python2-conda
693 (let ((base (package-with-python2
694 (strip-python2-variant python-conda))))
695 (package (inherit base)
696 (native-inputs
697 `(("python2-enum34" ,python2-enum34)
698 ,@(package-native-inputs base))))))
699
700 (define-public conda
701 (package (inherit python-conda)
702 (name "conda")
703 (arguments
704 (substitute-keyword-arguments (package-arguments python-conda)
705 ((#:phases phases)
706 `(modify-phases ,phases
707 (replace 'build
708 (lambda* (#:key outputs #:allow-other-keys)
709 ;; This test fails when run before installation.
710 (delete-file "tests/test_activate.py")
711
712 ;; Fix broken defaults
713 (substitute* "conda/base/context.py"
714 (("return sys.prefix")
715 (string-append "return \"" (assoc-ref outputs "out") "\""))
716 (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
717 (string-append "return False if self.root_prefix == self.conda_prefix else "
718 match)))
719
720 ;; The util/setup-testing.py is used to build conda in
721 ;; application form, rather than the default, library form.
722 ;; With this, we are able to run commands like `conda --help`
723 ;; directly on the command line
724 (invoke "python" "utils/setup-testing.py" "build_py")))
725 (replace 'install
726 (lambda* (#:key inputs outputs #:allow-other-keys)
727 (let* ((out (assoc-ref outputs "out"))
728 (target (string-append out "/lib/python"
729 (python-version
730 (assoc-ref inputs "python"))
731 "/site-packages/")))
732 ;; The installer aborts if the target directory is not on
733 ;; PYTHONPATH.
734 (setenv "PYTHONPATH"
735 (string-append target ":" (getenv "PYTHONPATH")))
736
737 ;; And it aborts if the directory doesn't exist.
738 (mkdir-p target)
739 (invoke "python" "utils/setup-testing.py" "install"
740 (string-append "--prefix=" out)))))
741 ;; The "activate" and "deactivate" scripts don't need wrapping.
742 ;; They also break when they are renamed.
743 (add-after 'wrap 'undo-wrap
744 (lambda* (#:key outputs #:allow-other-keys)
745 (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/")
746 (delete-file "deactivate")
747 (rename-file ".deactivate-real" "deactivate")
748 (delete-file "activate")
749 (rename-file ".activate-real" "activate")
750 #t)))))))
751 (description
752 "Conda is a cross-platform, Python-agnostic binary package manager. It
753 is the package manager used by Anaconda installations, but it may be used for
754 other systems as well. Conda makes environments first-class citizens, making
755 it easy to create independent environments even for C libraries. Conda is
756 written entirely in Python.")))
757
758 (define-public gwl
759 (package
760 (name "gwl")
761 (version "0.1.1")
762 (source (origin
763 (method url-fetch)
764 (uri (string-append "https://www.guixwl.org/releases/gwl-"
765 version ".tar.gz"))
766 (sha256
767 (base32
768 "06pm967mq1wyggx7l0nfapw5s0k5qc5r9lawk2v3db868br779a7"))))
769 (build-system gnu-build-system)
770 (native-inputs
771 `(("autoconf" ,autoconf)
772 ("automake" ,automake)
773 ("pkg-config" ,pkg-config)))
774 (inputs
775 `(("guile" ,guile-2.2)))
776 (propagated-inputs
777 `(("guix" ,guix)
778 ("guile-commonmark" ,guile-commonmark)))
779 (home-page "https://www.guixwl.org")
780 (synopsis "Workflow management extension for GNU Guix")
781 (description "This project provides two subcommands to GNU Guix and
782 introduces two record types that provide a workflow management extension built
783 on top of GNU Guix.")
784 ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
785 ;; the web interface modules in gwl/ are licensed AGPL3+,
786 ;; and the fonts included in this package are licensed OFL1.1.
787 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
788
789 (define-public guix-jupyter
790 (package
791 (name "guix-jupyter")
792 (version "0.1.0")
793 (home-page "https://gitlab.inria.fr/guix-hpc/guix-kernel")
794 (source (origin
795 (method git-fetch)
796 (uri (git-reference (url home-page)
797 (commit (string-append "v" version))))
798 (sha256
799 (base32
800 "01z7jjkc7r7lj6637rcgpz40v8xqqyfp6871h94yvcnwm7zy9h1n"))
801 (file-name (string-append "guix-jupyter-" version "-checkout"))))
802 (build-system gnu-build-system)
803 (arguments
804 `(#:modules ((srfi srfi-26)
805 (ice-9 match)
806 (ice-9 popen)
807 (ice-9 rdelim)
808 (guix build utils)
809 (guix build gnu-build-system))
810 #:phases
811 (modify-phases %standard-phases
812 (add-after 'install 'sed-kernel-json
813 (lambda* (#:key inputs outputs #:allow-other-keys)
814 (let* ((out (assoc-ref outputs "out"))
815 (guix (assoc-ref inputs "guix"))
816 (guile (assoc-ref inputs "guile"))
817 (json (assoc-ref inputs "guile-json"))
818 (git (assoc-ref inputs "guile-git"))
819 (bs (assoc-ref inputs "guile-bytestructures"))
820 (s-zmq (assoc-ref inputs "guile-simple-zmq"))
821 (gcrypt (assoc-ref inputs "guile-gcrypt"))
822 (deps (list out s-zmq guix json git bs gcrypt))
823 (effective
824 (read-line
825 (open-pipe* OPEN_READ
826 (string-append guile "/bin/guile")
827 "-c" "(display (effective-version))")))
828 (path (map (cut string-append "-L\", \"" <>
829 "/share/guile/site/"
830 effective)
831 deps))
832 (gopath (map (cut string-append "-C\", \"" <>
833 "/lib/guile/" effective
834 "/site-ccache")
835 deps))
836 (kernel-dir (string-append out "/share/jupyter/kernels/guix/")))
837 (substitute* (string-append kernel-dir "kernel.json")
838 (("-s")
839 (string-join
840 (list (string-join path "\",\n\t\t\"")
841 (string-join gopath "\",\n\t\t\"")
842 "-s")
843 "\",\n\t\t\""))
844 (("guix-jupyter-kernel.scm")
845 (string-append out "/share/guile/site/2.2/"
846 "guix-jupyter-kernel.scm")))
847 #t))))))
848 (native-inputs
849 `(("autoconf" ,autoconf)
850 ("automake" ,automake)
851 ("pkg-config" ,pkg-config)
852
853 ;; For testing.
854 ("jupyter" ,jupyter)
855 ("python-ipython" ,python-ipython)
856 ("python-ipykernel" ,python-ipykernel)))
857 (inputs
858 `(("guix" ,guix)
859 ("guile" ,guile-2.2)))
860 (propagated-inputs
861 `(("guile-json" ,guile-json-3)
862 ("guile-simple-zmq" ,guile-simple-zmq)
863 ("guile-gcrypt" ,guile-gcrypt)))
864 (synopsis "Guix kernel for Jupyter")
865 (description
866 "Guix-Jupyter is a Jupyter kernel. It allows you to annotate notebooks
867 with information about their software dependencies, such that code is executed
868 in the right software environment. Guix-Jupyter spawns the actual kernels
869 such as @code{python-ipykernel} on behalf of the notebook user and runs them
870 in an isolated environment, in separate namespaces.")
871 (license license:gpl3+)))
872
873 (define-public gcab
874 (package
875 (name "gcab")
876 (version "1.2")
877 (source (origin
878 (method url-fetch)
879 (uri (string-append "mirror://gnome/sources/gcab/"
880 version "/gcab-" version ".tar.xz"))
881 (sha256
882 (base32
883 "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas"))))
884 (build-system meson-build-system)
885 (native-inputs
886 `(("glib:bin" ,glib "bin") ; for glib-mkenums
887 ("intltool" ,intltool)
888 ("pkg-config" ,pkg-config)
889 ("vala" ,vala)))
890 (inputs
891 `(("glib" ,glib)
892 ("zlib" ,zlib)))
893 (arguments
894 `(#:configure-flags
895 ;; XXX This ‘documentation’ is for developers, and fails informatively:
896 ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
897 (list "-Ddocs=false"
898 "-Dintrospection=false")))
899 (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
900 (synopsis "Microsoft Cabinet file manipulation library")
901 (description
902 "The libgcab library provides GObject functions to read, write, and modify
903 Microsoft cabinet (.@dfn{CAB}) files.")
904 (license (list license:gpl2+ ; tests/testsuite.at
905 license:lgpl2.1+)))) ; the rest
906
907 (define-public msitools
908 (package
909 (name "msitools")
910 (version "0.100")
911 (source (origin
912 (method url-fetch)
913 (uri (string-append "mirror://gnome/sources/msitools/"
914 version "/msitools-" version ".tar.xz"))
915 (sha256
916 (base32
917 "1skq17qr2ic4qr3779j49byfm8rncwbsq9rj1a33ncn2m7isdwdv"))))
918 (build-system gnu-build-system)
919 (native-inputs
920 `(("bison" ,bison)
921 ("pkg-config" ,pkg-config)))
922 (inputs
923 `(("gcab" ,gcab)
924 ("glib" ,glib)
925 ("libgsf" ,libgsf)
926 ("libxml2" ,libxml2)
927 ("uuid" ,util-linux)))
928 (home-page "https://wiki.gnome.org/msitools")
929 (synopsis "Windows Installer file manipulation tool")
930 (description
931 "msitools is a collection of command-line tools to inspect, extract, build,
932 and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
933 for packaging and deployment of cross-compiled Windows applications.")
934 (license license:lgpl2.1+)))
935
936 (define-public libostree
937 (package
938 (name "libostree")
939 (version "2019.3")
940 (source (origin
941 (method url-fetch)
942 (uri (string-append
943 "https://github.com/ostreedev/ostree/releases/download/v"
944 (version-major+minor version) "/libostree-" version ".tar.xz"))
945 (sha256
946 (base32
947 "1r07yqbc9iiq0lzv1pryppd35fv695ym8r040msbfc93pmiy77y0"))))
948 (build-system gnu-build-system)
949 (arguments
950 '(#:phases
951 (modify-phases %standard-phases
952 (add-before 'check 'pre-check
953 (lambda _
954 ;; Don't try to use the non-existing '/var/tmp' as test
955 ;; directory.
956 (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
957 #t)))
958 ;; XXX: fails with:
959 ;; tap-driver.sh: missing test plan
960 ;; tap-driver.sh: internal error getting exit status
961 ;; tap-driver.sh: fatal: I/O or internal error
962 #:tests? #f))
963 (native-inputs
964 `(("attr" ,attr) ; for tests
965 ("bison" ,bison)
966 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
967 ("gobject-introspection" ,gobject-introspection)
968 ("pkg-config" ,pkg-config)
969 ("xsltproc" ,libxslt)))
970 (inputs
971 `(("avahi" ,avahi)
972 ("docbook-xml" ,docbook-xml-4.2)
973 ("docbook-xsl" ,docbook-xsl)
974 ("e2fsprogs" ,e2fsprogs)
975 ("fuse" ,fuse)
976 ("glib" ,glib)
977 ("gpgme" ,gpgme)
978 ("libarchive" ,libarchive)
979 ("libsoup" ,libsoup)
980 ("util-linux" ,util-linux)))
981 (home-page "https://ostree.readthedocs.io/en/latest/")
982 (synopsis "Operating system and container binary deployment and upgrades")
983 (description
984 "@code{libostree} is both a shared library and suite of command line
985 tools that combines a \"git-like\" model for committing and downloading
986 bootable file system trees, along with a layer for deploying them and managing
987 the boot loader configuration.")
988 (license license:lgpl2.0+)))
989
990 (define-public flatpak
991 (package
992 (name "flatpak")
993 (version "1.4.3")
994 (source
995 (origin
996 (method url-fetch)
997 (uri (string-append "https://github.com/flatpak/flatpak/releases/download/"
998 version "/flatpak-" version ".tar.xz"))
999 (sha256
1000 (base32
1001 "11bfxmv8pxlb5x0lb2rsl45615fzfvq5r6wldf0l6ab2ngryd7i7"))))
1002
1003 ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
1004 ;; find the TLS backend in glib-networking.
1005 (build-system glib-or-gtk-build-system)
1006
1007 (arguments
1008 '(#:tests? #f ;; Tests fail due to trying to create files where it can't.
1009 #:configure-flags (list
1010 "--enable-documentation=no" ;; FIXME
1011 "--enable-system-helper=no"
1012 "--localstatedir=/var"
1013 (string-append "--with-system-bubblewrap="
1014 (assoc-ref %build-inputs "bubblewrap")
1015 "/bin/bwrap"))))
1016 (native-inputs `(("bison" ,bison)
1017 ("gettext" ,gnu-gettext)
1018 ("glib:bin" ,glib "bin") ; for glib-mkenums + gdbus-codegen
1019 ("gobject-introspection" ,gobject-introspection)
1020 ("libcap" ,libcap)
1021 ("pkg-config" ,pkg-config)))
1022 (propagated-inputs `(("glib-networking" ,glib-networking)
1023 ("gnupg" ,gnupg)
1024 ("gsettings-desktop-schemas"
1025 ,gsettings-desktop-schemas)))
1026 (inputs `(("appstream-glib" ,appstream-glib)
1027 ("bubblewrap" ,bubblewrap)
1028 ("dconf" ,dconf)
1029 ("fuse" ,fuse)
1030 ("gdk-pixbuf" ,gdk-pixbuf)
1031 ("gpgme" ,gpgme)
1032 ("json-glib" ,json-glib)
1033 ("libarchive" ,libarchive)
1034 ("libostree" ,libostree)
1035 ("libseccomp" ,libseccomp)
1036 ("libsoup" ,libsoup)
1037 ("libxau" ,libxau)
1038 ("libxml2" ,libxml2)
1039 ("util-linux" ,util-linux)))
1040 (home-page "https://flatpak.org")
1041 (synopsis "System for building, distributing, and running sandboxed desktop
1042 applications")
1043 (description "Flatpak is a system for building, distributing, and running
1044 sandboxed desktop applications on GNU/Linux.")
1045 (license license:lgpl2.1+)))