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.
 
 
 
 
 
 

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