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