Commit | Line | Data |
---|---|---|
bbe8d8f0 | 1 | ;;; GNU Guix --- Functional package management for GNU |
a9174065 | 2 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017 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> |
a881a40c | 5 | ;;; Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com> |
58a308e0 | 6 | ;;; Copyright © 2017 Roel Janssen <roel@gnu.org> |
bbe8d8f0 LC |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages package-management) | |
24 | #:use-module (guix packages) | |
25 | #:use-module (guix download) | |
480af4d6 | 26 | #:use-module (guix git-download) |
04eb0fab | 27 | #:use-module (guix gexp) |
480af4d6 | 28 | #:use-module (guix utils) |
bbe8d8f0 | 29 | #:use-module (guix build-system gnu) |
e3e1ecf6 | 30 | #:use-module (guix build-system python) |
a881a40c | 31 | #:use-module (guix build-system emacs) |
58a308e0 RJ |
32 | #:use-module ((guix licenses) #:select (gpl2+ gpl3+ agpl3+ lgpl2.1+ asl2.0 |
33 | bsd-3 silofl1.1)) | |
8a43ff10 | 34 | #:use-module (gnu packages) |
bbe8d8f0 | 35 | #:use-module (gnu packages guile) |
e3e1ecf6 LC |
36 | #:use-module (gnu packages file) |
37 | #:use-module (gnu packages backup) | |
ac257f12 | 38 | #:use-module (gnu packages check) |
38cf2ba0 | 39 | #:use-module (gnu packages compression) |
bbe8d8f0 | 40 | #:use-module (gnu packages gnupg) |
5f96f303 | 41 | #:use-module (gnu packages databases) |
480af4d6 LC |
42 | #:use-module (gnu packages graphviz) |
43 | #:use-module (gnu packages pkg-config) | |
44 | #:use-module (gnu packages autotools) | |
45 | #:use-module (gnu packages gettext) | |
58a308e0 | 46 | #:use-module (gnu packages lisp) |
fcb0109d | 47 | #:use-module (gnu packages texinfo) |
e3e1ecf6 | 48 | #:use-module (gnu packages nettle) |
fcb0109d | 49 | #:use-module (gnu packages perl) |
5ccde207 | 50 | #:use-module (gnu packages perl-check) |
fcb0109d LC |
51 | #:use-module (gnu packages curl) |
52 | #:use-module (gnu packages web) | |
e21adc76 | 53 | #:use-module (gnu packages man) |
a7fd7b68 | 54 | #:use-module (gnu packages bdw-gc) |
5dbeccf5 | 55 | #:use-module (gnu packages patchutils) |
e3e1ecf6 | 56 | #:use-module (gnu packages python) |
1b2f753d | 57 | #:use-module (gnu packages python-web) |
e3e1ecf6 LC |
58 | #:use-module (gnu packages popt) |
59 | #:use-module (gnu packages gnuzilla) | |
60 | #:use-module (gnu packages cpio) | |
33dc54b0 | 61 | #:use-module (gnu packages time) |
04eb0fab | 62 | #:use-module (gnu packages tls) |
43ddcd72 | 63 | #:use-module (gnu packages ssh) |
5dbeccf5 | 64 | #:use-module (gnu packages vim) |
4bc08b6e | 65 | #:use-module (gnu packages serialization) |
2af6be91 | 66 | #:use-module (gnu packages acl) |
82ce81ba | 67 | #:use-module (srfi srfi-1) |
04eb0fab | 68 | #:use-module (ice-9 match)) |
bbe8d8f0 | 69 | |
39de700c LC |
70 | (define (boot-guile-uri arch) |
71 | "Return the URI for the bootstrap Guile tarball for ARCH." | |
aef81a81 LC |
72 | (cond ((string=? "armhf" arch) |
73 | (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/" | |
74 | arch "-linux" | |
75 | "/20150101/guile-2.0.11.tar.xz")) | |
76 | ((string=? "aarch64" arch) | |
b31b0155 LC |
77 | (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/" |
78 | arch "-linux/20170217/guile-2.0.14.tar.xz")) | |
aef81a81 LC |
79 | (else |
80 | (string-append "http://alpha.gnu.org/gnu/guix/bootstrap/" | |
81 | arch "-linux" | |
82 | "/20131110/guile-2.0.9.tar.xz")))) | |
39de700c | 83 | |
994a1494 LC |
84 | (define-public guix |
85 | ;; Latest version of Guix, which may or may not correspond to a release. | |
94fa8d76 LC |
86 | ;; Note: the 'update-guix-package.scm' script expects this definition to |
87 | ;; start precisely like this. | |
ad4953bc | 88 | (let ((version "0.14.0") |
0dd91619 LC |
89 | (commit "ad4953bc0ec1684c49c0934304c7ec200a0cd280") |
90 | (revision 1)) | |
994a1494 LC |
91 | (package |
92 | (name "guix") | |
ab2419e5 | 93 | |
994a1494 LC |
94 | (version (if (zero? revision) |
95 | version | |
96 | (string-append version "-" | |
97 | (number->string revision) | |
4b7917f2 | 98 | "." (string-take commit 7)))) |
994a1494 LC |
99 | (source (origin |
100 | (method git-fetch) | |
101 | (uri (git-reference | |
102 | (url "https://git.savannah.gnu.org/r/guix.git") | |
103 | (commit commit))) | |
104 | (sha256 | |
105 | (base32 | |
0dd91619 | 106 | "0ngra4cb1kf3kwccslmhnvlr116drsnbqrsjniq1hrg5mqf6vf1b")) |
994a1494 LC |
107 | (file-name (string-append "guix-" version "-checkout")))) |
108 | (build-system gnu-build-system) | |
109 | (arguments | |
110 | `(#:configure-flags (list | |
111 | "--localstatedir=/var" | |
112 | "--sysconfdir=/etc" | |
113 | (string-append "--with-bash-completion-dir=" | |
114 | (assoc-ref %outputs "out") | |
115 | "/etc/bash_completion.d") | |
116 | (string-append "--with-libgcrypt-prefix=" | |
117 | (assoc-ref %build-inputs | |
118 | "libgcrypt")) | |
119 | ||
120 | ;; Set 'DOT_USER_PROGRAM' to the empty string so | |
121 | ;; we don't keep a reference to Graphviz, whose | |
122 | ;; closure is pretty big (too big for the GuixSD | |
123 | ;; installation image.) | |
4b7917f2 LC |
124 | "ac_cv_path_DOT_USER_PROGRAM=dot" |
125 | ||
126 | ;; To avoid problems with the length of shebangs, | |
127 | ;; choose a fixed-width and short directory name | |
128 | ;; for tests. | |
129 | "ac_cv_guix_test_root=/tmp/guix-tests") | |
994a1494 LC |
130 | #:parallel-tests? #f ;work around <http://bugs.gnu.org/21097> |
131 | ||
132 | #:modules ((guix build gnu-build-system) | |
133 | (guix build utils) | |
c9117162 | 134 | (srfi srfi-26) |
994a1494 LC |
135 | (ice-9 popen) |
136 | (ice-9 rdelim)) | |
137 | ||
138 | #:phases (modify-phases %standard-phases | |
8833a647 | 139 | (add-after 'unpack 'bootstrap |
994a1494 LC |
140 | (lambda _ |
141 | ;; Make sure 'msgmerge' can modify the PO files. | |
142 | (for-each (lambda (po) | |
143 | (chmod po #o666)) | |
144 | (find-files "." "\\.po$")) | |
ab2419e5 | 145 | |
8833a647 LC |
146 | (patch-shebang "build-aux/git-version-gen") |
147 | ||
91c619eb LC |
148 | (call-with-output-file ".tarball-version" |
149 | (lambda (port) | |
150 | (display ,version port))) | |
151 | ||
994a1494 LC |
152 | (zero? (system* "sh" "bootstrap")))) |
153 | (add-before | |
154 | 'configure 'copy-bootstrap-guile | |
155 | (lambda* (#:key system inputs #:allow-other-keys) | |
156 | (define (boot-guile-version arch) | |
157 | (cond ((string=? "armhf" arch) "2.0.11") | |
158 | ((string=? "aarch64" arch) "2.0.14") | |
159 | (else "2.0.9"))) | |
39de700c | 160 | |
994a1494 LC |
161 | (define (copy arch) |
162 | (let ((guile (assoc-ref inputs | |
163 | (string-append "boot-guile/" | |
164 | arch))) | |
165 | (target (string-append "gnu/packages/bootstrap/" | |
166 | arch "-linux/" | |
167 | "/guile-" | |
168 | (boot-guile-version arch) | |
169 | ".tar.xz"))) | |
170 | (mkdir-p (dirname target)) ;XXX: eventually unneeded | |
171 | (copy-file guile target))) | |
bbe8d8f0 | 172 | |
994a1494 LC |
173 | (copy "i686") |
174 | (copy "x86_64") | |
175 | (copy "mips64el") | |
176 | (copy "armhf") | |
177 | (copy "aarch64") | |
178 | #t)) | |
40e89f5b | 179 | (add-after 'unpack 'disable-failing-tests |
994a1494 LC |
180 | ;; XXX FIXME: These tests fail within the build container. |
181 | (lambda _ | |
182 | (substitute* "tests/syscalls.scm" | |
183 | (("^\\(test-(assert|equal) \"(clone|setns|pivot-root)\"" all) | |
184 | (string-append "(test-skip 1)\n" all))) | |
185 | (substitute* "tests/containers.scm" | |
186 | (("^\\(test-(assert|equal)" all) | |
187 | (string-append "(test-skip 1)\n" all))) | |
188 | (when (file-exists? "tests/guix-environment-container.sh") | |
189 | (substitute* "tests/guix-environment-container.sh" | |
190 | (("guix environment --version") | |
191 | "exit 77\n"))) | |
192 | #t)) | |
193 | (add-before 'check 'set-SHELL | |
194 | (lambda _ | |
195 | ;; 'guix environment' tests rely on 'SHELL' having a | |
196 | ;; correct value, so set it. | |
197 | (setenv "SHELL" (which "sh")) | |
198 | #t)) | |
199 | (add-after 'install 'wrap-program | |
200 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
dd1640ee LC |
201 | ;; Make sure the 'guix' command finds GnuTLS, |
202 | ;; Guile-JSON, and Guile-Git automatically. | |
994a1494 LC |
203 | (let* ((out (assoc-ref outputs "out")) |
204 | (guile (assoc-ref inputs "guile")) | |
205 | (json (assoc-ref inputs "guile-json")) | |
9ca8aa38 | 206 | (git (assoc-ref inputs "guile-git")) |
dd1640ee LC |
207 | (bs (assoc-ref inputs |
208 | "guile-bytestructures")) | |
994a1494 LC |
209 | (ssh (assoc-ref inputs "guile-ssh")) |
210 | (gnutls (assoc-ref inputs "gnutls")) | |
dd1640ee | 211 | (deps (list json gnutls git bs ssh)) |
994a1494 LC |
212 | (effective |
213 | (read-line | |
214 | (open-pipe* OPEN_READ | |
215 | (string-append guile "/bin/guile") | |
216 | "-c" "(display (effective-version))"))) | |
c9117162 LC |
217 | (path (string-join |
218 | (map (cut string-append <> | |
219 | "/share/guile/site/" | |
220 | effective) | |
221 | deps) | |
222 | ":")) | |
223 | (gopath (string-join | |
224 | (map (cut string-append <> | |
225 | "/lib/guile/" effective | |
226 | "/site-ccache") | |
227 | deps) | |
228 | ":"))) | |
61cdad35 | 229 | |
994a1494 LC |
230 | (wrap-program (string-append out "/bin/guix") |
231 | `("GUILE_LOAD_PATH" ":" prefix (,path)) | |
c9117162 | 232 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,gopath))) |
61cdad35 | 233 | |
994a1494 LC |
234 | #t)))))) |
235 | (native-inputs `(("pkg-config" ,pkg-config) | |
a7db8540 | 236 | |
994a1494 LC |
237 | ;; XXX: Keep the development inputs here even though |
238 | ;; they're unnecessary, just so that 'guix environment | |
239 | ;; guix' always contains them. | |
240 | ("autoconf" ,(autoconf-wrapper)) | |
241 | ("automake" ,automake) | |
242 | ("gettext" ,gettext-minimal) | |
243 | ("texinfo" ,texinfo) | |
244 | ("graphviz" ,graphviz) | |
245 | ("help2man" ,help2man))) | |
246 | (inputs | |
247 | (let ((boot-guile (lambda (arch hash) | |
248 | (origin | |
249 | (method url-fetch) | |
250 | (uri (boot-guile-uri arch)) | |
251 | (sha256 hash))))) | |
252 | `(("bzip2" ,bzip2) | |
253 | ("gzip" ,gzip) | |
254 | ("zlib" ,zlib) ;for 'guix publish' | |
2d195e67 | 255 | |
994a1494 LC |
256 | ("sqlite" ,sqlite) |
257 | ("libgcrypt" ,libgcrypt) | |
7561881f | 258 | ("guile" ,guile-2.2) |
bbe8d8f0 | 259 | |
994a1494 LC |
260 | ("boot-guile/i686" |
261 | ,(boot-guile "i686" | |
262 | (base32 | |
263 | "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp"))) | |
264 | ("boot-guile/x86_64" | |
265 | ,(boot-guile "x86_64" | |
266 | (base32 | |
267 | "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3"))) | |
268 | ("boot-guile/mips64el" | |
269 | ,(boot-guile "mips64el" | |
270 | (base32 | |
271 | "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr"))) | |
272 | ("boot-guile/armhf" | |
273 | ,(boot-guile "armhf" | |
274 | (base32 | |
275 | "1mi3brl7l58aww34rawhvja84xc7l1b4hmwdmc36fp9q9mfx0lg5"))) | |
276 | ("boot-guile/aarch64" | |
277 | ,(boot-guile "aarch64" | |
278 | (base32 | |
279 | "1giy2aprjmn5fp9c4s9r125fljw4wv6ixy5739i5bffw4jgr0f9r")))))) | |
280 | (propagated-inputs | |
52cabc6f | 281 | `(("gnutls" ,gnutls) |
2252f087 | 282 | ("guile-json" ,guile-json) |
9ca8aa38 LC |
283 | ("guile-ssh" ,guile-ssh) |
284 | ("guile-git" ,guile-git))) | |
f1082ec1 | 285 | |
994a1494 LC |
286 | (home-page "https://www.gnu.org/software/guix/") |
287 | (synopsis "Functional package manager for installed software packages and versions") | |
288 | (description | |
289 | "GNU Guix is a functional package manager for the GNU system, and is | |
c5779c93 | 290 | also a distribution thereof. It includes a virtual machine image. Besides |
79c311b8 | 291 | the usual package management features, it also supports transactional |
c5779c93 LC |
292 | upgrades and roll-backs, per-user profiles, and much more. It is based on |
293 | the Nix package manager.") | |
994a1494 LC |
294 | (license gpl3+) |
295 | (properties '((ftp-server . "alpha.gnu.org")))))) | |
3ad9a0b1 | 296 | |
994a1494 LC |
297 | ;; Alias for backward compatibility. |
298 | (define-public guix-devel guix) | |
fcb0109d | 299 | |
82ce81ba LC |
300 | (define-public guile2.0-guix |
301 | (package | |
302 | (inherit guix) | |
303 | (name "guile2.0-guix") | |
304 | (inputs | |
305 | `(("guile" ,guile-2.0) | |
306 | ,@(alist-delete "guile" (package-inputs guix)))) | |
307 | (propagated-inputs | |
52cabc6f | 308 | `(("gnutls" ,gnutls/guile-2.0) |
82ce81ba | 309 | ("guile-json" ,guile2.0-json) |
9ca8aa38 LC |
310 | ("guile-ssh" ,guile2.0-ssh) |
311 | ("guile-git" ,guile2.0-git))))) | |
82ce81ba | 312 | |
04eb0fab LC |
313 | (define (source-file? file stat) |
314 | "Return true if FILE is likely a source file, false if it is a typical | |
315 | generated file." | |
316 | (define (wrong-extension? file) | |
317 | (or (string-suffix? "~" file) | |
318 | (member (file-extension file) | |
319 | '("o" "a" "lo" "so" "go")))) | |
320 | ||
321 | (match (basename file) | |
322 | ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs") | |
323 | #f) | |
324 | ((? wrong-extension?) | |
325 | #f) | |
326 | (_ | |
327 | #t))) | |
328 | ||
04eb0fab | 329 | (define-public current-guix |
a9d5e4be CB |
330 | (let* ((repository-root (canonicalize-path |
331 | (string-append (current-source-directory) | |
332 | "/../.."))) | |
333 | (select? (delay (or (git-predicate repository-root) | |
334 | source-file?)))) | |
04eb0fab LC |
335 | (lambda () |
336 | "Return a package representing Guix built from the current source tree. | |
337 | This works by adding the current source tree to the store (after filtering it | |
338 | out) and returning a package that uses that as its 'source'." | |
339 | (package | |
340 | (inherit guix) | |
341 | (version (string-append (package-version guix) "+")) | |
a9d5e4be | 342 | (source (local-file repository-root "guix-current" |
04eb0fab LC |
343 | #:recursive? #t |
344 | #:select? (force select?))))))) | |
345 | ||
346 | \f | |
347 | ;;; | |
348 | ;;; Other tools. | |
349 | ;;; | |
350 | ||
fcb0109d LC |
351 | (define-public nix |
352 | (package | |
353 | (name "nix") | |
a041d56e | 354 | (version "1.11.9") |
fcb0109d LC |
355 | (source (origin |
356 | (method url-fetch) | |
357 | (uri (string-append "http://nixos.org/releases/nix/nix-" | |
358 | version "/nix-" version ".tar.xz")) | |
359 | (sha256 | |
360 | (base32 | |
a041d56e | 361 | "1qg7qrfr60dysmyfg3ijgani71l23p1kqadhjs8kz11pgwkkx50f")))) |
fcb0109d LC |
362 | (build-system gnu-build-system) |
363 | ;; XXX: Should we pass '--with-store-dir=/gnu/store'? But then we'd also | |
364 | ;; need '--localstatedir=/var'. But then! The thing would use /var/nix | |
365 | ;; instead of /var/guix. So in the end, we do nothing special. | |
9083788a SB |
366 | (arguments |
367 | '(#:configure-flags | |
368 | ;; Set the prefixes of Perl libraries to avoid propagation. | |
369 | (let ((perl-libdir (lambda (p) | |
370 | (string-append | |
371 | (assoc-ref %build-inputs p) | |
372 | "/lib/perl5/site_perl")))) | |
373 | (list (string-append "--with-dbi=" | |
374 | (perl-libdir "perl-dbi")) | |
375 | (string-append "--with-dbd-sqlite=" | |
376 | (perl-libdir "perl-dbd-sqlite")) | |
377 | (string-append "--with-www-curl=" | |
378 | (perl-libdir "perl-www-curl")))))) | |
fcb0109d LC |
379 | (native-inputs `(("perl" ,perl) |
380 | ("pkg-config" ,pkg-config))) | |
381 | (inputs `(("curl" ,curl) | |
382 | ("openssl" ,openssl) | |
383 | ("libgc" ,libgc) | |
384 | ("sqlite" ,sqlite) | |
9083788a SB |
385 | ("bzip2" ,bzip2) |
386 | ("perl-www-curl" ,perl-www-curl) | |
387 | ("perl-dbi" ,perl-dbi) | |
388 | ("perl-dbd-sqlite" ,perl-dbd-sqlite))) | |
fcb0109d LC |
389 | (home-page "http://nixos.org/nix/") |
390 | (synopsis "The Nix package manager") | |
391 | (description | |
392 | "Nix is a purely functional package manager. This means that it treats | |
393 | packages like values in purely functional programming languages such as | |
394 | Haskell—they are built by functions that don't have side-effects, and they | |
395 | never change after they have been built. Nix stores packages in the Nix | |
396 | store, usually the directory /nix/store, where each package has its own unique | |
397 | sub-directory.") | |
398 | (license lgpl2.1+))) | |
8d422e25 | 399 | |
a881a40c LC |
400 | (define-public emacs-nix-mode |
401 | (package | |
402 | (inherit nix) | |
403 | (name "emacs-nix-mode") | |
404 | (build-system emacs-build-system) | |
405 | (arguments | |
406 | `(#:phases | |
407 | (modify-phases %standard-phases | |
408 | (add-after 'unpack 'chdir-elisp | |
409 | ;; Elisp directory is not in root of the source. | |
410 | (lambda _ | |
411 | (chdir "misc/emacs")))))) | |
412 | (synopsis "Emacs major mode for editing Nix expressions") | |
413 | (description "@code{nixos-mode} provides an Emacs major mode for editing | |
414 | Nix expressions. It supports syntax highlighting, indenting and refilling of | |
415 | comments."))) | |
416 | ||
8d422e25 RW |
417 | (define-public stow |
418 | (package | |
419 | (name "stow") | |
ddfd70da | 420 | (version "2.2.2") |
8d422e25 RW |
421 | (source (origin |
422 | (method url-fetch) | |
423 | (uri (string-append "mirror://gnu/stow/stow-" | |
424 | version ".tar.gz")) | |
425 | (sha256 | |
426 | (base32 | |
ddfd70da | 427 | "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2")))) |
8d422e25 RW |
428 | (build-system gnu-build-system) |
429 | (inputs | |
430 | `(("perl" ,perl))) | |
431 | (native-inputs | |
432 | `(("perl-test-simple" ,perl-test-simple) | |
433 | ("perl-test-output" ,perl-test-output) | |
ddfd70da LC |
434 | ("perl-capture-tiny" ,perl-capture-tiny) |
435 | ("perl-io-stringy" ,perl-io-stringy))) | |
8d422e25 RW |
436 | (home-page "https://www.gnu.org/software/stow/") |
437 | (synopsis "Managing installed software packages") | |
438 | (description | |
439 | "GNU Stow is a symlink manager. It generates symlinks to directories | |
440 | of data and makes them appear to be merged into the same directory. It is | |
441 | typically used for managing software packages installed from source, by | |
442 | letting you install them apart in distinct directories and then create | |
443 | symlinks to the files in a common directory such as /usr/local.") | |
444 | (license gpl2+))) | |
e3e1ecf6 LC |
445 | |
446 | (define-public rpm | |
447 | (package | |
448 | (name "rpm") | |
a3dd13ae | 449 | (version "4.13.0.2") |
e3e1ecf6 LC |
450 | (source (origin |
451 | (method url-fetch) | |
623cc34c EB |
452 | (uri (string-append "http://ftp.rpm.org/releases/rpm-" |
453 | (version-major+minor version) ".x/rpm-" | |
e3e1ecf6 LC |
454 | version ".tar.bz2")) |
455 | (sha256 | |
456 | (base32 | |
a3dd13ae | 457 | "1521y4ghjns449kzpwkjn9cksh686383xnfx0linzlalqc3jqgig")))) |
e3e1ecf6 LC |
458 | (build-system gnu-build-system) |
459 | (arguments | |
460 | '(#:configure-flags '("--with-external-db" ;use the system's bdb | |
461 | "--enable-python" | |
462 | "--without-lua") | |
463 | #:phases (modify-phases %standard-phases | |
464 | (add-before 'configure 'set-nspr-search-path | |
465 | (lambda* (#:key inputs #:allow-other-keys) | |
466 | ;; nspr.pc contains the right -I flag pointing to | |
467 | ;; 'include/nspr', but unfortunately 'configure' doesn't | |
468 | ;; use 'pkg-config'. Thus, augment CPATH. | |
469 | ;; Likewise for NSS. | |
470 | (let ((nspr (assoc-ref inputs "nspr")) | |
471 | (nss (assoc-ref inputs "nss"))) | |
472 | (setenv "CPATH" | |
e8e2e18b | 473 | (string-append (getenv "C_INCLUDE_PATH") ":" |
e3e1ecf6 LC |
474 | nspr "/include/nspr:" |
475 | nss "/include/nss")) | |
476 | (setenv "LIBRARY_PATH" | |
477 | (string-append (getenv "LIBRARY_PATH") ":" | |
478 | nss "/lib/nss")) | |
479 | #t))) | |
480 | (add-after 'install 'fix-rpm-symlinks | |
481 | (lambda* (#:key outputs #:allow-other-keys) | |
482 | ;; 'make install' gets these symlinks wrong. Fix them. | |
483 | (let* ((out (assoc-ref outputs "out")) | |
484 | (bin (string-append out "/bin"))) | |
485 | (with-directory-excursion bin | |
486 | (for-each (lambda (file) | |
487 | (delete-file file) | |
488 | (symlink "rpm" file)) | |
489 | '("rpmquery" "rpmverify")) | |
490 | #t))))))) | |
491 | (native-inputs | |
492 | `(("pkg-config" ,pkg-config))) | |
493 | (inputs | |
494 | `(("python" ,python-2) | |
495 | ("xz" ,xz) | |
496 | ("bdb" ,bdb) | |
497 | ("popt" ,popt) | |
498 | ("nss" ,nss) | |
499 | ("nspr" ,nspr) | |
500 | ("libarchive" ,libarchive) | |
501 | ("nettle" ,nettle) ;XXX: actually a dependency of libarchive | |
502 | ("file" ,file) | |
503 | ("bzip2" ,bzip2) | |
504 | ("zlib" ,zlib) | |
505 | ("cpio" ,cpio))) | |
506 | (home-page "http://www.rpm.org/") | |
507 | (synopsis "The RPM Package Manager") | |
508 | (description | |
509 | "The RPM Package Manager (RPM) is a command-line driven package | |
510 | management system capable of installing, uninstalling, verifying, querying, | |
511 | and updating computer software packages. Each software package consists of an | |
512 | archive of files along with information about the package like its version, a | |
513 | description. There is also a library permitting developers to manage such | |
514 | transactions from C or Python.") | |
515 | ||
516 | ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+. | |
517 | (license gpl2+))) | |
518 | ||
08dcff47 LC |
519 | (define-public diffoscope |
520 | (package | |
521 | (name "diffoscope") | |
63b7fbe1 | 522 | (version "88") |
08dcff47 | 523 | (source (origin |
7dd21101 LF |
524 | (method url-fetch) |
525 | (uri (pypi-uri name version)) | |
08dcff47 LC |
526 | (sha256 |
527 | (base32 | |
63b7fbe1 | 528 | "1zp6nb37igssxg4bqsi3cw5klx4prhcx50mzg4463l50mssn8mp2")))) |
08dcff47 LC |
529 | (build-system python-build-system) |
530 | (arguments | |
7dd21101 LF |
531 | `(#:phases (modify-phases %standard-phases |
532 | ;; setup.py mistakenly requires python-magic from PyPi, even | |
533 | ;; though the Python bindings of `file` are sufficient. | |
534 | ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844 | |
535 | (add-after 'unpack 'dependency-on-python-magic | |
536 | (lambda _ | |
537 | (substitute* "setup.py" | |
5dbeccf5 RW |
538 | (("'python-magic',") "")))) |
539 | (add-after 'unpack 'embed-tool-references | |
540 | (lambda* (#:key inputs #:allow-other-keys) | |
025519fa | 541 | (substitute* "diffoscope/comparators/utils/compare.py" |
5dbeccf5 RW |
542 | (("\\['xxd',") |
543 | (string-append "['" (which "xxd") "',"))) | |
544 | (substitute* "diffoscope/comparators/elf.py" | |
545 | (("@tool_required\\('readelf'\\)") "") | |
2af6be91 KK |
546 | (("get_tool_name\\('readelf'\\)") |
547 | (string-append "'" (which "readelf") "'"))) | |
548 | (substitute* "diffoscope/comparators/directory.py" | |
549 | (("@tool_required\\('stat'\\)") "") | |
550 | (("@tool_required\\('getfacl'\\)") "") | |
551 | (("\\['stat',") | |
552 | (string-append "['" (which "stat") "',")) | |
553 | (("\\['getfacl',") | |
554 | (string-append "['" (which "getfacl") "',"))) | |
63b7fbe1 GB |
555 | #t)) |
556 | (add-before 'check 'delete-failing-test | |
557 | (lambda _ | |
558 | (delete-file "tests/test_tools.py") ;this requires /sbin to be on the path | |
5dbeccf5 | 559 | #t))))) |
08dcff47 | 560 | (inputs `(("rpm" ,rpm) ;for rpm-python |
7dd21101 LF |
561 | ("python-file" ,python-file) |
562 | ("python-debian" ,python-debian) | |
563 | ("python-libarchive-c" ,python-libarchive-c) | |
564 | ("python-tlsh" ,python-tlsh) | |
2af6be91 | 565 | ("acl" ,acl) ;for getfacl |
5dbeccf5 | 566 | ("colordiff" ,colordiff) |
9fc513ad | 567 | ("xxd" ,xxd) |
08dcff47 LC |
568 | |
569 | ;; Below are modules used for tests. | |
7dd21101 LF |
570 | ("python-pytest" ,python-pytest) |
571 | ("python-chardet" ,python-chardet))) | |
54360c91 | 572 | (home-page "https://diffoscope.org/") |
08dcff47 LC |
573 | (synopsis "Compare files, archives, and directories in depth") |
574 | (description | |
575 | "Diffoscope tries to get to the bottom of what makes files or directories | |
576 | different. It recursively unpacks archives of many kinds and transforms | |
577 | various binary formats into more human readable forms to compare them. It can | |
578 | compare two tarballs, ISO images, or PDFs just as easily.") | |
579 | (license gpl3+))) | |
513d35f1 MFM |
580 | |
581 | (define-public python-anaconda-client | |
582 | (package | |
583 | (name "python-anaconda-client") | |
584 | (version "1.6.3") | |
585 | (source | |
586 | (origin | |
587 | (method url-fetch) | |
588 | (uri (string-append "https://github.com/Anaconda-Platform/" | |
589 | "anaconda-client/archive/" version ".tar.gz")) | |
590 | (file-name (string-append name "-" version ".tar.gz")) | |
591 | (sha256 | |
592 | (base32 | |
593 | "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2")))) | |
594 | (build-system python-build-system) | |
595 | (propagated-inputs | |
596 | `(("python-pyyaml" ,python-pyyaml) | |
597 | ("python-requests" ,python-requests) | |
598 | ("python-clyent" ,python-clyent))) | |
599 | (native-inputs | |
600 | `(("python-pytz" ,python-pytz) | |
601 | ("python-dateutil" ,python-dateutil) | |
602 | ("python-mock" ,python-mock) | |
603 | ("python-coverage" ,python-coverage) | |
604 | ("python-pillow" ,python-pillow))) | |
605 | (arguments | |
606 | `(#:phases | |
607 | (modify-phases %standard-phases | |
608 | ;; This is needed for some tests. | |
609 | (add-before 'check 'set-up-home | |
610 | (lambda* _ (setenv "HOME" "/tmp") #t)) | |
611 | (add-before 'check 'remove-network-tests | |
612 | (lambda* _ | |
613 | ;; Remove tests requiring a network connection | |
614 | (let ((network-tests '("tests/test_upload.py" | |
615 | "tests/test_authorizations.py" | |
616 | "tests/test_login.py" | |
617 | "tests/test_whoami.py" | |
618 | "utils/notebook/tests/test_data_uri.py" | |
619 | "utils/notebook/tests/test_base.py" | |
620 | "utils/notebook/tests/test_downloader.py" | |
621 | "inspect_package/tests/test_conda.py"))) | |
622 | (with-directory-excursion "binstar_client" | |
623 | (for-each delete-file network-tests))) | |
624 | #t))))) | |
625 | (home-page "https://github.com/Anaconda-Platform/anaconda-client") | |
626 | (synopsis "Anaconda Cloud command line client library") | |
627 | (description | |
628 | "Anaconda Cloud command line client library provides an interface to | |
629 | Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and | |
630 | environments.") | |
631 | (license bsd-3))) | |
632 | ||
633 | (define-public python2-anaconda-client | |
634 | (package-with-python2 python-anaconda-client)) | |
4bc08b6e MFM |
635 | |
636 | (define-public python-conda | |
637 | (package | |
638 | (name "python-conda") | |
639 | (version "4.3.16") | |
640 | (source | |
641 | (origin | |
642 | (method url-fetch) | |
643 | (uri (string-append "https://github.com/conda/conda/archive/" | |
644 | version ".tar.gz")) | |
645 | (file-name (string-append name "-" version ".tar.gz")) | |
646 | (sha256 | |
647 | (base32 | |
648 | "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv")))) | |
649 | (build-system python-build-system) | |
650 | (arguments | |
651 | `(#:phases | |
652 | (modify-phases %standard-phases | |
653 | (add-before 'build 'create-version-file | |
654 | (lambda _ | |
655 | (with-output-to-file "conda/.version" | |
656 | (lambda () (display ,version))) | |
657 | #t)) | |
658 | (add-before 'check 'remove-failing-tests | |
659 | (lambda _ | |
660 | ;; These tests require internet/network access | |
661 | (let ((network-tests '("test_cli.py" | |
662 | "test_create.py" | |
663 | "test_export.py" | |
664 | "test_fetch.py" | |
665 | "test_history.py" | |
666 | "test_info.py" | |
667 | "test_install.py" | |
668 | "test_priority.py" | |
669 | "conda_env/test_cli.py" | |
670 | "conda_env/test_create.py" | |
671 | "conda_env/specs/test_notebook.py" | |
672 | "conda_env/utils/test_notebooks.py" | |
673 | "core/test_index.py" | |
674 | "core/test_repodata.py"))) | |
675 | (with-directory-excursion "tests" | |
676 | (for-each delete-file network-tests) | |
677 | ||
678 | ;; FIXME: This test creates a file, then deletes it and tests | |
679 | ;; that the file was deleted. For some reason it fails when | |
680 | ;; building with guix, but does not when you run it in the | |
681 | ;; directory left when you build with the --keep-failed | |
682 | ;; option | |
683 | (delete-file "gateways/disk/test_delete.py") | |
684 | #t)))) | |
685 | (replace 'check | |
686 | (lambda _ | |
687 | (setenv "HOME" "/tmp") | |
688 | (zero? (system* "py.test"))))))) | |
689 | (native-inputs | |
690 | `(("python-ruamel.yaml" ,python-ruamel.yaml) | |
691 | ("python-requests" ,python-requests) | |
692 | ("python-pycosat" ,python-pycosat) | |
693 | ("python-pytest" ,python-pytest) | |
694 | ("python-responses" ,python-responses) | |
695 | ("python-pyyaml" ,python-pyyaml) | |
696 | ("python-anaconda-client" ,python-anaconda-client))) | |
697 | (home-page "https://github.com/conda/conda") | |
698 | (synopsis "Cross-platform, OS-agnostic, system-level binary package manager") | |
699 | (description | |
700 | "Conda is a cross-platform, Python-agnostic binary package manager. It | |
701 | is the package manager used by Anaconda installations, but it may be used for | |
702 | other systems as well. Conda makes environments first-class citizens, making | |
703 | it easy to create independent environments even for C libraries. Conda is | |
704 | written entirely in Python. | |
705 | ||
706 | This package provides Conda as a library.") | |
707 | (license bsd-3))) | |
708 | ||
709 | (define-public python2-conda | |
2c5cf844 LF |
710 | (let ((base (package-with-python2 |
711 | (strip-python2-variant python-conda)))) | |
712 | (package (inherit base) | |
713 | (native-inputs | |
714 | `(("python2-enum34" ,python2-enum34) | |
715 | ,@(package-native-inputs base)))))) | |
84fcb580 MFM |
716 | |
717 | (define-public conda | |
718 | (package (inherit python-conda) | |
719 | (name "conda") | |
720 | (arguments | |
721 | (substitute-keyword-arguments (package-arguments python-conda) | |
722 | ((#:phases phases) | |
723 | `(modify-phases ,phases | |
724 | (replace 'build | |
725 | (lambda* (#:key outputs #:allow-other-keys) | |
726 | ;; This test fails when run before installation. | |
727 | (delete-file "tests/test_activate.py") | |
728 | ||
729 | ;; Fix broken defaults | |
730 | (substitute* "conda/base/context.py" | |
731 | (("return sys.prefix") | |
732 | (string-append "return \"" (assoc-ref outputs "out") "\"")) | |
733 | (("return (prefix_is_writable\\(self.root_prefix\\))" _ match) | |
734 | (string-append "return False if self.root_prefix == self.conda_prefix else " | |
735 | match))) | |
736 | ||
737 | ;; The util/setup-testing.py is used to build conda in | |
738 | ;; application form, rather than the default, library form. | |
739 | ;; With this, we are able to run commands like `conda --help` | |
740 | ;; directly on the command line | |
741 | (zero? (system* "python" "utils/setup-testing.py" "build_py")))) | |
742 | (replace 'install | |
743 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
744 | (let* ((out (assoc-ref outputs "out")) | |
745 | (target (string-append out "/lib/python" | |
746 | ((@@ (guix build python-build-system) | |
747 | get-python-version) | |
748 | (assoc-ref inputs "python")) | |
749 | "/site-packages/"))) | |
750 | ;; The installer aborts if the target directory is not on | |
751 | ;; PYTHONPATH. | |
752 | (setenv "PYTHONPATH" | |
753 | (string-append target ":" (getenv "PYTHONPATH"))) | |
754 | ||
755 | ;; And it aborts if the directory doesn't exist. | |
756 | (mkdir-p target) | |
757 | (zero? (system* "python" "utils/setup-testing.py" "install" | |
1d84500a RW |
758 | (string-append "--prefix=" out)))))) |
759 | ;; The "activate" and "deactivate" scripts don't need wrapping. | |
760 | ;; They also break when they are renamed. | |
761 | (add-after 'wrap 'undo-wrap | |
762 | (lambda* (#:key outputs #:allow-other-keys) | |
763 | (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/") | |
764 | (delete-file "deactivate") | |
765 | (rename-file ".deactivate-real" "deactivate") | |
766 | (delete-file "activate") | |
767 | (rename-file ".activate-real" "activate") | |
768 | #t))))))) | |
84fcb580 MFM |
769 | (description |
770 | "Conda is a cross-platform, Python-agnostic binary package manager. It | |
771 | is the package manager used by Anaconda installations, but it may be used for | |
772 | other systems as well. Conda makes environments first-class citizens, making | |
773 | it easy to create independent environments even for C libraries. Conda is | |
774 | written entirely in Python."))) | |
58a308e0 RJ |
775 | |
776 | (define-public gwl | |
777 | (package | |
778 | (name "gwl") | |
779 | (version "0.1.0") | |
780 | (source (origin | |
781 | (method url-fetch) | |
782 | (uri (string-append "https://www.guixwl.org/releases/gwl-" | |
783 | version ".tar.gz")) | |
784 | (sha256 | |
785 | (base32 | |
786 | "1x4swwp7kmhd57j3scii5c4h8swkcvab2r6mz7wxwwbx300wcqpy")))) | |
787 | (build-system gnu-build-system) | |
788 | (native-inputs | |
789 | `(("autoconf" ,autoconf) | |
790 | ("automake" ,automake) | |
791 | ("pkg-config" ,pkg-config))) | |
792 | (inputs | |
793 | `(("guile" ,guile-2.2))) | |
794 | (propagated-inputs | |
795 | `(("guix" ,guix) | |
796 | ("guile-commonmark" ,guile-commonmark))) | |
797 | (home-page "https://www.guixwl.org") | |
798 | (synopsis "Workflow management extension for GNU Guix") | |
799 | (description "This project provides two subcommands to GNU Guix and | |
800 | introduces two record types that provide a workflow management extension built | |
801 | on top of GNU Guix.") | |
802 | ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+, | |
803 | ;; the web interface modules in gwl/ are licensed AGPL3+, | |
804 | ;; and the fonts included in this package are licensed OFL1.1. | |
805 | (license (list gpl3+ agpl3+ silofl1.1)))) |