shellutils.scm 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
  3. ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
  4. ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
  5. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  6. ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2018 Benjamin Slade <slade@jnanam.net>
  8. ;;; Copyright © 2019 Collin J. Doering <collin@rekahsoft.ca>
  9. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  10. ;;; Copyright © 2020 aecepoglu <aecepoglu@fastmail.fm>
  11. ;;; Copyright © 2020 Dion Mendel <guix@dm9.info>
  12. ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
  13. ;;; Copyright © 2021 Alexandr Vityazev <avityazev@posteo.org>
  14. ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
  15. ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
  16. ;;; Copyright © 2021 Wiktor Żelazny <wzelazny@vurv.cz>
  17. ;;;
  18. ;;; This file is part of GNU Guix.
  19. ;;;
  20. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  21. ;;; under the terms of the GNU General Public License as published by
  22. ;;; the Free Software Foundation; either version 3 of the License, or (at
  23. ;;; your option) any later version.
  24. ;;;
  25. ;;; GNU Guix is distributed in the hope that it will be useful, but
  26. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  27. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. ;;; GNU General Public License for more details.
  29. ;;;
  30. ;;; You should have received a copy of the GNU General Public License
  31. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  32. (define-module (gnu packages shellutils)
  33. #:use-module ((guix licenses) #:prefix license:)
  34. #:use-module (guix gexp)
  35. #:use-module (guix utils)
  36. #:use-module (guix packages)
  37. #:use-module (guix download)
  38. #:use-module (guix git-download)
  39. #:use-module (guix build-system gnu)
  40. #:use-module (guix build-system go)
  41. #:use-module (guix build-system python)
  42. #:use-module (gnu packages autotools)
  43. #:use-module (gnu packages base)
  44. #:use-module (gnu packages bison)
  45. #:use-module (gnu packages check)
  46. #:use-module (gnu packages flex)
  47. #:use-module (gnu packages golang)
  48. #:use-module (gnu packages libunistring)
  49. #:use-module (gnu packages ncurses)
  50. #:use-module (gnu packages pcre)
  51. #:use-module (gnu packages pkg-config)
  52. #:use-module (gnu packages python)
  53. #:use-module (gnu packages python-xyz)
  54. #:use-module (gnu packages readline)
  55. #:use-module (gnu packages ruby)
  56. #:use-module (gnu packages shells)
  57. #:use-module (gnu packages tmux)
  58. #:use-module (gnu packages vim))
  59. (define-public ascii
  60. (package
  61. (name "ascii")
  62. (version "3.18")
  63. (source (origin
  64. (method url-fetch)
  65. (uri (string-append "http://www.catb.org/~esr/ascii/"
  66. "ascii-" version ".tar.gz"))
  67. (sha256
  68. (base32
  69. "0b87vy06s8s3a8q70pqavsbk4m4ff034sdml2xxa6qfsykaj513j"))))
  70. (build-system gnu-build-system)
  71. (arguments `(#:make-flags
  72. (list (string-append "CC=" ,(cc-for-target))
  73. (string-append "PREFIX=" %output))
  74. #:phases
  75. (modify-phases %standard-phases
  76. (delete 'configure)
  77. (add-before 'install 'create-directories
  78. (lambda* (#:key outputs #:allow-other-keys)
  79. (let* ((out (assoc-ref outputs "out"))
  80. (bin (string-append out "/bin"))
  81. (man1 (string-append out "/share/man/man1")))
  82. (mkdir-p bin)
  83. (mkdir-p man1)))))
  84. #:tests? #f))
  85. (home-page "http://www.catb.org/~esr/ascii/")
  86. (synopsis "ASCII name and synonym chart")
  87. (description
  88. "The @code{ascii} utility provides easy conversion between various byte
  89. representations and the American Standard Code for Information Interchange
  90. (ASCII) character table. It knows about a wide variety of hex, binary, octal,
  91. Teletype mnemonic, ISO/ECMA code point, slang names, XML entity names, and
  92. other representations. Given any one on the command line, it will try to
  93. display all others. Called with no arguments it displays a handy small ASCII
  94. chart.")
  95. (license license:bsd-2)))
  96. (define-public boxes
  97. (package
  98. (name "boxes")
  99. (version "2.1.1")
  100. (source (origin
  101. (method git-fetch)
  102. (uri (git-reference
  103. (url "https://github.com/ascii-boxes/boxes")
  104. (commit (string-append "v" version))))
  105. (file-name (git-file-name name version))
  106. (sha256
  107. (base32
  108. "1bf5rnfiw04ffs1l17zhbg4wvq2vfn2qbz1xmd250xqj15lysw88"))))
  109. (build-system gnu-build-system)
  110. (arguments
  111. `(#:test-target "test"
  112. #:make-flags (list (string-append "GLOBALCONF="
  113. (assoc-ref %outputs "out")
  114. "/etc/boxes-config"))
  115. #:modules
  116. ((ice-9 match)
  117. ,@%gnu-build-system-modules)
  118. #:phases
  119. (modify-phases %standard-phases
  120. (delete 'configure)
  121. (replace 'install
  122. (lambda* (#:key outputs #:allow-other-keys)
  123. (let ((out (assoc-ref outputs "out")))
  124. (for-each (match-lambda
  125. ((source target)
  126. (install-file source
  127. (string-append out "/" target))))
  128. '(("out/boxes" "bin/")
  129. ("doc/boxes.1" "share/man/man1/")
  130. ("boxes-config" "etc/")))))))))
  131. (native-inputs
  132. (list bison flex
  133. ;; For the tests.
  134. xxd))
  135. (inputs
  136. (list libunistring pcre2))
  137. (home-page "https://boxes.thomasjensen.com")
  138. (synopsis "Command line ASCII boxes")
  139. (description
  140. "This command-line filter program draws ASCII-art boxes around your input
  141. text.")
  142. (license license:gpl2)))
  143. (define-public zsh-autosuggestions
  144. (package
  145. (name "zsh-autosuggestions")
  146. (version "0.7.0")
  147. (source (origin
  148. (method git-fetch)
  149. (uri (git-reference
  150. (url "https://github.com/zsh-users/zsh-autosuggestions")
  151. (commit (string-append "v" version))))
  152. (file-name (git-file-name name version))
  153. (sha256
  154. (base32
  155. "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98"))))
  156. (build-system gnu-build-system)
  157. (native-inputs
  158. (list ruby
  159. ruby-byebug
  160. ruby-pry
  161. ruby-rspec
  162. ruby-rspec-wait
  163. tmux
  164. zsh))
  165. (arguments
  166. '(#:phases
  167. (modify-phases %standard-phases
  168. (add-after 'unpack 'patch-tests
  169. (lambda _
  170. ;; Failing tests since tmux-3.2a
  171. (delete-file "spec/options/buffer_max_size_spec.rb")))
  172. (delete 'configure)
  173. (replace 'check ; Tests use ruby's bundler; instead execute rspec directly.
  174. (lambda _
  175. (setenv "TMUX_TMPDIR" (getenv "TMPDIR"))
  176. (setenv "SHELL" (which "zsh"))
  177. (invoke "rspec")))
  178. (replace 'install
  179. (lambda* (#:key outputs #:allow-other-keys)
  180. (let* ((out (assoc-ref outputs "out"))
  181. (zsh-plugins
  182. (string-append out "/share/zsh/plugins/zsh-autosuggestions")))
  183. (invoke "make" "all")
  184. (install-file "zsh-autosuggestions.zsh" zsh-plugins)
  185. #t))))))
  186. (home-page "https://github.com/zsh-users/zsh-autosuggestions")
  187. (synopsis "Fish-like autosuggestions for zsh")
  188. (description
  189. "Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands
  190. as you type.")
  191. (license license:expat)))
  192. (define-public zsh-syntax-highlighting
  193. (package
  194. (name "zsh-syntax-highlighting")
  195. (version "0.7.1")
  196. (source (origin
  197. (method git-fetch)
  198. (uri (git-reference
  199. (url "https://github.com/zsh-users/zsh-syntax-highlighting")
  200. (commit version)))
  201. (file-name (git-file-name name version))
  202. (sha256
  203. (base32
  204. "039g3n59drk818ylcyvkciv8k9mf739cv6v4vis1h9fv9whbcmwl"))))
  205. (build-system gnu-build-system)
  206. (native-inputs
  207. (list zsh))
  208. (arguments
  209. ;; FIXME: Tests fail when running test regexp
  210. ;; there is no pcre module in the Guix zsh package
  211. `(#:tests? #f
  212. #:phases
  213. (modify-phases %standard-phases
  214. (delete 'configure)
  215. (add-after 'unpack 'patch-paths
  216. (lambda* (#:key outputs #:allow-other-keys)
  217. (let ((out (assoc-ref outputs "out")))
  218. (substitute* "Makefile"
  219. (("/usr/local") out)
  220. (("share/\\$\\(NAME\\)") "share/zsh/plugins/$(NAME)")))))
  221. (add-after 'patch-paths 'make-writable
  222. (lambda _
  223. (for-each make-file-writable
  224. '("docs/highlighters.md"
  225. "README.md"))))
  226. (add-before 'build 'add-all-md
  227. (lambda _
  228. (invoke "make" "all")))
  229. (replace 'check
  230. (lambda* (#:key tests? #:allow-other-keys)
  231. (when tests?
  232. (invoke "make" "test")
  233. (invoke "make" "perf")))))))
  234. (home-page "https://github.com/zsh-users/zsh-syntax-highlighting")
  235. (synopsis "Fish shell-like syntax highlighting for Zsh")
  236. (description
  237. "This package provides syntax highlighting for Zsh. It enables
  238. highlighting of commands whilst they are typed at a Zsh prompt into an
  239. interactive terminal. This helps in reviewing commands before running them,
  240. particularly in catching syntax errors.")
  241. (license license:bsd-3)))
  242. (define-public sh-z
  243. (package
  244. (name "sh-z")
  245. (version "1.11")
  246. (source (origin
  247. (method git-fetch)
  248. (uri (git-reference
  249. (url "https://github.com/rupa/z")
  250. (commit (string-append "v" version))))
  251. (file-name (git-file-name name version))
  252. (sha256
  253. (base32
  254. "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb"))))
  255. (build-system gnu-build-system)
  256. (arguments
  257. `(#:tests? #f ; No tests provided
  258. #:phases
  259. (modify-phases %standard-phases
  260. (delete 'configure)
  261. (delete 'build)
  262. (replace 'install
  263. (lambda* (#:key outputs #:allow-other-keys)
  264. (let* ((out (assoc-ref outputs "out"))
  265. (man (string-append out "/share/man/man1"))
  266. (bin (string-append out "/bin")))
  267. (install-file "z.sh" bin)
  268. (chmod (string-append bin "/z.sh") #o755)
  269. (install-file "z.1" man)
  270. #t))))))
  271. (synopsis "Jump about directories")
  272. (description
  273. "Tracks your most used directories, based on ``frecency''. After a short
  274. learning phase, z will take you to the most ``frecent'' directory that matches
  275. all of the regexes given on the command line in order.")
  276. (home-page "https://github.com/rupa/z")
  277. (license license:expat)))
  278. (define-public envstore
  279. (package
  280. (name "envstore")
  281. (version "2.1")
  282. (source
  283. (origin
  284. (method url-fetch)
  285. (uri (string-append "https://finalrewind.org/projects/"
  286. name "/" name "-" version ".tar.bz2"))
  287. (sha256
  288. (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
  289. (build-system gnu-build-system)
  290. (arguments
  291. `(#:test-target "test"
  292. #:make-flags (list "CC=gcc"
  293. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  294. #:phases
  295. (modify-phases %standard-phases
  296. (delete 'configure))))
  297. (home-page "https://finalrewind.org/projects/envstore/")
  298. (synopsis "Save and restore environment variables")
  299. (description "Envstore is a program for sharing environment variables
  300. between various shells or commands.")
  301. (license license:wtfpl2)))
  302. (define-public trash-cli
  303. (package
  304. (name "trash-cli")
  305. (version "0.21.10.24")
  306. (source
  307. (origin
  308. (method git-fetch)
  309. (uri (git-reference
  310. (url "https://github.com/andreafrancia/trash-cli")
  311. (commit version)))
  312. (file-name (git-file-name name version))
  313. (sha256
  314. (base32
  315. "01is32lk6prwhajvlmgn3xs4fcpmiqivizcqkj9k80jx6mqjifzs"))))
  316. (build-system python-build-system)
  317. (arguments
  318. `(#:phases
  319. (modify-phases %standard-phases
  320. (add-before 'build 'patch-path-constants
  321. (lambda* (#:key inputs #:allow-other-keys)
  322. (let ((libc (assoc-ref inputs "libc"))
  323. (coreutils (assoc-ref inputs "coreutils")))
  324. (substitute* "trashcli/list_mount_points.py"
  325. (("\"/lib/libc.so.6\".*")
  326. (string-append "\"" libc "/lib/libc.so.6\"\n"))
  327. (("\"df\"")
  328. (string-append "\"" coreutils "/bin/df\""))))))
  329. (add-before 'build 'fix-setup.py
  330. (lambda* (#:key outputs #:allow-other-keys)
  331. (let* ((out (assoc-ref outputs "out"))
  332. (bin (string-append out "/bin")))
  333. (mkdir-p bin)
  334. (substitute* "setup.py"
  335. (("add_script\\('")
  336. (string-append "add_script('" bin "/" ))))))
  337. ;; Whenever setup.py is invoked, scripts in out/bin/ are
  338. ;; replaced. Thus we cannot invoke setup.py for testing.
  339. ;; Upstream also uses pytest.
  340. (replace 'check
  341. (lambda* (#:key tests? #:allow-other-keys)
  342. (when tests?
  343. (invoke "pytest")))))))
  344. (native-inputs
  345. (list python-pytest
  346. python-mock
  347. python-six))
  348. (inputs (list coreutils))
  349. (propagated-inputs
  350. (list python-psutil))
  351. (home-page "https://github.com/andreafrancia/trash-cli")
  352. (synopsis "Trash can management tool")
  353. (description
  354. "trash-cli is a command line utility for interacting with the
  355. FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
  356. environments. It can move files to the trash, and remove or list files that
  357. are already there.")
  358. (license license:gpl2+)))
  359. (define-public direnv
  360. (package
  361. (name "direnv")
  362. (version "2.28.0")
  363. (source
  364. (origin (method git-fetch)
  365. (uri (git-reference
  366. (url "https://github.com/direnv/direnv")
  367. (commit (string-append "v" version))))
  368. (file-name (git-file-name name version))
  369. (sha256
  370. (base32
  371. "0yk53jn7wafklixclka17wyjjs2g5giigjr2bd0xzy10nrzwp7c9"))))
  372. (build-system go-build-system)
  373. (arguments
  374. '(#:import-path "github.com/direnv/direnv"
  375. #:phases
  376. (modify-phases %standard-phases
  377. (add-after 'install 'install-manpages
  378. (lambda* (#:key outputs #:allow-other-keys)
  379. (let* ((out (assoc-ref outputs "out"))
  380. (man (string-append out "/share/man/man1")))
  381. (mkdir-p man)
  382. (with-directory-excursion "src/github.com/direnv/direnv"
  383. (install-file "man/direnv.1" man)
  384. (install-file "man/direnv-stdlib.1" man)
  385. (install-file "man/direnv.toml.1" man)))))
  386. (replace 'check
  387. (lambda* (#:key tests? #:allow-other-keys)
  388. (when tests?
  389. (setenv "HOME" "/tmp")
  390. (with-directory-excursion "src/github.com/direnv/direnv"
  391. ;; The following file needs to be writable so it can be
  392. ;; modified by the testsuite.
  393. (make-file-writable "test/scenarios/base/.envrc")
  394. ;; We need to manually run test because make test
  395. ;; tries to use go modules
  396. (invoke "go" "test" "./...")
  397. ;; Clean up from the tests, especially so that the extra
  398. ;; direnv executable that's generated is removed.
  399. (invoke "make" "clean")))
  400. #t)))))
  401. (native-inputs
  402. (list go-github-com-burntsushi-toml go-github-com-direnv-go-dotenv
  403. go-github-com-mattn-go-isatty go-golang-org-x-mod which))
  404. (home-page "https://direnv.net/")
  405. (synopsis "Environment switcher for the shell")
  406. (description
  407. "direnv can hook into the bash, zsh, tcsh, and fish shells to load
  408. or unload environment variables depending on the current directory. This
  409. allows project-specific environment variables without using @file{~/.profile}.
  410. Before each prompt, direnv checks for the existence of a @file{.envrc} file in
  411. the current and parent directories. This file is then used to alter the
  412. environment variables of the current shell.")
  413. (license license:expat)))
  414. (define-public fzy
  415. (package
  416. (name "fzy")
  417. (version "1.0")
  418. (source
  419. (origin
  420. (method git-fetch)
  421. (uri (git-reference
  422. (url "https://github.com/jhawthorn/fzy")
  423. (commit version)))
  424. (file-name (git-file-name name version))
  425. (sha256
  426. (base32
  427. "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
  428. (build-system gnu-build-system)
  429. (arguments
  430. '(#:make-flags (list "CC=gcc"
  431. (string-append "PREFIX=" (assoc-ref %outputs "out")))
  432. #:phases
  433. (modify-phases %standard-phases
  434. (delete 'configure))))
  435. (home-page "https://github.com/jhawthorn/fzy")
  436. (synopsis "Fast fuzzy text selector for the terminal with an advanced
  437. scoring algorithm")
  438. (description
  439. "Most other fuzzy matchers sort based on the length of a match. fzy tries
  440. to find the result the user intended. It does this by favouring matches on
  441. consecutive letters and starts of words. This allows matching using acronyms
  442. or different parts of the path.
  443. fzy is designed to be used both as an editor plugin and on the command
  444. line. Rather than clearing the screen, fzy displays its interface directly
  445. below the current cursor position, scrolling the screen if necessary.")
  446. (license license:expat)))
  447. (define-public hstr
  448. (package
  449. (name "hstr")
  450. (version "2.5")
  451. (source (origin
  452. (method git-fetch)
  453. (uri (git-reference
  454. (url "https://github.com/dvorka/hstr")
  455. (commit version)))
  456. (file-name (git-file-name name version))
  457. (sha256
  458. (base32
  459. "0xg10jyiq12bcygi6aa9qq9pki7bipdsvsza037p2iqix19jg0x8"))))
  460. (build-system gnu-build-system)
  461. (arguments
  462. `(#:phases
  463. (modify-phases %standard-phases
  464. (add-before 'build 'adjust-ncurses-includes
  465. (lambda* (#:key make-flags outputs #:allow-other-keys)
  466. (let ((out (assoc-ref outputs "out")))
  467. (substitute* "src/include/hstr_curses.h"
  468. (("ncursesw\\/curses.h") "ncurses.h"))
  469. (substitute* "src/include/hstr.h"
  470. (("ncursesw\\/curses.h") "ncurses.h")))
  471. #t)))))
  472. (native-inputs
  473. (list autoconf automake pkg-config))
  474. (inputs
  475. (list ncurses readline))
  476. (synopsis "Navigate and search command history with shell history suggest box")
  477. (description "HSTR (HiSToRy) is a command-line utility that brings
  478. improved Bash and Zsh command completion from the history. It aims to make
  479. completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
  480. easily view, navigate, and search your command history with suggestion boxes.
  481. HSTR can also manage your command history (for instance you can remove
  482. commands that are obsolete or contain a piece of sensitive information) or
  483. bookmark your favourite commands.")
  484. (home-page "http://me.mindforger.com/projects/hh.html")
  485. (license license:asl2.0)))
  486. (define-public shell-functools
  487. (package
  488. (name "shell-functools")
  489. (version "0.3.0")
  490. (source (origin
  491. (method git-fetch)
  492. (uri (git-reference
  493. (url "https://github.com/sharkdp/shell-functools")
  494. (commit (string-append "v" version))))
  495. (file-name (git-file-name name version))
  496. (sha256
  497. (base32
  498. "0d6zzg7cxfrzwzh1wmpj7q85kz33sak6ac59ncsm6dlbin12h0hi"))))
  499. (build-system python-build-system)
  500. (home-page "https://github.com/sharkdp/shell-functools/")
  501. (synopsis "Functional programming tools for the shell")
  502. (description "This package provides higher order functions like map,
  503. filter, foldl, sort_by and take_while as simple command-line tools. Following
  504. the UNIX philosophy, these commands are designed to be composed via pipes. A
  505. large collection of functions such as basename, replace, contains or is_dir
  506. are provided as arguments to these commands.")
  507. (license license:expat)))
  508. (define-public rig
  509. (package
  510. (name "rig")
  511. (version "1.11")
  512. (source (origin
  513. (method url-fetch)
  514. (uri (string-append "mirror://sourceforge/rig/rig/"
  515. version "/rig-"
  516. version ".tar.gz"))
  517. (sha256
  518. (base32
  519. "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0"))))
  520. (build-system gnu-build-system)
  521. (arguments `(#:make-flags
  522. (list (string-append "CXX=" ,(cxx-for-target))
  523. (string-append "PREFIX=" %output))
  524. #:phases
  525. (modify-phases %standard-phases
  526. (delete 'configure)
  527. (add-after 'unpack 'fix-build
  528. (lambda _
  529. (substitute* "rig.cc"
  530. (("^#include <string>")
  531. "#include <cstring>"))
  532. (substitute* "Makefile"
  533. (("g\\+\\+")
  534. "${CXX} -O2")
  535. (("install -g 0 -m 755 -o 0 -s rig \\$\\(BINDIR\\)")
  536. "install -m 755 -d $(DESTDIR)$(BINDIR)\n\t\
  537. install -m 755 rig $(DESTDIR)$(BINDIR)/rig")
  538. (("install -g 0 -m 644 -o 0 rig.6 \\$\\(MANDIR\\)/man6/rig.6")
  539. "install -m 755 -d $(DESTDIR)$(MANDIR)/man6/\n\t\
  540. install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6")
  541. (("install -g 0 -m 755 -o 0 -d \\$\\(DATADIR\\)")
  542. "install -m 755 -d $(DESTDIR)$(DATADIR)")
  543. (("install -g 0 -m 644 -o 0 data/\\*.idx \\$\\(DATADIR\\)")
  544. "install -m 644 data/*.idx $(DESTDIR)$(DATADIR)")))))
  545. #:tests? #f))
  546. (home-page "http://rig.sourceforge.net")
  547. (synopsis "Random identity generator")
  548. (description
  549. "RIG (Random Identity Generator) generates random, yet real-looking,
  550. personal data. It is useful if you need to feed a name to a Web site, BBS, or
  551. real person, and are too lazy to think of one yourself. Also, if the Web
  552. site/BBS/person you are giving the information to tries to cross-check the
  553. city, state, zip, or area code, it will check out.")
  554. (license license:gpl2+)))
  555. (define-public conflict
  556. (package
  557. (name "conflict")
  558. (version "20210108")
  559. (source (origin
  560. (method url-fetch)
  561. (uri (string-append
  562. "https://invisible-mirror.net/archives/conflict/conflict-"
  563. version ".tgz"))
  564. (sha256
  565. (base32
  566. "0mls4climvp7v9hnc3zh01mh270kqcj797ng0xslwb027lipis4h"))))
  567. (build-system gnu-build-system)
  568. (arguments
  569. `(#:phases
  570. (modify-phases %standard-phases
  571. (add-after 'unpack 'fix-paths
  572. (lambda _
  573. (substitute* "run_test.sh"
  574. (("PATH=\".:\\$BIN:/bin\"")
  575. "PATH=\".:$BIN:$PATH\"")))))))
  576. (home-page "https://invisible-island.net/conflict/conflict.html")
  577. (synopsis "Displays conflicting filenames in your execution path")
  578. (description
  579. "@code{conflict} examines the user-specifiable list of programs, looking
  580. for instances in the user's path which conflict (i.e., the name appears in
  581. more than one point in the path).")
  582. (license (license:x11-style "file://COPYING"))))
  583. (define-public renameutils
  584. (package
  585. (name "renameutils")
  586. (version "0.12.0")
  587. (source
  588. (origin
  589. (method url-fetch)
  590. (uri (string-append "mirror://savannah/renameutils/"
  591. "renameutils-" version ".tar.gz"))
  592. (sha256
  593. (base32
  594. "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb"))
  595. (modules '((guix build utils)))
  596. (snippet '(begin
  597. (substitute* "src/Makefile.in"
  598. (("\\(\\$bindir\\)") "$(bindir)"))
  599. #t))))
  600. (build-system gnu-build-system)
  601. (inputs
  602. (list readline))
  603. (home-page "https://www.nongnu.org/renameutils/")
  604. (synopsis "File renaming utilities")
  605. (description "The file renaming utilities (renameutils for short) are a
  606. set of programs designed to make renaming of files faster and less cumbersome.
  607. The file renaming utilities consists of five programs: @command{qmv},
  608. @command{qcp}, @command{imv}, @command{icp}, and @command{deurlname}.")
  609. (license license:gpl3+)))
  610. (define-public grc
  611. (package
  612. (name "grc")
  613. (version "1.13")
  614. (source
  615. (origin
  616. (method git-fetch)
  617. (uri (git-reference
  618. (url "https://github.com/garabik/grc")
  619. (commit (string-append "v" version))))
  620. (file-name (git-file-name name version))
  621. (sha256
  622. (base32 "1h0h88h484a9796hai0wasi1xmjxxhpyxgixn6fgdyc5h69gv8nl"))))
  623. (build-system gnu-build-system)
  624. (inputs
  625. (list python))
  626. (arguments
  627. (list
  628. #:phases
  629. #~(modify-phases %standard-phases
  630. (delete 'configure)
  631. (replace 'build
  632. (lambda _
  633. (substitute* "grc"
  634. (("conffilenames = \\[.*\\]")
  635. (string-append
  636. "conffilenames = ["
  637. "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
  638. "+ '/etc/grc.conf']")))
  639. (substitute* "grcat"
  640. (("conffilepath \\+= \\['/usr/.*\\]")
  641. (string-append
  642. "conffilepath += ["
  643. "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
  644. "+ '/share/grc/']"))))) ;; trailing slash!
  645. (delete 'check)
  646. (replace 'install
  647. (lambda _
  648. (invoke "sh" "install.sh" #$output #$output))))))
  649. (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/grc.html")
  650. (synopsis "Generic colouriser for everything")
  651. (description "@code{grc} can be used to colourise logfiles, output of
  652. shell commands, arbitrary text, etc. Many shell commands are supported out of
  653. the box.
  654. You might want to add these lines you your @code{~/.bashrc}:
  655. @example
  656. GRC_ALIASES=true
  657. source ${GUIX_ENVIRONMENT:-$HOME/.guix-profile}/etc/profile.d/grc.sh
  658. @end example
  659. ")
  660. (license license:gpl2)))