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