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.
 
 
 
 
 
 

911 lines
39 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 guile2.0-guix
  276. (package
  277. (inherit guix)
  278. (name "guile2.0-guix")
  279. (inputs
  280. `(("guile" ,guile-2.0)
  281. ,@(alist-delete "guile" (package-inputs guix))))
  282. (propagated-inputs
  283. `(("gnutls" ,gnutls/guile-2.0)
  284. ("guile-json" ,guile2.0-json)
  285. ("guile-ssh" ,guile2.0-ssh)
  286. ("guile-git" ,guile2.0-git)))))
  287. (define (source-file? file stat)
  288. "Return true if FILE is likely a source file, false if it is a typical
  289. generated file."
  290. (define (wrong-extension? file)
  291. (or (string-suffix? "~" file)
  292. (member (file-extension file)
  293. '("o" "a" "lo" "so" "go"))))
  294. (match (basename file)
  295. ((or ".git" "autom4te.cache" "configure" "Makefile" "Makefile.in" ".libs")
  296. #f)
  297. ((? wrong-extension?)
  298. #f)
  299. (_
  300. #t)))
  301. (define-public current-guix
  302. (let* ((repository-root (canonicalize-path
  303. (string-append (current-source-directory)
  304. "/../..")))
  305. (select? (delay (or (git-predicate repository-root)
  306. source-file?))))
  307. (lambda ()
  308. "Return a package representing Guix built from the current source tree.
  309. This works by adding the current source tree to the store (after filtering it
  310. out) and returning a package that uses that as its 'source'."
  311. (package
  312. (inherit guix)
  313. (version (string-append (package-version guix) "+"))
  314. (source (local-file repository-root "guix-current"
  315. #:recursive? #t
  316. #:select? (force select?)))))))
  317. ;;;
  318. ;;; Other tools.
  319. ;;;
  320. (define-public nix
  321. (package
  322. (name "nix")
  323. (version "2.0.4")
  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
  330. "0ss9svxlh1pvrdmnqjvjyqjmbqmrdbyfarvbb14i9d4bggzl0r8n"))))
  331. (build-system gnu-build-system)
  332. (native-inputs `(("pkg-config" ,pkg-config)))
  333. (inputs `(("curl" ,curl)
  334. ("bzip2" ,bzip2)
  335. ("libgc" ,libgc)
  336. ("libseccomp" ,libseccomp)
  337. ("libsodium" ,libsodium)
  338. ("openssl" ,openssl)
  339. ("sqlite" ,sqlite)
  340. ("xz" ,xz)))
  341. (home-page "https://nixos.org/nix/")
  342. (synopsis "The Nix package manager")
  343. (description
  344. "Nix is a purely functional package manager. This means that it treats
  345. packages like values in purely functional programming languages such as
  346. Haskell—they are built by functions that don't have side-effects, and they
  347. never change after they have been built. Nix stores packages in the Nix
  348. store, usually the directory /nix/store, where each package has its own unique
  349. sub-directory.")
  350. (license license:lgpl2.1+)))
  351. (define-public emacs-nix-mode
  352. (package
  353. (inherit nix)
  354. (name "emacs-nix-mode")
  355. (build-system emacs-build-system)
  356. (arguments
  357. `(#:phases
  358. (modify-phases %standard-phases
  359. (add-after 'unpack 'chdir-elisp
  360. ;; Elisp directory is not in root of the source.
  361. (lambda _
  362. (chdir "misc/emacs"))))))
  363. (synopsis "Emacs major mode for editing Nix expressions")
  364. (description "@code{nixos-mode} provides an Emacs major mode for editing
  365. Nix expressions. It supports syntax highlighting, indenting and refilling of
  366. comments.")))
  367. (define-public stow
  368. (package
  369. (name "stow")
  370. (version "2.2.2")
  371. (source (origin
  372. (method url-fetch)
  373. (uri (string-append "mirror://gnu/stow/stow-"
  374. version ".tar.gz"))
  375. (sha256
  376. (base32
  377. "1pvky9fayms4r6fhns8jd0vavszd7d979w62vfd5n88v614pdxz2"))))
  378. (build-system gnu-build-system)
  379. (inputs
  380. `(("perl" ,perl)))
  381. (native-inputs
  382. `(("perl-test-simple" ,perl-test-simple)
  383. ("perl-test-output" ,perl-test-output)
  384. ("perl-capture-tiny" ,perl-capture-tiny)
  385. ("perl-io-stringy" ,perl-io-stringy)))
  386. (home-page "https://www.gnu.org/software/stow/")
  387. (synopsis "Managing installed software packages")
  388. (description
  389. "GNU Stow is a symlink manager. It generates symlinks to directories
  390. of data and makes them appear to be merged into the same directory. It is
  391. typically used for managing software packages installed from source, by
  392. letting you install them apart in distinct directories and then create
  393. symlinks to the files in a common directory such as /usr/local.")
  394. (license license:gpl2+)))
  395. (define-public rpm
  396. (package
  397. (name "rpm")
  398. (version "4.13.0.2")
  399. (source (origin
  400. (method url-fetch)
  401. (uri (string-append "http://ftp.rpm.org/releases/rpm-"
  402. (version-major+minor version) ".x/rpm-"
  403. version ".tar.bz2"))
  404. (sha256
  405. (base32
  406. "1521y4ghjns449kzpwkjn9cksh686383xnfx0linzlalqc3jqgig"))))
  407. (build-system gnu-build-system)
  408. (arguments
  409. '(#:configure-flags '("--with-external-db" ;use the system's bdb
  410. "--enable-python"
  411. "--without-lua")
  412. #:phases (modify-phases %standard-phases
  413. (add-before 'configure 'set-nspr-search-path
  414. (lambda* (#:key inputs #:allow-other-keys)
  415. ;; nspr.pc contains the right -I flag pointing to
  416. ;; 'include/nspr', but unfortunately 'configure' doesn't
  417. ;; use 'pkg-config'. Thus, augment CPATH.
  418. ;; Likewise for NSS.
  419. (let ((nspr (assoc-ref inputs "nspr"))
  420. (nss (assoc-ref inputs "nss")))
  421. (setenv "CPATH"
  422. (string-append (getenv "C_INCLUDE_PATH") ":"
  423. nspr "/include/nspr:"
  424. nss "/include/nss"))
  425. (setenv "LIBRARY_PATH"
  426. (string-append (getenv "LIBRARY_PATH") ":"
  427. nss "/lib/nss"))
  428. #t)))
  429. (add-after 'install 'fix-rpm-symlinks
  430. (lambda* (#:key outputs #:allow-other-keys)
  431. ;; 'make install' gets these symlinks wrong. Fix them.
  432. (let* ((out (assoc-ref outputs "out"))
  433. (bin (string-append out "/bin")))
  434. (with-directory-excursion bin
  435. (for-each (lambda (file)
  436. (delete-file file)
  437. (symlink "rpm" file))
  438. '("rpmquery" "rpmverify"))
  439. #t)))))))
  440. (native-inputs
  441. `(("pkg-config" ,pkg-config)))
  442. (inputs
  443. `(("python" ,python-2)
  444. ("xz" ,xz)
  445. ("bdb" ,bdb)
  446. ("popt" ,popt)
  447. ("nss" ,nss)
  448. ("nspr" ,nspr)
  449. ("libarchive" ,libarchive)
  450. ("nettle" ,nettle) ;XXX: actually a dependency of libarchive
  451. ("file" ,file)
  452. ("bzip2" ,bzip2)
  453. ("zlib" ,zlib)
  454. ("cpio" ,cpio)))
  455. (home-page "http://www.rpm.org/")
  456. (synopsis "The RPM Package Manager")
  457. (description
  458. "The RPM Package Manager (RPM) is a command-line driven package
  459. management system capable of installing, uninstalling, verifying, querying,
  460. and updating computer software packages. Each software package consists of an
  461. archive of files along with information about the package like its version, a
  462. description. There is also a library permitting developers to manage such
  463. transactions from C or Python.")
  464. ;; The whole is GPLv2+; librpm itself is dual-licensed LGPLv2+ | GPLv2+.
  465. (license license:gpl2+)))
  466. (define-public diffoscope
  467. (package
  468. (name "diffoscope")
  469. (version "95")
  470. (source (origin
  471. (method url-fetch)
  472. (uri (pypi-uri name version))
  473. (sha256
  474. (base32
  475. "0aksxxivxli6l3fylxgl771hw0h7l8x35l76cmj0d12zgx54w0a1"))))
  476. (build-system python-build-system)
  477. (arguments
  478. `(#:phases (modify-phases %standard-phases
  479. ;; setup.py mistakenly requires python-magic from PyPi, even
  480. ;; though the Python bindings of `file` are sufficient.
  481. ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
  482. (add-after 'unpack 'dependency-on-python-magic
  483. (lambda _
  484. (substitute* "setup.py"
  485. (("'python-magic',") ""))))
  486. (add-after 'unpack 'embed-tool-references
  487. (lambda* (#:key inputs #:allow-other-keys)
  488. (substitute* "diffoscope/comparators/utils/compare.py"
  489. (("\\['xxd',")
  490. (string-append "['" (which "xxd") "',")))
  491. (substitute* "diffoscope/comparators/elf.py"
  492. (("@tool_required\\('readelf'\\)") "")
  493. (("get_tool_name\\('readelf'\\)")
  494. (string-append "'" (which "readelf") "'")))
  495. (substitute* "diffoscope/comparators/directory.py"
  496. (("@tool_required\\('stat'\\)") "")
  497. (("@tool_required\\('getfacl'\\)") "")
  498. (("\\['stat',")
  499. (string-append "['" (which "stat") "',"))
  500. (("\\['getfacl',")
  501. (string-append "['" (which "getfacl") "',")))
  502. #t))
  503. (add-before 'check 'delete-failing-test
  504. (lambda _
  505. (delete-file "tests/test_tools.py") ;this requires /sbin to be on the path
  506. #t)))))
  507. (inputs `(("rpm" ,rpm) ;for rpm-python
  508. ("python-file" ,python-file)
  509. ("python-debian" ,python-debian)
  510. ("python-libarchive-c" ,python-libarchive-c)
  511. ("python-tlsh" ,python-tlsh)
  512. ("acl" ,acl) ;for getfacl
  513. ("colordiff" ,colordiff)
  514. ("xxd" ,xxd)
  515. ;; Below are modules used for tests.
  516. ("python-pytest" ,python-pytest)
  517. ("python-chardet" ,python-chardet)))
  518. (home-page "https://diffoscope.org/")
  519. (synopsis "Compare files, archives, and directories in depth")
  520. (description
  521. "Diffoscope tries to get to the bottom of what makes files or directories
  522. different. It recursively unpacks archives of many kinds and transforms
  523. various binary formats into more human readable forms to compare them. It can
  524. compare two tarballs, ISO images, or PDFs just as easily.")
  525. (license license:gpl3+)))
  526. (define-public python-anaconda-client
  527. (package
  528. (name "python-anaconda-client")
  529. (version "1.6.3")
  530. (source
  531. (origin
  532. (method url-fetch)
  533. (uri (string-append "https://github.com/Anaconda-Platform/"
  534. "anaconda-client/archive/" version ".tar.gz"))
  535. (file-name (string-append name "-" version ".tar.gz"))
  536. (sha256
  537. (base32
  538. "1wv4wi6k5jz7rlwfgvgfdizv77x3cr1wa2aj0k1595g7fbhkjhz2"))))
  539. (build-system python-build-system)
  540. (propagated-inputs
  541. `(("python-pyyaml" ,python-pyyaml)
  542. ("python-requests" ,python-requests)
  543. ("python-clyent" ,python-clyent)))
  544. (native-inputs
  545. `(("python-pytz" ,python-pytz)
  546. ("python-dateutil" ,python-dateutil)
  547. ("python-mock" ,python-mock)
  548. ("python-coverage" ,python-coverage)
  549. ("python-pillow" ,python-pillow)))
  550. (arguments
  551. `(#:phases
  552. (modify-phases %standard-phases
  553. ;; This is needed for some tests.
  554. (add-before 'check 'set-up-home
  555. (lambda* _ (setenv "HOME" "/tmp") #t))
  556. (add-before 'check 'remove-network-tests
  557. (lambda* _
  558. ;; Remove tests requiring a network connection
  559. (let ((network-tests '("tests/test_upload.py"
  560. "tests/test_authorizations.py"
  561. "tests/test_login.py"
  562. "tests/test_whoami.py"
  563. "utils/notebook/tests/test_data_uri.py"
  564. "utils/notebook/tests/test_base.py"
  565. "utils/notebook/tests/test_downloader.py"
  566. "inspect_package/tests/test_conda.py")))
  567. (with-directory-excursion "binstar_client"
  568. (for-each delete-file network-tests)))
  569. #t)))))
  570. (home-page "https://github.com/Anaconda-Platform/anaconda-client")
  571. (synopsis "Anaconda Cloud command line client library")
  572. (description
  573. "Anaconda Cloud command line client library provides an interface to
  574. Anaconda Cloud. Anaconda Cloud is useful for sharing packages, notebooks and
  575. environments.")
  576. (license license:bsd-3)))
  577. (define-public python2-anaconda-client
  578. (package-with-python2 python-anaconda-client))
  579. (define-public python-conda
  580. (package
  581. (name "python-conda")
  582. (version "4.3.16")
  583. (source
  584. (origin
  585. (method url-fetch)
  586. (uri (string-append "https://github.com/conda/conda/archive/"
  587. version ".tar.gz"))
  588. (file-name (string-append name "-" version ".tar.gz"))
  589. (sha256
  590. (base32
  591. "1jq8hyrc5npb5sf4vw6s6by4602yj8f79vzpbwdfgpkn02nfk1dv"))))
  592. (build-system python-build-system)
  593. (arguments
  594. `(#:phases
  595. (modify-phases %standard-phases
  596. (add-before 'build 'create-version-file
  597. (lambda _
  598. (with-output-to-file "conda/.version"
  599. (lambda () (display ,version)))
  600. #t))
  601. (add-before 'check 'remove-failing-tests
  602. (lambda _
  603. ;; These tests require internet/network access
  604. (let ((network-tests '("test_cli.py"
  605. "test_create.py"
  606. "test_export.py"
  607. "test_fetch.py"
  608. "test_history.py"
  609. "test_info.py"
  610. "test_install.py"
  611. "test_priority.py"
  612. "conda_env/test_cli.py"
  613. "conda_env/test_create.py"
  614. "conda_env/specs/test_notebook.py"
  615. "conda_env/utils/test_notebooks.py"
  616. "core/test_index.py"
  617. "core/test_repodata.py")))
  618. (with-directory-excursion "tests"
  619. (for-each delete-file network-tests)
  620. ;; FIXME: This test creates a file, then deletes it and tests
  621. ;; that the file was deleted. For some reason it fails when
  622. ;; building with guix, but does not when you run it in the
  623. ;; directory left when you build with the --keep-failed
  624. ;; option
  625. (delete-file "gateways/disk/test_delete.py")
  626. #t))))
  627. (replace 'check
  628. (lambda _
  629. (setenv "HOME" "/tmp")
  630. (zero? (system* "py.test")))))))
  631. (native-inputs
  632. `(("python-ruamel.yaml" ,python-ruamel.yaml)
  633. ("python-requests" ,python-requests)
  634. ("python-pycosat" ,python-pycosat)
  635. ("python-pytest" ,python-pytest)
  636. ("python-responses" ,python-responses)
  637. ("python-pyyaml" ,python-pyyaml)
  638. ("python-anaconda-client" ,python-anaconda-client)))
  639. (home-page "https://github.com/conda/conda")
  640. (synopsis "Cross-platform, OS-agnostic, system-level binary package manager")
  641. (description
  642. "Conda is a cross-platform, Python-agnostic binary package manager. It
  643. is the package manager used by Anaconda installations, but it may be used for
  644. other systems as well. Conda makes environments first-class citizens, making
  645. it easy to create independent environments even for C libraries. Conda is
  646. written entirely in Python.
  647. This package provides Conda as a library.")
  648. (license license:bsd-3)))
  649. (define-public python2-conda
  650. (let ((base (package-with-python2
  651. (strip-python2-variant python-conda))))
  652. (package (inherit base)
  653. (native-inputs
  654. `(("python2-enum34" ,python2-enum34)
  655. ,@(package-native-inputs base))))))
  656. (define-public conda
  657. (package (inherit python-conda)
  658. (name "conda")
  659. (arguments
  660. (substitute-keyword-arguments (package-arguments python-conda)
  661. ((#:phases phases)
  662. `(modify-phases ,phases
  663. (replace 'build
  664. (lambda* (#:key outputs #:allow-other-keys)
  665. ;; This test fails when run before installation.
  666. (delete-file "tests/test_activate.py")
  667. ;; Fix broken defaults
  668. (substitute* "conda/base/context.py"
  669. (("return sys.prefix")
  670. (string-append "return \"" (assoc-ref outputs "out") "\""))
  671. (("return (prefix_is_writable\\(self.root_prefix\\))" _ match)
  672. (string-append "return False if self.root_prefix == self.conda_prefix else "
  673. match)))
  674. ;; The util/setup-testing.py is used to build conda in
  675. ;; application form, rather than the default, library form.
  676. ;; With this, we are able to run commands like `conda --help`
  677. ;; directly on the command line
  678. (zero? (system* "python" "utils/setup-testing.py" "build_py"))))
  679. (replace 'install
  680. (lambda* (#:key inputs outputs #:allow-other-keys)
  681. (let* ((out (assoc-ref outputs "out"))
  682. (target (string-append out "/lib/python"
  683. ((@@ (guix build python-build-system)
  684. get-python-version)
  685. (assoc-ref inputs "python"))
  686. "/site-packages/")))
  687. ;; The installer aborts if the target directory is not on
  688. ;; PYTHONPATH.
  689. (setenv "PYTHONPATH"
  690. (string-append target ":" (getenv "PYTHONPATH")))
  691. ;; And it aborts if the directory doesn't exist.
  692. (mkdir-p target)
  693. (zero? (system* "python" "utils/setup-testing.py" "install"
  694. (string-append "--prefix=" out))))))
  695. ;; The "activate" and "deactivate" scripts don't need wrapping.
  696. ;; They also break when they are renamed.
  697. (add-after 'wrap 'undo-wrap
  698. (lambda* (#:key outputs #:allow-other-keys)
  699. (with-directory-excursion (string-append (assoc-ref outputs "out") "/bin/")
  700. (delete-file "deactivate")
  701. (rename-file ".deactivate-real" "deactivate")
  702. (delete-file "activate")
  703. (rename-file ".activate-real" "activate")
  704. #t)))))))
  705. (description
  706. "Conda is a cross-platform, Python-agnostic binary package manager. It
  707. is the package manager used by Anaconda installations, but it may be used for
  708. other systems as well. Conda makes environments first-class citizens, making
  709. it easy to create independent environments even for C libraries. Conda is
  710. written entirely in Python.")))
  711. (define-public gwl
  712. (package
  713. (name "gwl")
  714. (version "0.1.1")
  715. (source (origin
  716. (method url-fetch)
  717. (uri (string-append "https://www.guixwl.org/releases/gwl-"
  718. version ".tar.gz"))
  719. (sha256
  720. (base32
  721. "06pm967mq1wyggx7l0nfapw5s0k5qc5r9lawk2v3db868br779a7"))))
  722. (build-system gnu-build-system)
  723. (native-inputs
  724. `(("autoconf" ,autoconf)
  725. ("automake" ,automake)
  726. ("pkg-config" ,pkg-config)))
  727. (inputs
  728. `(("guile" ,guile-2.2)))
  729. (propagated-inputs
  730. `(("guix" ,guix)
  731. ("guile-commonmark" ,guile-commonmark)))
  732. (home-page "https://www.guixwl.org")
  733. (synopsis "Workflow management extension for GNU Guix")
  734. (description "This project provides two subcommands to GNU Guix and
  735. introduces two record types that provide a workflow management extension built
  736. on top of GNU Guix.")
  737. ;; The Scheme modules in guix/ and gnu/ are licensed GPL3+,
  738. ;; the web interface modules in gwl/ are licensed AGPL3+,
  739. ;; and the fonts included in this package are licensed OFL1.1.
  740. (license (list license:gpl3+ license:agpl3+ license:silofl1.1))))
  741. (define-public gcab
  742. (package
  743. (name "gcab")
  744. (version "1.1")
  745. (source (origin
  746. (method url-fetch)
  747. (uri (string-append "mirror://gnome/sources/" name "/"
  748. version "/" name "-" version ".tar.xz"))
  749. (sha256
  750. (base32
  751. "0l19sr6pg0cfcddmi5n79d08mjjbhn427ip5jlsy9zddq9r24aqr"))
  752. ;; gcab 1.1 has a hard dependency on git — even when building
  753. ;; from a tarball. Remove it early so ‘guix environment gcab’
  754. ;; can actually build what ‘guix build --source gcab’ returns.
  755. (modules '((guix build utils)))
  756. (snippet
  757. '(begin
  758. (substitute* "meson.build"
  759. (("git_version = .*$") "git_version = []\n"))
  760. #t))))
  761. (build-system meson-build-system)
  762. (native-inputs
  763. `(("glib:bin" ,glib "bin") ; for glib-mkenums
  764. ("intltool" ,intltool)
  765. ("pkg-config" ,pkg-config)
  766. ("vala" ,vala)))
  767. (inputs
  768. `(("glib" ,glib)
  769. ("zlib" ,zlib)))
  770. (arguments
  771. `(#:configure-flags
  772. ;; XXX This ‘documentation’ is for developers, and fails informatively:
  773. ;; Error in gtkdoc helper script: 'gtkdoc-mkhtml' failed with status 5
  774. (list "-Ddocs=false"
  775. "-Dintrospection=false")))
  776. (home-page "https://wiki.gnome.org/msitools") ; no dedicated home page
  777. (synopsis "Microsoft Cabinet file manipulation library")
  778. (description
  779. "The libgcab library provides GObject functions to read, write, and modify
  780. Microsoft cabinet (.@dfn{CAB}) files.")
  781. (license (list license:gpl2+ ; tests/testsuite.at
  782. license:lgpl2.1+)))) ; the rest
  783. (define-public msitools
  784. (package
  785. (name "msitools")
  786. (version "0.97")
  787. (source (origin
  788. (method url-fetch)
  789. (uri (string-append "mirror://gnome/sources/" name "/"
  790. version "/" name "-" version ".tar.xz"))
  791. (sha256
  792. (base32
  793. "0pn6izlgwi4ngpk9jk2n38gcjjpk29nm15aad89bg9z3k9n2hnrs"))))
  794. (build-system gnu-build-system)
  795. (native-inputs
  796. `(("pkg-config" ,pkg-config)))
  797. (inputs
  798. `(("gcab" ,gcab)
  799. ("glib" ,glib)
  800. ("libgsf" ,libgsf)
  801. ("libxml2" ,libxml2)
  802. ("uuid" ,util-linux)))
  803. (home-page "https://wiki.gnome.org/msitools")
  804. (synopsis "Windows Installer file manipulation tool")
  805. (description
  806. "msitools is a collection of command-line tools to inspect, extract, build,
  807. and sign Windows@tie{}Installer (.@dfn{MSI}) files. It aims to be a solution
  808. for packaging and deployment of cross-compiled Windows applications.")
  809. (license license:lgpl2.1+)))
  810. (define-public libostree
  811. (package
  812. (name "libostree")
  813. (version "2018.5")
  814. (source (origin
  815. (method url-fetch)
  816. (uri (string-append
  817. "https://github.com/ostreedev/ostree/releases/download/v"
  818. version "/libostree-" version ".tar.xz"))
  819. (sha256
  820. (base32
  821. "0q82d6rvp119nx7ck7j63a591kz8vg7v465kf9ygh8kzg875l3xd"))))
  822. (build-system gnu-build-system)
  823. (arguments
  824. '(#:phases
  825. (modify-phases %standard-phases
  826. (add-before 'check 'pre-check
  827. (lambda _
  828. ;; Don't try to use the non-existing '/var/tmp' as test
  829. ;; directory.
  830. (setenv "TEST_TMPDIR" (getenv "TMPDIR"))
  831. #t)))
  832. ;; XXX: fails with:
  833. ;; tap-driver.sh: internal error getting exit status
  834. ;; tap-driver.sh: fatal: I/O or internal error
  835. #:tests? #f))
  836. (native-inputs
  837. `(("attr" ,attr) ; for tests
  838. ("bison" ,bison)
  839. ("glib:bin" ,glib "bin") ; for 'glib-mkenums'
  840. ("gobject-introspection" ,gobject-introspection)
  841. ("pkg-config" ,pkg-config)
  842. ("xsltproc" ,libxslt)))
  843. (inputs
  844. `(("avahi" ,avahi)
  845. ("docbook-xml" ,docbook-xml-4.2)
  846. ("docbook-xsl" ,docbook-xsl)
  847. ("e2fsprogs" ,e2fsprogs)
  848. ("fuse" ,fuse)
  849. ("glib" ,glib)
  850. ("gpgme" ,gpgme)
  851. ("libarchive" ,libarchive)
  852. ("libsoup" ,libsoup)
  853. ("nettle" ,nettle) ; required by 'libarchive.la'
  854. ("util-linux" ,util-linux)))
  855. (home-page "https://ostree.readthedocs.io/en/latest/")
  856. (synopsis "Operating system and container binary deployment and upgrades")
  857. (description
  858. "@code{libostree} is both a shared library and suite of command line
  859. tools that combines a \"git-like\" model for committing and downloading
  860. bootable filesystem trees, along with a layer for deploying them and managing
  861. the bootloader configuration.")
  862. (license license:lgpl2.0+)))