gnu: bootstrap: Memoize 'bootstrap-origin'.
[jackhill/guix/guix.git] / gnu / packages / package-management.scm
CommitLineData
bbe8d8f0 1;;; GNU Guix --- Functional package management for GNU
0991fd53 2;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 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>
49d9fce8 5;;; Copyright © 2017, 2018 Oleg Pykhalov <go.wigust@gmail.com>
58a308e0 6;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
a1785cfb 7;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
76fa5e04 8;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
89ea6252 9;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
3d391309 10;;; Copyright © 2018 Sou Bunnbu <iyzsong@member.fsf.org>
30833b13 11;;; Copyright © 2018, 2019 Eric Bavier <bavier@member.fsf.org>
e227f248 12;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
c0023514 13;;; Copyright © 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
bbe8d8f0
LC
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)
8a43ff10 31 #:use-module (gnu packages)
37756a13 32 #:use-module (gnu packages acl)
3d391309
SB
33 #:use-module (gnu packages attr)
34 #:use-module (gnu packages avahi)
37756a13 35 #:use-module (gnu packages autotools)
e3e1ecf6 36 #:use-module (gnu packages backup)
8a973abc 37 #:use-module (gnu packages base)
37756a13 38 #:use-module (gnu packages bdw-gc)
3d391309 39 #:use-module (gnu packages bison)
3e5750af 40 #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin'
ac257f12 41 #:use-module (gnu packages check)
38cf2ba0 42 #:use-module (gnu packages compression)
37756a13 43 #:use-module (gnu packages cpio)
e6c8199b 44 #:use-module (gnu packages crypto)
37756a13 45 #:use-module (gnu packages curl)
255d1bbe 46 #:use-module (gnu packages dbm)
3d391309 47 #:use-module (gnu packages docbook)
37756a13 48 #:use-module (gnu packages file)
480af4d6 49 #:use-module (gnu packages gettext)
98a11b7f 50 #:use-module (gnu packages glib)
cb390925 51 #:use-module (gnu packages gnome)
37756a13 52 #:use-module (gnu packages gnupg)
37756a13 53 #:use-module (gnu packages graphviz)
36e1ab84 54 #:use-module (gnu packages gtk)
37756a13 55 #:use-module (gnu packages guile)
0791437f 56 #:use-module (gnu packages guile-xyz)
cb390925 57 #:use-module (gnu packages linux)
58a308e0 58 #:use-module (gnu packages lisp)
37756a13 59 #:use-module (gnu packages man)
e3e1ecf6 60 #:use-module (gnu packages nettle)
aff0cce9 61 #:use-module (gnu packages nss)
37756a13 62 #:use-module (gnu packages patchutils)
fcb0109d 63 #:use-module (gnu packages perl)
5ccde207 64 #:use-module (gnu packages perl-check)
37756a13
TGR
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages popt)
e3e1ecf6 67 #:use-module (gnu packages python)
1b2f753d 68 #:use-module (gnu packages python-web)
44d10b1f 69 #:use-module (gnu packages python-xyz)
37756a13 70 #:use-module (gnu packages serialization)
cd0322a3 71 #:use-module (gnu packages sqlite)
37756a13
TGR
72 #:use-module (gnu packages ssh)
73 #:use-module (gnu packages texinfo)
33dc54b0 74 #:use-module (gnu packages time)
04eb0fab 75 #:use-module (gnu packages tls)
5dbeccf5 76 #:use-module (gnu packages vim)
36e1ab84 77 #:use-module (gnu packages virtualization)
37756a13 78 #:use-module (gnu packages web)
cb390925 79 #:use-module (gnu packages xml)
36e1ab84 80 #:use-module (gnu packages xorg)
16360cc8 81 #:use-module (guix build-system glib-or-gtk)
37756a13 82 #:use-module (guix build-system gnu)
44118720 83 #:use-module (guix build-system meson)
37756a13
TGR
84 #:use-module (guix build-system python)
85 #:use-module (guix download)
86 #:use-module (guix gexp)
87 #:use-module (guix git-download)
7ed6343f 88 #:use-module ((guix licenses) #:prefix license:)
37756a13
TGR
89 #:use-module (guix packages)
90 #:use-module (guix utils)
91 #:use-module (ice-9 match)
92 #:use-module (srfi srfi-1))
bbe8d8f0 93
39de700c
LC
94(define (boot-guile-uri arch)
95 "Return the URI for the bootstrap Guile tarball for ARCH."
aef81a81
LC
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)
b31b0155
LC
101 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
102 arch "-linux/20170217/guile-2.0.14.tar.xz"))
aef81a81
LC
103 (else
104 (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/"
105 arch "-linux"
106 "/20131110/guile-2.0.9.tar.xz"))))
39de700c 107
994a1494
LC
108(define-public guix
109 ;; Latest version of Guix, which may or may not correspond to a release.
94fa8d76
LC
110 ;; Note: the 'update-guix-package.scm' script expects this definition to
111 ;; start precisely like this.
82042951 112 (let ((version "1.0.1")
e63b3144
LC
113 (commit "f63e49342bb8536d24b35ed57a2be978556f149e")
114 (revision 9))
994a1494
LC
115 (package
116 (name "guix")
ab2419e5 117
994a1494
LC
118 (version (if (zero? revision)
119 version
120 (string-append version "-"
121 (number->string revision)
4b7917f2 122 "." (string-take commit 7))))
994a1494
LC
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
e63b3144 130 "18bxcbxcwxlgfgdapjyxg0d98c9g00ivjhhb2xyg42dbmbkh6nqy"))
994a1494
LC
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")
994a1494
LC
140
141 ;; Set 'DOT_USER_PROGRAM' to the empty string so
142 ;; we don't keep a reference to Graphviz, whose
59e80445
LC
143 ;; closure is pretty big (too big for the Guix
144 ;; system installation image.)
4b7917f2
LC
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")
994a1494
LC
151 #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097>
152
153 #:modules ((guix build gnu-build-system)
154 (guix build utils)
c9117162 155 (srfi srfi-26)
994a1494
LC
156 (ice-9 popen)
157 (ice-9 rdelim))
158
159 #:phases (modify-phases %standard-phases
189be331 160 (replace 'bootstrap
994a1494
LC
161 (lambda _
162 ;; Make sure 'msgmerge' can modify the PO files.
163 (for-each (lambda (po)
164 (chmod po #o666))
165 (find-files "." "\\.po$"))
ab2419e5 166
8833a647
LC
167 (patch-shebang "build-aux/git-version-gen")
168
91c619eb
LC
169 (call-with-output-file ".tarball-version"
170 (lambda (port)
171 (display ,version port)))
172
92fcb831 173 (invoke "sh" "bootstrap")))
59127916 174 (add-before 'check 'copy-bootstrap-guile
994a1494 175 (lambda* (#:key system inputs #:allow-other-keys)
59127916
LC
176 ;; Copy the bootstrap guile tarball in the store used
177 ;; by the test suite.
94d2ff6d
LC
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)))))))
39de700c 189
94d2ff6d 190 (intern (assoc-ref inputs "boot-guile") #f)
59127916
LC
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"))
94d2ff6d 196 '((intern (assoc-ref inputs "boot-guile/i686") #f))
59127916 197 '())
94d2ff6d
LC
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"))
994a1494 204 #t))
40e89f5b 205 (add-after 'unpack 'disable-failing-tests
994a1494
LC
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)
dd1640ee
LC
227 ;; Make sure the 'guix' command finds GnuTLS,
228 ;; Guile-JSON, and Guile-Git automatically.
994a1494
LC
229 (let* ((out (assoc-ref outputs "out"))
230 (guile (assoc-ref inputs "guile"))
ca719424 231 (gcrypt (assoc-ref inputs "guile-gcrypt"))
994a1494 232 (json (assoc-ref inputs "guile-json"))
c5a2e1ff 233 (sqlite (assoc-ref inputs "guile-sqlite3"))
9ca8aa38 234 (git (assoc-ref inputs "guile-git"))
dd1640ee
LC
235 (bs (assoc-ref inputs
236 "guile-bytestructures"))
994a1494
LC
237 (ssh (assoc-ref inputs "guile-ssh"))
238 (gnutls (assoc-ref inputs "gnutls"))
8a973abc 239 (locales (assoc-ref inputs "glibc-utf8-locales"))
ca719424
LC
240 (deps (list gcrypt json sqlite gnutls
241 git bs ssh))
994a1494
LC
242 (effective
243 (read-line
244 (open-pipe* OPEN_READ
245 (string-append guile "/bin/guile")
246 "-c" "(display (effective-version))")))
c9117162
LC
247 (path (string-join
248 (map (cut string-append <>
249 "/share/guile/site/"
250 effective)
6f1ce09d 251 (delete #f deps))
c9117162
LC
252 ":"))
253 (gopath (string-join
254 (map (cut string-append <>
255 "/lib/guile/" effective
256 "/site-ccache")
6f1ce09d 257 (delete #f deps))
8a973abc
LC
258 ":"))
259 (locpath (string-append locales "/lib/locale")))
61cdad35 260
994a1494
LC
261 (wrap-program (string-append out "/bin/guix")
262 `("GUILE_LOAD_PATH" ":" prefix (,path))
8a973abc
LC
263 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))
264 `("GUIX_LOCPATH" ":" suffix (,locpath)))
61cdad35 265
994a1494
LC
266 #t))))))
267 (native-inputs `(("pkg-config" ,pkg-config)
a7db8540 268
994a1494
LC
269 ;; XXX: Keep the development inputs here even though
270 ;; they're unnecessary, just so that 'guix environment
271 ;; guix' always contains them.
464f5447 272 ("autoconf" ,autoconf-wrapper)
994a1494
LC
273 ("automake" ,automake)
274 ("gettext" ,gettext-minimal)
275 ("texinfo" ,texinfo)
276 ("graphviz" ,graphviz)
76fa5e04
JL
277 ("help2man" ,help2man)
278 ("po4a" ,po4a)))
994a1494 279 (inputs
3e5750af
LC
280 `(("bzip2" ,bzip2)
281 ("gzip" ,gzip)
94d2ff6d 282 ("zlib" ,zlib) ;for 'guix publish'
2e5c71b2 283 ("lzlib" ,lzlib) ;for 'guix publish' and 'guix substitute'
2d195e67 284
3e5750af
LC
285 ("sqlite" ,sqlite)
286 ("libgcrypt" ,libgcrypt)
4e80516c 287
2abd76e8 288 ("guile" ,guile-2.2)
bbe8d8f0 289
94d2ff6d
LC
290 ;; Some of the tests use "unshare" when it is available.
291 ("util-linux" ,util-linux)
292
59127916
LC
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")))
8a973abc
LC
299 '())
300
94d2ff6d
LC
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
8a973abc 307 ("glibc-utf8-locales" ,glibc-utf8-locales)))
994a1494 308 (propagated-inputs
52cabc6f 309 `(("gnutls" ,gnutls)
ca719424 310 ("guile-gcrypt" ,guile-gcrypt)
2eb0628a 311 ("guile-json" ,guile-json-3)
c5a2e1ff 312 ("guile-sqlite3" ,guile-sqlite3)
9ca8aa38
LC
313 ("guile-ssh" ,guile-ssh)
314 ("guile-git" ,guile-git)))
f1082ec1 315
994a1494
LC
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
c5779c93 320also a distribution thereof. It includes a virtual machine image. Besides
79c311b8 321the usual package management features, it also supports transactional
c5779c93
LC
322upgrades and roll-backs, per-user profiles, and much more. It is based on
323the Nix package manager.")
7ed6343f 324 (license license:gpl3+)
994a1494 325 (properties '((ftp-server . "alpha.gnu.org"))))))
3ad9a0b1 326
baed9236
LC
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)
2eb0628a 343 ("guile-json" ,guile-json-3)
3b0153bd 344 ("guile-gcrypt" ,guile-gcrypt)
1fb947f6
LC
345 ,@(fold alist-delete (package-inputs guix)
346 '("boot-guile" "boot-guile/i686" "util-linux"))))
347
baed9236
LC
348 (propagated-inputs '())
349
350 (arguments
351 (substitute-keyword-arguments (package-arguments guix)
1fb947f6
LC
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")))
baed9236
LC
357 ((#:tests? #f #f)
358 #f)
359 ((#:phases phases '%standard-phases)
360 `(modify-phases ,phases
74781c65
LC
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))
baed9236
LC
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)
74781c65 383 (invoke "make" "install-binPROGRAMS")))
baed9236
LC
384 (delete 'wrap-program)))))))
385
82ce81ba 386(define-public guile2.0-guix
0991fd53 387 (deprecated-package "guile2.0-guix" guix))
82ce81ba 388
6f1ce09d
EB
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.
0991fd53
LC
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"))))))
6f1ce09d 404
04eb0fab
LC
405(define (source-file? file stat)
406 "Return true if FILE is likely a source file, false if it is a typical
407generated 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
7e6d8d36
LC
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
04eb0fab 427(define-public current-guix
863519f6
LC
428 (let* ((repository-root (delay (canonicalize-path
429 (string-append (current-source-directory)
430 "/../.."))))
431 (select? (delay (or (git-predicate (force repository-root))
a9d5e4be 432 source-file?))))
04eb0fab
LC
433 (lambda ()
434 "Return a package representing Guix built from the current source tree.
435This works by adding the current source tree to the store (after filtering it
436out) and returning a package that uses that as its 'source'."
7e6d8d36
LC
437 (or (current-guix-package)
438 (package
439 (inherit guix)
440 (version (string-append (package-version guix) "+"))
863519f6 441 (source (local-file (force repository-root) "guix-current"
7e6d8d36
LC
442 #:recursive? #t
443 #:select? (force select?))))))))
04eb0fab
LC
444
445\f
446;;;
447;;; Other tools.
448;;;
449
fcb0109d
LC
450(define-public nix
451 (package
452 (name "nix")
e6c8199b 453 (version "2.0.4")
fcb0109d
LC
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
e6c8199b 460 "0ss9svxlh1pvrdmnqjvjyqjmbqmrdbyfarvbb14i9d4bggzl0r8n"))))
fcb0109d 461 (build-system gnu-build-system)
e6c8199b 462 (native-inputs `(("pkg-config" ,pkg-config)))
fcb0109d 463 (inputs `(("curl" ,curl)
e6c8199b 464 ("bzip2" ,bzip2)
fcb0109d 465 ("libgc" ,libgc)
e6c8199b
SB
466 ("libseccomp" ,libseccomp)
467 ("libsodium" ,libsodium)
468 ("openssl" ,openssl)
fcb0109d 469 ("sqlite" ,sqlite)
e6c8199b 470 ("xz" ,xz)))
775989c7 471 (home-page "https://nixos.org/nix/")
fcb0109d
LC
472 (synopsis "The Nix package manager")
473 (description
474 "Nix is a purely functional package manager. This means that it treats
475packages like values in purely functional programming languages such as
476Haskell—they are built by functions that don't have side-effects, and they
477never change after they have been built. Nix stores packages in the Nix
478store, usually the directory /nix/store, where each package has its own unique
479sub-directory.")
7ed6343f 480 (license license:lgpl2.1+)))
a881a40c 481
8d422e25
RW
482(define-public stow
483 (package
484 (name "stow")
7cc98992 485 (version "2.3.1")
8d422e25
RW
486 (source (origin
487 (method url-fetch)
488 (uri (string-append "mirror://gnu/stow/stow-"
489 version ".tar.gz"))
490 (sha256
491 (base32
7cc98992 492 "0jrxy12ywn7smdzdnvwzjw77l6knx6jkj2rckgykg1dpf6bdkm89"))))
8d422e25
RW
493 (build-system gnu-build-system)
494 (inputs
7cc98992 495 `(("perl" ,perl)))
8d422e25
RW
496 (native-inputs
497 `(("perl-test-simple" ,perl-test-simple)
498 ("perl-test-output" ,perl-test-output)
ddfd70da
LC
499 ("perl-capture-tiny" ,perl-capture-tiny)
500 ("perl-io-stringy" ,perl-io-stringy)))
8d422e25
RW
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
505of data and makes them appear to be merged into the same directory. It is
506typically used for managing software packages installed from source, by
507letting you install them apart in distinct directories and then create
508symlinks to the files in a common directory such as /usr/local.")
bdb51ed6 509 (license license:gpl3+)))
e3e1ecf6
LC
510
511(define-public rpm
512 (package
513 (name "rpm")
c0023514 514 (version "4.14.2.1")
e3e1ecf6
LC
515 (source (origin
516 (method url-fetch)
623cc34c
EB
517 (uri (string-append "http://ftp.rpm.org/releases/rpm-"
518 (version-major+minor version) ".x/rpm-"
e3e1ecf6
LC
519 version ".tar.bz2"))
520 (sha256
521 (base32
c0023514 522 "1nmck2fq9h85fgs3zhh6w1avlw5y16cbz5khd459ry3jfd5w4f8i"))))
e3e1ecf6
LC
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
91a3c800 529 (add-before 'configure 'set-nss-library-path
e3e1ecf6 530 (lambda* (#:key inputs #:allow-other-keys)
91a3c800 531 (let ((nss (assoc-ref inputs "nss")))
e3e1ecf6
LC
532 (setenv "LIBRARY_PATH"
533 (string-append (getenv "LIBRARY_PATH") ":"
534 nss "/lib/nss"))
91a3c800 535 #t))))))
e3e1ecf6
LC
536 (native-inputs
537 `(("pkg-config" ,pkg-config)))
538 (inputs
c0023514 539 `(("python" ,python)
e3e1ecf6
LC
540 ("xz" ,xz)
541 ("bdb" ,bdb)
542 ("popt" ,popt)
543 ("nss" ,nss)
544 ("nspr" ,nspr)
545 ("libarchive" ,libarchive)
e3e1ecf6
LC
546 ("file" ,file)
547 ("bzip2" ,bzip2)
548 ("zlib" ,zlib)
549 ("cpio" ,cpio)))
c0023514 550 (home-page "https://rpm.org/")
e3e1ecf6
LC
551 (synopsis "The RPM Package Manager")
552 (description
553 "The RPM Package Manager (RPM) is a command-line driven package
554management system capable of installing, uninstalling, verifying, querying,
555and updating computer software packages. Each software package consists of an
556archive of files along with information about the package like its version, a
557description. There is also a library permitting developers to manage such
558transactions from C or Python.")
559
560 ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
7ed6343f 561 (license license:gpl2+)))
e3e1ecf6 562
513d35f1
MFM
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
611Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
612environments.")
7ed6343f 613 (license license:bsd-3)))
513d35f1
MFM
614
615(define-public python2-anaconda-client
616 (package-with-python2 python-anaconda-client))
4bc08b6e
MFM
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")
675e7bba 670 (invoke "py.test"))))))
4bc08b6e 671 (native-inputs
e227f248
EF
672 `(("python-cytoolz" ,python-cytoolz)
673 ("python-ruamel.yaml" ,python-ruamel.yaml)
4bc08b6e
MFM
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
684is the package manager used by Anaconda installations, but it may be used for
685other systems as well. Conda makes environments first-class citizens, making
686it easy to create independent environments even for C libraries. Conda is
687written entirely in Python.
688
689This package provides Conda as a library.")
7ed6343f 690 (license license:bsd-3)))
4bc08b6e
MFM
691
692(define-public python2-conda
2c5cf844
LF
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))))))
84fcb580
MFM
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
d691e966 724 (invoke "python" "utils/setup-testing.py" "build_py")))
84fcb580
MFM
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"
9c2563a8 729 (python-version
84fcb580
MFM
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)
d691e966
EF
739 (invoke "python" "utils/setup-testing.py" "install"
740 (string-append "--prefix=" out)))))
1d84500a
RW
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)))))))
84fcb580
MFM
751 (description
752 "Conda is a cross-platform, Python-agnostic binary package manager. It
753is the package manager used by Anaconda installations, but it may be used for
754other systems as well. Conda makes environments first-class citizens, making
755it easy to create independent environments even for C libraries. Conda is
756written entirely in Python.")))
58a308e0
RJ
757
758(define-public gwl
759 (package
760 (name "gwl")
fb6ca493 761 (version "0.1.1")
58a308e0
RJ
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
fb6ca493 768 "06pm967mq1wyggx7l0nfapw5s0k5qc5r9lawk2v3db868br779a7"))))
58a308e0
RJ
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
782introduces two record types that provide a workflow management extension built
783on 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.
7ed6343f 787 (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
98a11b7f 788
fc1fe722
LC
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.
d3650775
LC
854 ("jupyter" ,jupyter)
855 ("python-ipython" ,python-ipython)
856 ("python-ipykernel" ,python-ipykernel)))
fc1fe722
LC
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
867with information about their software dependencies, such that code is executed
868in the right software environment. Guix-Jupyter spawns the actual kernels
869such as @code{python-ipykernel} on behalf of the notebook user and runs them
870in an isolated environment, in separate namespaces.")
871 (license license:gpl3+)))
872
98a11b7f
TGR
873(define-public gcab
874 (package
875 (name "gcab")
a1785cfb 876 (version "1.2")
98a11b7f
TGR
877 (source (origin
878 (method url-fetch)
41eac186
TGR
879 (uri (string-append "mirror://gnome/sources/gcab/"
880 version "/gcab-" version ".tar.xz"))
98a11b7f
TGR
881 (sha256
882 (base32
a1785cfb 883 "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas"))))
44118720 884 (build-system meson-build-system)
98a11b7f 885 (native-inputs
44118720
TGR
886 `(("glib:bin" ,glib "bin") ; for glib-mkenums
887 ("intltool" ,intltool)
888 ("pkg-config" ,pkg-config)
889 ("vala" ,vala)))
98a11b7f
TGR
890 (inputs
891 `(("glib" ,glib)
892 ("zlib" ,zlib)))
44118720
TGR
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")))
98a11b7f
TGR
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
903Microsoft cabinet (.@dfn{CAB}) files.")
904 (license (list license:gpl2+ ; tests/testsuite.at
905 license:lgpl2.1+)))) ; the rest
cb390925
TGR
906
907(define-public msitools
908 (package
909 (name "msitools")
9e4da9f2 910 (version "0.99")
cb390925
TGR
911 (source (origin
912 (method url-fetch)
a4469936
TGR
913 (uri (string-append "mirror://gnome/sources/msitools/"
914 version "/msitools-" version ".tar.xz"))
cb390925
TGR
915 (sha256
916 (base32
9e4da9f2 917 "0d9nidn5zc81bc30w119933rn2g87mrsqyqkndg20srkbsd96xfl"))))
cb390925
TGR
918 (build-system gnu-build-system)
919 (native-inputs
9e4da9f2
TGR
920 `(("bison" ,bison)
921 ("pkg-config" ,pkg-config)))
cb390925
TGR
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,
932and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
933for packaging and deployment of cross-compiled Windows applications.")
934 (license license:lgpl2.1+)))
3d391309
SB
935
936(define-public libostree
937 (package
938 (name "libostree")
5f97cc23 939 (version "2019.3")
3d391309
SB
940 (source (origin
941 (method url-fetch)
942 (uri (string-append
943 "https://github.com/ostreedev/ostree/releases/download/v"
83d4da12 944 (version-major+minor version) "/libostree-" version ".tar.xz"))
3d391309
SB
945 (sha256
946 (base32
5f97cc23 947 "1r07yqbc9iiq0lzv1pryppd35fv695ym8r040msbfc93pmiy77y0"))))
3d391309
SB
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:
5f97cc23 959 ;; tap-driver.sh: missing test plan
3d391309
SB
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)
5f97cc23 966 ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
3d391309
SB
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)
3d391309
SB
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
985tools that combines a \"git-like\" model for committing and downloading
52beae7b
TGR
986bootable file system trees, along with a layer for deploying them and managing
987the boot loader configuration.")
3d391309 988 (license license:lgpl2.0+)))
36e1ab84
RH
989
990(define-public flatpak
991 (package
122db9a6 992 (name "flatpak")
04dc9829 993 (version "1.4.3")
122db9a6
RH
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
04dc9829 1001 "11bfxmv8pxlb5x0lb2rsl45615fzfvq5r6wldf0l6ab2ngryd7i7"))))
16360cc8
LC
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
122db9a6
RH
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)))
75f0bda7
RH
1022 (propagated-inputs `(("glib-networking" ,glib-networking)
1023 ("gnupg" ,gnupg)
1024 ("gsettings-desktop-schemas"
1025 ,gsettings-desktop-schemas)))
122db9a6
RH
1026 (inputs `(("appstream-glib" ,appstream-glib)
1027 ("bubblewrap" ,bubblewrap)
89ea6252 1028 ("dconf" ,dconf)
b0c48829 1029 ("fuse" ,fuse)
122db9a6
RH
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)
122db9a6
RH
1039 ("util-linux" ,util-linux)))
1040 (home-page "https://flatpak.org")
1041 (synopsis "System for building, distributing, and running sandboxed desktop
36e1ab84 1042applications")
122db9a6 1043 (description "Flatpak is a system for building, distributing, and running
36e1ab84 1044sandboxed desktop applications on GNU/Linux.")
122db9a6 1045 (license license:lgpl2.1+)))