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