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