You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

947 lines
40 KiB

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