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