Mirror of GNU Guix
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.

399 lines
15 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019, 2020 John Soo <jsoo1@asu.edu>
  3. ;;; Copyright © 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
  5. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  6. ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages rust-apps)
  23. #:use-module ((guix licenses) #:prefix license:)
  24. #:use-module (guix build-system cargo)
  25. #:use-module (guix download)
  26. #:use-module (guix packages)
  27. #:use-module (gnu packages compression)
  28. #:use-module (gnu packages crates-io)
  29. #:use-module (gnu packages documentation)
  30. #:use-module (gnu packages jemalloc)
  31. #:use-module (gnu packages pcre)
  32. #:use-module (gnu packages pkg-config)
  33. #:use-module (gnu packages tls)
  34. #:use-module (gnu packages version-control))
  35. (define-public exa
  36. (package
  37. (name "exa")
  38. (version "0.9.0")
  39. (source
  40. (origin
  41. (method url-fetch)
  42. (uri (crate-uri "exa" version))
  43. (file-name
  44. (string-append name "-" version ".tar.gz"))
  45. (sha256
  46. (base32
  47. "1s902xgplz1167k0r7x235p914lprpsqy2if0kpa1mlb0fswqqq4"))))
  48. (build-system cargo-build-system)
  49. (arguments
  50. `(#:cargo-inputs
  51. (("rust-ansi-term" ,rust-ansi-term-0.12)
  52. ("rust-datetime" ,rust-datetime-0.4)
  53. ("rust-env-logger" ,rust-env-logger-0.6)
  54. ("rust-git2" ,rust-git2-0.9)
  55. ("rust-glob" ,rust-glob-0.3)
  56. ("rust-lazy-static" ,rust-lazy-static-1)
  57. ("rust-libc" ,rust-libc-0.2)
  58. ("rust-locale" ,rust-locale-0.2)
  59. ("rust-log" ,rust-log-0.4)
  60. ("rust-natord" ,rust-natord-1.0)
  61. ("rust-num-cpus" ,rust-num-cpus-1.11)
  62. ("rust-number-prefix" ,rust-number-prefix-0.3)
  63. ("rust-scoped-threadpool" ,rust-scoped-threadpool-0.1)
  64. ("rust-term-grid" ,rust-term-grid-0.1)
  65. ("rust-term-size" ,rust-term-size-0.3)
  66. ("rust-unicode-width" ,rust-unicode-width-0.1)
  67. ("rust-users" ,rust-users-0.9)
  68. ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
  69. #:cargo-development-inputs
  70. (("rust-datetime" ,rust-datetime-0.4))
  71. #:phases
  72. (modify-phases %standard-phases
  73. (add-after 'configure 'dont-vendor-sources
  74. (lambda* (#:key inputs #:allow-other-keys)
  75. (let ((openssl (assoc-ref inputs "openssl")))
  76. (setenv "OPENSSL_DIR" openssl))
  77. #t))
  78. ;; Ignoring failing tests.
  79. ;; Reported in https://github.com/ogham/exa/issues/318
  80. (add-before 'check 'disable-failing-tests
  81. (lambda _
  82. (substitute* "src/options/mod.rs"
  83. (("^.*fn oneline_across.*" oneline-across)
  84. (string-append "#[ignore]\n" oneline-across)))
  85. (substitute* "src/options/view.rs"
  86. (("test!\\(across:.*") "")
  87. (("test!\\(empty:.*") "")
  88. (("test!\\(gracross:.*") "")
  89. (("test!\\(grid:.*") "")
  90. (("test!\\(icons:.*") "")
  91. (("test!\\(just_binary:.*") "")
  92. (("test!\\(just_blocks:.*") "")
  93. (("test!\\(just_bytes:.*") "")
  94. (("test!\\(just_git:.*") "")
  95. (("test!\\(just_group:.*") "")
  96. (("test!\\(just_header:.*") "")
  97. (("test!\\(just_inode:.*") "")
  98. (("test!\\(just_links:.*") "")
  99. (("test!\\(leg:.*") "")
  100. (("test!\\(lid:.*") "")
  101. (("test!\\(original_g:.*") ""))
  102. #t))
  103. (add-after 'install 'install-extras
  104. (lambda* (#:key outputs #:allow-other-keys)
  105. (let* ((out (assoc-ref outputs "out"))
  106. (share (string-append out "/share"))
  107. (man1 (string-append share "/man/man1")))
  108. (install-file "contrib/man/exa.1" man1)
  109. (mkdir-p (string-append out "/etc/bash_completion.d"))
  110. (mkdir-p (string-append share "/fish/vendor_completions.d"))
  111. (mkdir-p (string-append share "/zsh/site-functions"))
  112. (copy-file "contrib/completions.bash"
  113. (string-append out "/etc/bash_completion.d/exa"))
  114. (copy-file "contrib/completions.fish"
  115. (string-append share "/fish/vendor_completions.d/exa.fish"))
  116. (copy-file "contrib/completions.zsh"
  117. (string-append share "/zsh/site-functions/_exa"))
  118. #t))))))
  119. (inputs
  120. `(("libgit2" ,libgit2)
  121. ("zlib" ,zlib)))
  122. (native-inputs
  123. `(("pkg-config" ,pkg-config)))
  124. (home-page "https://the.exa.website/")
  125. (synopsis "Modern replacement for ls")
  126. (description "@code{exa} is a modern replacement for the command-line
  127. program @code{ls}. It uses colours to distinguish file types and metadata. It
  128. also knows about symlinks, extended attributes, and Git.")
  129. (license license:expat)))
  130. (define-public fd
  131. (package
  132. (name "fd")
  133. (version "7.4.0")
  134. (source
  135. (origin
  136. (method url-fetch)
  137. (uri (crate-uri "fd-find" version))
  138. (file-name
  139. (string-append name "-" version ".tar.gz"))
  140. (sha256
  141. (base32
  142. "147m872zff0srwq9vaxkkbab06g3fkklbk1g2lx90vdhgs37f5xj"))))
  143. (build-system cargo-build-system)
  144. (arguments
  145. `(#:cargo-inputs
  146. (("rust-ansi-term" ,rust-ansi-term-0.12)
  147. ("rust-atty" ,rust-atty-0.2)
  148. ("rust-clap" ,rust-clap-2)
  149. ("rust-ctrlc" ,rust-ctrlc-3.1)
  150. ("rust-globset" ,rust-globset-0.4)
  151. ("rust-humantime" ,rust-humantime-1.3)
  152. ("rust-ignore" ,rust-ignore-0.4)
  153. ("rust-jemallocator" ,rust-jemallocator-0.3)
  154. ("rust-lazy-static" ,rust-lazy-static-1)
  155. ("rust-libc" ,rust-libc-0.2)
  156. ("rust-lscolors" ,rust-lscolors-0.6)
  157. ("rust-num-cpus" ,rust-num-cpus-1.10)
  158. ("rust-regex" ,rust-regex-1)
  159. ("rust-regex-syntax" ,rust-regex-syntax-0.6)
  160. ("rust-version-check" ,rust-version-check-0.9))
  161. #:cargo-development-inputs
  162. (("rust-diff" ,rust-diff-0.1)
  163. ("rust-filetime" ,rust-filetime-0.2)
  164. ("rust-tempdir" ,rust-tempdir-0.3))
  165. #:phases
  166. (modify-phases %standard-phases
  167. (add-after 'unpack 'override-jemalloc
  168. (lambda* (#:key inputs #:allow-other-keys)
  169. (let ((jemalloc (assoc-ref inputs "jemalloc")))
  170. (setenv "JEMALLOC_OVERRIDE"
  171. (string-append jemalloc "/lib/libjemalloc.so")))
  172. #t))
  173. (add-after 'install 'install-extra
  174. (lambda* (#:key outputs #:allow-other-keys)
  175. (let* ((out (assoc-ref outputs "out"))
  176. (install-completion
  177. (lambda (completion out-dir)
  178. (for-each
  179. (lambda (f)
  180. (install-file f (string-append out out-dir)))
  181. (find-files "target/release/build/" completion)))))
  182. ;; Manpages
  183. (install-file "doc/fd.1" (string-append out "/share/man/man1"))
  184. ;; Completions
  185. (install-completion "^fd.bash$" "/etc/bash_completion.d")
  186. (install-completion "^fd.fish$" "/share/fish/vendor_completions.d")
  187. (install-completion "^_fd$" "/share/zsh/site-functions")
  188. (rename-file (string-append out "/etc/bash_completion.d/fd.bash")
  189. (string-append out "/etc/bash_completion.d/fd"))
  190. #t))))))
  191. (inputs `(("jemalloc" ,jemalloc)))
  192. (home-page "https://github.com/sharkdp/fd")
  193. (synopsis "Simple, fast and user-friendly alternative to find")
  194. (description
  195. "@code{fd} is a simple, fast and user-friendly alternative to @code{find}.
  196. While it does not seek to mirror all of find's powerful functionality, it
  197. provides defaults for 80% of the use cases.")
  198. (license (list license:expat license:asl2.0))))
  199. (define-public ripgrep
  200. (package
  201. (name "ripgrep")
  202. (version "11.0.2")
  203. (source
  204. (origin
  205. (method url-fetch)
  206. (uri (crate-uri "ripgrep" version))
  207. (file-name
  208. (string-append name "-" version ".tar.gz"))
  209. (sha256
  210. (base32
  211. "0vqjr96s2rs45715hzf0g0wjahig4zjyiqfijmzzg4jyh9ni80yr"))))
  212. (build-system cargo-build-system)
  213. (arguments
  214. `(#:cargo-inputs
  215. (("rust-bstr" ,rust-bstr-0.2)
  216. ("rust-clap" ,rust-clap-2)
  217. ("rust-grep" ,rust-grep-0.2)
  218. ("rust-ignore" ,rust-ignore-0.4)
  219. ("rust-jemallocator" ,rust-jemallocator-0.3)
  220. ("rust-lazy-static" ,rust-lazy-static-1)
  221. ("rust-log" ,rust-log-0.4)
  222. ("rust-num-cpus" ,rust-num-cpus-1.10)
  223. ("rust-regex" ,rust-regex-1)
  224. ("rust-serde-json" ,rust-serde-json-1.0)
  225. ("rust-termcolor" ,rust-termcolor-1.0))
  226. #:cargo-development-inputs
  227. (("rust-serde" ,rust-serde-1.0)
  228. ("rust-serde-derive" ,rust-serde-derive-1.0))
  229. #:modules ((ice-9 match)
  230. (guix build cargo-build-system)
  231. (guix build utils))
  232. #:phases
  233. (modify-phases %standard-phases
  234. (add-after 'build 'install-manpage
  235. ;; NOTE: This is done before 'check so that there's only one output
  236. ;; directory with the man page.
  237. (lambda* (#:key outputs #:allow-other-keys)
  238. (match (find-files "target" "^rg\\.1$")
  239. ((manpage)
  240. (install-file manpage (string-append
  241. (assoc-ref outputs "out")
  242. "/share/man/man1"))))
  243. #t)))
  244. #:features '("pcre2")))
  245. (native-inputs
  246. `(("asciidoc" ,asciidoc)
  247. ("pcre2" ,pcre2)
  248. ("pkg-config" ,pkg-config)))
  249. (home-page "https://github.com/BurntSushi/ripgrep")
  250. (synopsis "Line-oriented search tool")
  251. (description
  252. "ripgrep is a line-oriented search tool that recursively searches
  253. your current directory for a regex pattern while respecting your
  254. gitignore rules.")
  255. (license (list license:unlicense license:expat))))
  256. (define-public rust-cbindgen
  257. (package
  258. (name "rust-cbindgen")
  259. (version "0.13.1")
  260. (source
  261. (origin
  262. (method url-fetch)
  263. (uri (crate-uri "cbindgen" version))
  264. (file-name (string-append name "-" version ".crate"))
  265. (sha256
  266. (base32
  267. "0w70bnwwqyf9fr6z3rcs7m7ad791fmfmhxy828va0dkfwvamp59c"))))
  268. (build-system cargo-build-system)
  269. (arguments
  270. `(#:cargo-inputs
  271. (("clap" ,rust-clap-2)
  272. ("log" ,rust-log-0.4)
  273. ("proc-macro2" ,rust-proc-macro2-1.0)
  274. ("quote" ,rust-quote-1.0)
  275. ("serde" ,rust-serde-1.0)
  276. ("serde-json" ,rust-serde-json-1.0)
  277. ("syn" ,rust-syn-1.0)
  278. ("tempfile" ,rust-tempfile-3)
  279. ("toml" ,rust-toml-0.5))))
  280. (home-page "https://github.com/eqrion/cbindgen/")
  281. (synopsis "Tool for generating C bindings to Rust code")
  282. (description
  283. "This package provides a tool for generating C/C++ bindings to Rust code.")
  284. (license license:mpl2.0)))
  285. (define-public rust-cbindgen-0.12
  286. (package
  287. (inherit rust-cbindgen)
  288. (name "rust-cbindgen")
  289. (version "0.12.2")
  290. (source
  291. (origin
  292. (method url-fetch)
  293. (uri (crate-uri "cbindgen" version))
  294. (file-name
  295. (string-append name "-" version ".tar.gz"))
  296. (sha256
  297. (base32
  298. "13jzbmjz1bmmfr0i80hw6ar484mgabx3hbpb2ynhk0ddqi0yr58m"))))))
  299. (define-public tokei
  300. (package
  301. (name "tokei")
  302. (version "10.1.1")
  303. (source
  304. (origin
  305. (method url-fetch)
  306. (uri (crate-uri "tokei" version))
  307. (file-name
  308. (string-append name "-" version ".tar.gz"))
  309. (sha256
  310. (base32
  311. "07f5laqw2k9l3k8wrg9h8p2m5d9hkfxngyacwrn3vs7mlnw8l81m"))))
  312. (build-system cargo-build-system)
  313. (arguments
  314. `(#:cargo-inputs
  315. (("rust-clap" ,rust-clap-2)
  316. ("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
  317. ("rust-dirs" ,rust-dirs-2.0)
  318. ("rust-encoding-rs-io" ,rust-encoding-rs-io-0.1)
  319. ("rust-env-logger" ,rust-env-logger-0.7)
  320. ("rust-grep-searcher" ,rust-grep-searcher-0.1)
  321. ("rust-hex" ,rust-hex-0.4)
  322. ("rust-ignore" ,rust-ignore-0.4)
  323. ("rust-log" ,rust-log-0.4)
  324. ("rust-rayon" ,rust-rayon-1.3)
  325. ("rust-serde" ,rust-serde-1.0)
  326. ("rust-serde-cbor" ,rust-serde-cbor-0.10)
  327. ("rust-serde-derive" ,rust-serde-derive-1.0)
  328. ("rust-serde-json" ,rust-serde-json-1.0)
  329. ("rust-serde-yaml" ,rust-serde-yaml-0.8)
  330. ("rust-term-size" ,rust-term-size-0.3)
  331. ("rust-toml" ,rust-toml-0.5))
  332. #:cargo-development-inputs
  333. (("rust-git2" ,rust-git2-0.11)
  334. ("rust-handlebars" ,rust-handlebars-2.0)
  335. ("rust-ignore" ,rust-ignore-0.4)
  336. ("rust-lazy-static" ,rust-lazy-static-1)
  337. ("rust-regex" ,rust-regex-1)
  338. ("rust-serde-json" ,rust-serde-json-1.0)
  339. ("rust-tempfile" ,rust-tempfile-3))
  340. #:phases
  341. (modify-phases %standard-phases
  342. (add-after 'configure 'unvendor-libraries-from-crates
  343. (lambda* (#:key inputs #:allow-other-keys)
  344. (let ((openssl (assoc-ref inputs "openssl")))
  345. (setenv "OPENSSL_DIR" openssl))
  346. #t)))))
  347. (native-inputs
  348. `(("libgit2" ,libgit2)
  349. ("openssl" ,openssl)
  350. ("pkg-config" ,pkg-config)
  351. ("zlib" ,zlib)))
  352. (home-page "https://tokei.rs")
  353. (synopsis "Count code, quickly")
  354. (description
  355. "Tokei is a program that displays statistics about your code. Tokei will
  356. show number of files, total lines within those files and code, comments, and
  357. blanks grouped by language.")
  358. (license (list license:expat license:asl2.0))))
  359. (define-public rust-cargo-c
  360. (package
  361. (name "rust-cargo-c")
  362. (version "0.5.2")
  363. (source
  364. (origin
  365. (method url-fetch)
  366. (uri (crate-uri "cargo-c" version))
  367. (file-name
  368. (string-append name "-" version ".tar.gz"))
  369. (sha256
  370. (base32
  371. "1is72jm0r73pqx2g3h1n6lvrcirwd91mmajsmb3jjg4jnayfkp0w"))))
  372. (build-system cargo-build-system)
  373. (arguments
  374. `(#:cargo-inputs
  375. (("rust-cbindgen" ,rust-cbindgen-0.12)
  376. ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.3)
  377. ("rust-structopt" ,rust-structopt-0.3)
  378. ("rust-log" ,rust-log-0.4)
  379. ("rust-toml" ,rust-toml-0.5)
  380. ("rust-cargo-metadata" ,rust-cargo-metadata-0.9)
  381. ("rust-serde" ,rust-serde-1.0)
  382. ("rust-serde-derive" ,rust-serde-derive-1.0)
  383. ("rust-regex" ,rust-regex-1))))
  384. (home-page "https://github.com/lu-zero/cargo-c")
  385. (synopsis "Build and install C-compatible libraries")
  386. (description
  387. "This package produces and installs a correct pkg-config file, a static
  388. library and a dynamic library, and a C header to be used by any C (and
  389. C-compatible) software.")
  390. (license license:expat)))