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.
 
 
 
 
 
 

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