gnu: rust-percent-encoding-2: Update to 2.2.0.
[jackhill/guix/guix.git] / gnu / packages / haskell-apps.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Siniša Biđin <sinisa@bidin.eu>
3 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
4 ;;; Copyright © 2016, 2017, 2018 Nikita <nikita@n0.is>
5 ;;; Copyright © 2017 Danny Milosavljevic <dannym@scratchpost.org>
6 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
7 ;;; Copyright © 2017–2019, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
9 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
10 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
11 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
12 ;;; Copyright © 2019, 2020 Kyle Meyer <kyle@kyleam.com>
13 ;;; Copyright © 2015 John Soo <jsoo1@asu.edu>
14 ;;; Copyright © 2019, 2020, 2022 Efraim Flashner <efraim@flashner.co.il>
15 ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
16 ;;; Copyright © 2020 Alexandru-Sergiu Marton <brown121407@member.fsf.org>
17 ;;; Copyright © 2020 Brian Leung <bkleung89@gmail.com>
18 ;;; Copyright © 2021 EuAndreh <eu@euandre.org>
19 ;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
20 ;;; Copyright © 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
21 ;;;
22 ;;; This file is part of GNU Guix.
23 ;;;
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
28 ;;;
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
33 ;;;
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37 (define-module (gnu packages haskell-apps)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix packages)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix build-system haskell)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages gl)
46 #:use-module (gnu packages haskell)
47 #:use-module (gnu packages haskell-check)
48 #:use-module (gnu packages haskell-crypto)
49 #:use-module (gnu packages haskell-web)
50 #:use-module (gnu packages haskell-xyz)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages pkg-config)
54 #:use-module (gnu packages rsync)
55 #:use-module (gnu packages version-control)
56 #:use-module (gnu packages xorg))
57
58 (define-public apply-refact
59 (package
60 (name "apply-refact")
61 (version "0.9.3.0")
62 (source
63 (origin
64 (method url-fetch)
65 (uri (string-append
66 "https://hackage.haskell.org/package/apply-refact/apply-refact-"
67 version ".tar.gz"))
68 (sha256
69 (base32
70 "1sn5g71sx8xa4ggyk49m661iip6zrzl65vb87l16l31kf79bbm7w"))))
71 (build-system haskell-build-system)
72 (inputs
73 (list ghc-refact
74 ghc-exactprint
75 ghc-syb
76 ghc-extra
77 ghc-uniplate
78 ghc-filemanip
79 ghc-unix-compat
80 ghc-optparse-applicative))
81 (native-inputs
82 (list ghc-tasty ghc-tasty-golden ghc-tasty-expected-failure
83 ghc-silently))
84 (home-page "https://hackage.haskell.org/package/apply-refact")
85 (synopsis "Perform refactorings specified by the refact library")
86 (description
87 "This package lets you perform refactorings specified by the refact
88 library. It is primarily used with HLint's @code{--refactor} flag.")
89 (license license:bsd-3)))
90
91 ;; cabal-install depends on Cabal, which is part of GHC. You can only
92 ;; update this packages after updating GHC.
93 (define-public cabal-install
94 (package
95 (name "cabal-install")
96 (version "3.2.0.0")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (string-append
101 "https://hackage.haskell.org/package/cabal-install/cabal-install-"
102 version
103 ".tar.gz"))
104 (patches (search-patches "cabal-install-base16-bytestring1.0.patch"
105 "cabal-install-ghc8.10.patch"))
106 (sha256
107 (base32 "1c0cc256bha97aj7l0lf76l5swlnmwcqppiz8l4cl5xgba4mwmd0"))))
108 (build-system haskell-build-system)
109 (arguments
110 `(#:phases
111 (modify-phases %standard-phases
112 (add-before 'configure 'update-constraints
113 (lambda _
114 (substitute* "cabal-install.cabal"
115 (("(base|base16-bytestring|random)\\s+[^,]+" all dep)
116 dep)))))))
117 (inputs
118 (list ghc-async
119 ghc-base16-bytestring
120 ghc-cryptohash-sha256
121 ghc-echo
122 ghc-edit-distance
123 ghc-hackage-security
124 ghc-hashable
125 ghc-http
126 ghc-network-uri
127 ghc-network
128 ghc-random
129 ghc-resolv
130 ghc-tar
131 ghc-zip-archive
132 ghc-zlib))
133 (home-page "https://www.haskell.org/cabal/")
134 (synopsis "Command-line interface for Cabal and Hackage")
135 (description
136 "The cabal command-line program simplifies the process of managing
137 Haskell software by automating the fetching, configuration, compilation and
138 installation of Haskell libraries and programs.")
139 (license license:bsd-3)))
140
141 (define-public cpphs
142 (package
143 (name "cpphs")
144 (version "1.20.9.1")
145 (source
146 (origin
147 (method url-fetch)
148 (uri (string-append
149 "https://hackage.haskell.org/package/" name "/"
150 name "-" version ".tar.gz"))
151 (sha256
152 (base32
153 "17wi7fma2qaqdm1hwgaam3fd140v9bpa8ky0wg708h1pqc5v2nbz"))))
154 (build-system haskell-build-system)
155 (inputs
156 (list ghc-polyparse ghc-old-locale ghc-old-time))
157 (home-page "http://projects.haskell.org/cpphs/")
158 (synopsis "Liberalised re-implementation of cpp, the C pre-processor")
159 (description "Cpphs is a re-implementation of the C pre-processor that is
160 both more compatible with Haskell, and itself written in Haskell so that it
161 can be distributed with compilers. This version of the C pre-processor is
162 pretty-much feature-complete and compatible with traditional (K&R)
163 pre-processors. Additional features include: a plain-text mode; an option to
164 unlit literate code files; and an option to turn off macro-expansion.")
165 (license (list license:lgpl2.1+ license:gpl3+))))
166
167 ;; Darcs has no https support:
168 ;; http://darcs.net/manual/Configuring_darcs.html#SECTION00440070000000000000
169 ;; and results of search engines will show that if the protocol is http, https
170 ;; is never mentioned.
171 (define-public darcs
172 (package
173 (name "darcs")
174 (version "2.16.4")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append "https://hackage.haskell.org/package/darcs/"
179 "darcs-" version ".tar.gz"))
180 (sha256
181 (base32
182 "07dygwh6p4fsrlgxmq6r7yvxmf4n2y04izzd30jzqgs0pi9645p4"))
183 (modules '((guix build utils)))
184 ;; Remove time-dependent code for reproducibility.
185 (snippet
186 '(begin
187 (substitute* "darcs/darcs.hs"
188 (("__DATE__") "\"1970-01-01\"")
189 (("__TIME__") "\"00:00:00\""))
190 #t))))
191 (build-system haskell-build-system)
192 (arguments
193 `(#:tests? #f ; TODO: Needs QuickCheck ==2.13.*, and more…
194 #:configure-flags '("-fpkgconfig" "-fcurl" "-flibiconv" "-fthreaded"
195 "-fnetwork-uri" "-fhttp" "--flag=executable"
196 "--flag=library")
197 #:phases
198 (modify-phases %standard-phases
199 (add-after 'patch-source-shebangs 'patch-sh
200 (lambda _
201 (substitute* "tests/issue538.sh"
202 (("/bin/sh") (which "sh")))
203 #t))
204 (add-before 'configure 'update-constraints
205 (lambda _
206 (substitute* "darcs.cabal"
207 (("(constraints)\\s+[^,]+" all dep)
208 dep)
209 (("(cryptonite)\\s+[^,]+" all dep)
210 dep)))))))
211 (inputs
212 (list ghc-cmdargs
213 ghc-split
214 ghc-test-framework-quickcheck2
215 ghc-test-framework-hunit
216 ghc-test-framework
217 ghc-quickcheck
218 ghc-constraints
219 ghc-findbin
220 ghc-hunit
221 ghc-cryptonite
222 ghc-http-conduit
223 ghc-http-types
224 ghc-async
225 ghc-attoparsec
226 ghc-base16-bytestring
227 ghc-bytestring-builder
228 ghc-cryptohash
229 ghc-data-ordlist
230 ghc-fgl
231 ghc-system-filepath
232 ghc-graphviz
233 ghc-hashable
234 ghc-html
235 ghc-mmap
236 ghc-old-time
237 ghc-random
238 ghc-regex-applicative
239 ghc-regex-compat-tdfa
240 ghc-sandi
241 ghc-shelly
242 ghc-tar
243 ghc-transformers-compat
244 ghc-unix-compat
245 ghc-utf8-string
246 ghc-vector
247 ghc-zip-archive
248 ghc-zlib
249 ghc-http
250 curl
251 ghc
252 ncurses
253 perl
254 ghc-network
255 ghc-network-uri))
256 (native-inputs
257 (list pkg-config))
258 (home-page "http://darcs.net")
259 (synopsis "Distributed Revision Control System")
260 (description
261 "Darcs is a revision control system. It is:
262
263 @enumerate
264 @item Distributed: Every user has access to the full command set, removing boundaries
265 between server and client or committer and non-committers.
266 @item Interactive: Darcs is easy to learn and efficient to use because it asks you
267 questions in response to simple commands, giving you choices in your work flow.
268 You can choose to record one change in a file, while ignoring another. As you update
269 from upstream, you can review each patch name, even the full diff for interesting
270 patches.
271 @item Smart: Originally developed by physicist David Roundy, darcs is based on a
272 unique algebra of patches called @url{http://darcs.net/Theory,Patchtheory}.
273 @end enumerate")
274 (license license:gpl2)))
275
276 (define-public ghcid
277 (package
278 (name "ghcid")
279 (version "0.8.7")
280 (source
281 (origin
282 (method url-fetch)
283 (uri (string-append "https://hackage.haskell.org/package/ghcid/"
284 "ghcid-" version ".tar.gz"))
285 (sha256
286 (base32 "0yqc1pkfajnr56gnh43sbj50r7c3r41b2jfz07ivgl6phi4frjbq"))))
287 (build-system haskell-build-system)
288 (inputs
289 (list ghc-extra ghc-ansi-terminal ghc-cmdargs ghc-fsnotify
290 ghc-terminal-size))
291 (native-inputs
292 (list ghc-tasty ghc-tasty-hunit))
293 (home-page "https://github.com/ndmitchell/ghcid#readme")
294 (synopsis "GHCi based bare bones IDE")
295 (description
296 "Either \"GHCi as a daemon\" or \"GHC + a bit of an IDE\". A very simple Haskell
297 development tool which shows you the errors in your project and updates them whenever
298 you save. Run @code{ghcid --topmost --command=ghci}, where @code{--topmost} makes the
299 window on top of all others (Windows only) and @code{--command} is the command to start
300 GHCi on your project (defaults to @code{ghci} if you have a @file{.ghci} file, or else
301 to @code{cabal repl}).")
302 (license license:bsd-3)))
303
304 (define-public git-annex
305 (package
306 (name "git-annex")
307 (version "10.20220927")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append "https://hackage.haskell.org/package/"
312 "git-annex/git-annex-" version ".tar.gz"))
313 (sha256
314 (base32 "1bqcaddw47g6i3z9g0iym5x7zy1q8fsirzqnjsa63n2bwm6zzplc"))))
315 (build-system haskell-build-system)
316 (arguments
317 `(#:configure-flags
318 '("--flags=-Android -Webapp")
319 #:phases
320 (modify-phases %standard-phases
321 (add-before 'configure 'patch-shell-for-tests
322 (lambda _
323 ;; Shell.hs defines "/bin/sh" that is used in Git hooks. We
324 ;; shouldn't patch hooks with Guix's current bash because the
325 ;; hooks can exist after that bash is garbage collected, but
326 ;; let's temporarily patch it so that we can run the tests.
327 (copy-file "Utility/Shell.hs" "/tmp/Shell.hs")
328 (substitute* "Utility/Shell.hs"
329 (("/bin/sh") (which "sh")))))
330 (add-before 'configure 'factor-setup
331 (lambda _
332 ;; Factor out necessary build logic from the provided
333 ;; `Setup.hs' script. The script as-is does not work because
334 ;; it cannot find its dependencies, and there is no obvious way
335 ;; to tell it where to look.
336 (call-with-output-file "PreConf.hs"
337 (lambda (out)
338 (format out "import qualified Build.Configure as Configure~%")
339 (format out "main = Configure.run Configure.tests~%")))
340 (call-with-output-file "Setup.hs"
341 (lambda (out)
342 (format out "import Distribution.Simple~%")
343 (format out "main = defaultMain~%")))))
344 (add-before 'configure 'pre-configure
345 (lambda _
346 (invoke "runhaskell" "PreConf.hs")))
347 (add-after 'build 'build-manpages
348 (lambda _
349 ;; The Setup.hs rewrite above removed custom code for building
350 ;; the man pages. In addition to that code, git-annex's source
351 ;; tree has a file that's not included in the tarball but is used
352 ;; by the Makefile to build man pages. Copy the core bits here.
353 (call-with-output-file "Build/MakeMans.hs"
354 (lambda (out)
355 (format out "module Main where~%")
356 (format out "import Build.Mans~%")
357 (format out "main = buildMansOrWarn~%")))
358 (invoke "runhaskell" "Build/MakeMans.hs")))
359 (replace 'check
360 (lambda* (#:key tests? #:allow-other-keys)
361 ;; We need to set the path so that Git recognizes
362 ;; `git annex' as a custom command.
363 (setenv "PATH" (string-append (getenv "PATH") ":"
364 (getcwd) "/dist/build/git-annex"))
365 (when tests?
366 (with-directory-excursion "dist/build/git-annex"
367 (symlink "git-annex" "git-annex-shell"))
368 (invoke "git-annex" "test"))))
369 (add-after 'check 'unpatch-shell-and-rebuild
370 (lambda args
371 ;; Undo `patch-shell-for-tests'.
372 (copy-file "/tmp/Shell.hs" "Utility/Shell.hs")
373 (apply (assoc-ref %standard-phases 'build) args)))
374 (add-after 'install 'install-manpages
375 (lambda* (#:key outputs #:allow-other-keys)
376 (let ((man (string-append (assoc-ref outputs "out")
377 "/man/man1/")))
378 (mkdir-p man)
379 (for-each (lambda (file) (install-file file man))
380 (find-files "man")))))
381 (add-after 'install 'install-symlinks
382 (lambda* (#:key outputs #:allow-other-keys)
383 (let* ((out (assoc-ref outputs "out"))
384 (bin (string-append out "/bin")))
385 (symlink (string-append bin "/git-annex")
386 (string-append bin "/git-annex-shell"))
387 (symlink (string-append bin "/git-annex")
388 (string-append bin "/git-remote-tor-annex")))))
389 (add-after 'install 'touch-static-output
390 (lambda* (#:key outputs #:allow-other-keys)
391 ;; The Haskell build system adds a "static" output by
392 ;; default, and there is no way to override this until
393 ;; <https://issues.guix.gnu.org/41569> is fixed. Without
394 ;; this phase, the daemon complains because we do not
395 ;; create the "static" output.
396 (with-output-to-file (assoc-ref outputs "static")
397 (lambda ()
398 (display "static output not used\n"))))))))
399 (inputs
400 (list curl
401 ghc-aeson
402 ghc-ansi-terminal
403 ghc-async
404 ghc-attoparsec
405 ghc-aws
406 ghc-bloomfilter
407 ghc-byteable
408 ghc-case-insensitive
409 ghc-clientsession
410 ghc-concurrent-output
411 ghc-conduit
412 ghc-connection
413 ghc-crypto-api
414 ghc-cryptonite
415 ghc-data-default
416 ghc-dav
417 ghc-disk-free-space
418 ghc-dlist
419 ghc-edit-distance
420 ghc-exceptions
421 ghc-feed
422 ghc-filepath-bytestring
423 ghc-free
424 ghc-hinotify
425 ghc-http-client
426 ghc-http-client-tls
427 ghc-http-client-restricted
428 ghc-http-conduit
429 ghc-http-types
430 ghc-ifelse
431 ghc-magic
432 ghc-memory
433 ghc-microlens
434 ghc-monad-control
435 ghc-monad-logger
436 ghc-mountpoints
437 ghc-network
438 ghc-network-bsd
439 ghc-network-info
440 ghc-network-multicast
441 ghc-network-uri
442 ghc-old-locale
443 ghc-optparse-applicative
444 ghc-persistent
445 ghc-persistent-sqlite
446 ghc-persistent-template
447 ghc-quickcheck
448 ghc-random
449 ghc-regex-tdfa
450 ghc-resourcet
451 ghc-safesemaphore
452 ghc-sandi
453 ghc-securemem
454 ghc-socks
455 ghc-split
456 ghc-stm-chans
457 ghc-tagsoup
458 ghc-torrent
459 ghc-transformers
460 ghc-unix-compat
461 ghc-unliftio-core
462 ghc-unordered-containers
463 ghc-utf8-string
464 ghc-uuid
465 ghc-vector
466 ghc-wai
467 ghc-wai-extra
468 ghc-warp
469 ghc-warp-tls
470 ghc-yesod
471 ghc-yesod-core
472 ghc-yesod-form
473 ghc-yesod-static
474 git
475 rsync))
476 (native-inputs
477 (list ghc-tasty ghc-tasty-hunit ghc-tasty-quickcheck ghc-tasty-rerun
478 perl))
479 (home-page "https://git-annex.branchable.com/")
480 (synopsis "Manage files with Git, without checking in their contents")
481 (description "This package allows managing files with Git, without
482 checking the file contents into Git. It can store files in many places,
483 such as local hard drives and cloud storage services. It can also be
484 used to keep a folder in sync between computers.")
485 ;; The main author has released all his changes under AGPLv3+ as of March
486 ;; 2019 (7.20190219-187-g40ecf58d4). These are also licensed under the
487 ;; original GPLv3+ license, but going forward new changes will be under
488 ;; only AGPLv3+. The other licenses below cover code written by others.
489 ;; See git-annex's COPYRIGHT file for details on each file.
490 (license (list license:agpl3+
491 license:gpl3+
492 license:bsd-2
493 license:expat
494 license:gpl2))))
495
496 (define-public hlint
497 (package
498 (name "hlint")
499 (version "3.2.7")
500 (source
501 (origin
502 (method url-fetch)
503 (uri (string-append
504 "https://hackage.haskell.org/package/" name
505 "/" name "-" version ".tar.gz"))
506 (sha256
507 (base32
508 "0z6gxndrh7blzapkdn6fq1pkbkjlmbgjbq9ydnvy2wm00fb3v73g"))))
509 (build-system haskell-build-system)
510 (inputs
511 (list ghc-unordered-containers
512 ghc-yaml
513 ghc-vector
514 ghc-data-default
515 ghc-file-embed
516 ghc-utf8-string
517 cpphs
518 ghc-filepattern
519 ghc-lib-parser-ex
520 hscolour
521 ghc-cmdargs
522 ghc-uniplate
523 ghc-ansi-terminal
524 ghc-extra
525 ghc-refact
526 ghc-aeson))
527 (home-page "https://github.com/ndmitchell/hlint")
528 (synopsis "Suggest improvements for Haskell source code")
529 (description "HLint reads Haskell programs and suggests changes that
530 hopefully make them easier to read. HLint also makes it easy to disable
531 unwanted suggestions, and to add your own custom suggestions.")
532 (license license:bsd-3)))
533
534 (define-public hoogle
535 (package
536 (name "hoogle")
537 (version "5.0.18.2")
538 (source
539 (origin
540 (method url-fetch)
541 (uri
542 (string-append
543 "https://hackage.haskell.org/package/hoogle/hoogle-"
544 version ".tar.gz"))
545 (sha256
546 (base32
547 "1xacx2f33x1a4qlv25f8rlmb4wi0cjfzrj22nlnkrd0knghik3m7"))))
548 (build-system haskell-build-system)
549 (inputs
550 (list ghc-quickcheck
551 ghc-aeson
552 ghc-blaze-html
553 ghc-blaze-markup
554 ghc-cmdargs
555 ghc-conduit
556 ghc-conduit-extra
557 ghc-connection
558 ghc-extra
559 ghc-foundation
560 ghc-old-locale
561 ghc-haskell-src-exts
562 ghc-http-conduit
563 ghc-http-types
564 ghc-js-flot
565 ghc-js-jquery
566 ghc-mmap
567 ghc-process-extras
568 ghc-resourcet
569 ghc-storable-tuple
570 ghc-tar
571 ghc-uniplate
572 ghc-utf8-string
573 ghc-vector
574 ghc-wai
575 ghc-wai-logger
576 ghc-warp
577 ghc-warp-tls
578 ghc-zlib))
579 (home-page "https://hoogle.haskell.org/")
580 (synopsis "Haskell API Search")
581 (description "Hoogle is a Haskell API search engine, which allows
582 you to search many standard Haskell libraries by either function name,
583 or by approximate type signature.")
584 (license license:bsd-3)))
585
586 (define-public hscolour
587 (package
588 (name "hscolour")
589 (version "1.24.4")
590 (source
591 (origin
592 (method url-fetch)
593 (uri (string-append
594 "https://hackage.haskell.org/package/hscolour/hscolour-"
595 version
596 ".tar.gz"))
597 (sha256
598 (base32
599 "079jwph4bwllfp03yfr26s5zc6m6kw3nhb1cggrifh99haq34cr4"))))
600 (build-system haskell-build-system)
601 (home-page "https://hackage.haskell.org/package/hscolour")
602 (synopsis "Script to colourise Haskell code")
603 (description "HSColour is a small Haskell script to colourise Haskell
604 code. It currently has six output formats: ANSI terminal codes (optionally
605 XTerm-256colour codes), HTML 3.2 with font tags, HTML 4.01 with CSS, HTML 4.01
606 with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
607 and mIRC chat codes.")
608 (license license:bsd-3)))
609
610 (define-public kmonad
611 (package
612 (name "kmonad")
613 (version "0.4.1")
614 (source
615 (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url "https://github.com/david-janssen/kmonad")
619 (commit version)))
620 (file-name (git-file-name name version))
621 (sha256
622 (base32 "1rp880zxvrznx0y1k464wjrds441dpsz94syhrkaw5dnmxf74yjd"))))
623 (build-system haskell-build-system)
624 (arguments
625 `(#:phases
626 (modify-phases %standard-phases
627 (delete 'haddock) ; Haddock fails to generate docs
628 (add-after 'install 'install-udev-rules
629 (lambda* (#:key outputs #:allow-other-keys)
630 (let* ((out (assoc-ref outputs "out"))
631 (rules (string-append out "/lib/udev/rules.d")))
632 (mkdir-p rules)
633 (call-with-output-file (string-append rules "/70-kmonad.rules")
634 (lambda (port)
635 (display
636 (string-append
637 "KERNEL==\"uinput\", MODE=\"0660\", "
638 "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"\n")
639 port)))
640 #t)))
641 (add-after 'install-udev-rules 'install-documentation
642 (lambda* (#:key outputs #:allow-other-keys)
643 (let* ((out (assoc-ref outputs "out"))
644 (doc (string-append out "/share/doc/kmonad-" ,version)))
645 (install-file "README.md" doc)
646 (copy-recursively "doc" doc)
647 (copy-recursively "keymap" (string-append doc "/keymap"))
648 #t))))))
649 (inputs
650 (list ghc-cereal
651 ghc-exceptions
652 ghc-hashable
653 ghc-lens
654 ghc-megaparsec
655 ghc-optparse-applicative
656 ghc-resourcet
657 ghc-rio
658 ghc-unagi-chan
659 ghc-unliftio
660 ghc-unordered-containers))
661 (home-page "https://github.com/david-janssen/kmonad")
662 (synopsis "Advanced keyboard manager")
663 (description "KMonad is a keyboard remapping utility that supports
664 advanced functionality, such as custom keymap layers and modifiers, macros,
665 and conditional mappings that send a different keycode when tapped or held.
666 By operating at a lower level than most similar tools, it supports X11,
667 Wayland, and Linux console environments alike.")
668 (license license:expat)))
669
670 (define-public nixfmt
671 (package
672 (name "nixfmt")
673 (version "0.4.0")
674 (source
675 (origin
676 (method url-fetch)
677 (uri (string-append
678 "https://hackage.haskell.org/package/nixfmt/nixfmt-"
679 version
680 ".tar.gz"))
681 (sha256
682 (base32 "1ispgl8rc2scr6v8bb6sks7px856jf61x74zj2iyddrn5qamkb3n"))))
683 (build-system haskell-build-system)
684 (inputs
685 (list ghc-megaparsec ghc-parser-combinators ghc-cmdargs
686 ghc-safe-exceptions))
687 (arguments
688 `(#:cabal-revision
689 ("1" "1hsj0jh6siph3afd9c2wii09sffl48rzqv653n4clpd8qy0rn48d")
690 #:phases
691 (modify-phases %standard-phases
692 (add-before 'configure 'update-constraints
693 (lambda _
694 (substitute* "nixfmt.cabal"
695 (("(base|megaparsec)\\s+[^,]+" all dep)
696 dep)))))))
697 (home-page "https://github.com/serokell/nixfmt")
698 (synopsis "Opinionated formatter for Nix")
699 (description
700 "Nixfmt is a formatter for Nix that ensures consistent and clear
701 formatting by forgetting all existing formatting during parsing.")
702 (license license:mpl2.0)))
703
704 (define-public greenclip
705 (package
706 (name "greenclip")
707 (version "3.4")
708 (source
709 (origin
710 (method git-fetch)
711 (uri (git-reference
712 (url "https://github.com/erebe/greenclip")
713 (commit version)))
714 (file-name (git-file-name name version))
715 (sha256
716 (base32 "1baw360dcnyavacf7a8v6wq4m5g6bcmyybkckv4cz7r4xl5p3qws"))))
717 (build-system haskell-build-system)
718 (native-inputs
719 (list pkg-config))
720 (inputs
721 (list libx11
722 libxext
723 libxscrnsaver
724 ghc-x11
725 ghc-exceptions
726 ghc-hashable
727 ghc-microlens
728 ghc-microlens-mtl
729 ghc-protolude
730 ghc-vector
731 ghc-wordexp))
732 (home-page "https://github.com/erebe/greenclip")
733 (synopsis "Simple Clipboard manager")
734 (description "@code{greenclip} is a clipboard manager written in
735 Haskell.")
736 (license license:bsd-3)))
737
738 (define-public raincat
739 (package
740 (name "raincat")
741 (version "1.2.1")
742 (source
743 (origin
744 (method url-fetch)
745 (uri (string-append "mirror://hackage/package/Raincat/"
746 "Raincat-" version ".tar.gz"))
747 (sha256
748 (base32
749 "10y9zi22m6hf13c9h8zd9vg7mljpwbw0r3djb6r80bna701fdf6c"))))
750 (build-system haskell-build-system)
751 (arguments
752 `(#:phases
753 (modify-phases %standard-phases
754 (add-after 'install 'wrap-executable
755 (lambda* (#:key inputs outputs #:allow-other-keys)
756 (let ((out (assoc-ref outputs "out")))
757 (wrap-program (string-append out "/bin/raincat")
758 `("LD_LIBRARY_PATH" ":" =
759 (,(string-append (assoc-ref inputs "freeglut")
760 "/lib"))))
761 #t))))))
762 (inputs
763 (list ghc-extensible-exceptions
764 ghc-random
765 ghc-glut
766 freeglut
767 ghc-opengl
768 ghc-sdl2
769 ghc-sdl2-image
770 ghc-sdl2-mixer))
771 (home-page "https://www.gamecreation.org/games/raincat")
772 (synopsis "Puzzle game with a cat in lead role")
773 (description "Project Raincat is a game developed by Carnegie Mellon
774 students through GCS during the Fall 2008 semester. Raincat features game
775 play inspired from classics Lemmings and The Incredible Machine. The project
776 proved to be an excellent learning experience for the programmers. Everything
777 is programmed in Haskell.")
778 (license license:bsd-3)))
779
780 (define-public scroll
781 (package
782 (name "scroll")
783 (version "1.20180421")
784 (source
785 (origin
786 (method url-fetch)
787 (uri (string-append
788 "https://hackage.haskell.org/package/scroll/scroll-"
789 version ".tar.gz"))
790 (sha256
791 (base32
792 "0apzrvf99rskj4dbmn57jjxrsf19j436s8a09m950df5aws3a0wj"))))
793 (build-system haskell-build-system)
794 (arguments
795 '(#:phases
796 (modify-phases %standard-phases
797 (add-after 'install 'touch-static-output
798 (lambda* (#:key outputs #:allow-other-keys)
799 ;; The Haskell build system adds a "static" output by
800 ;; default, and there is no way to override this until
801 ;; <https://issues.guix.gnu.org/41569> is fixed. Without
802 ;; this phase, the daemon complains because we do not
803 ;; create the "static" output.
804 (with-output-to-file (assoc-ref outputs "static")
805 (lambda ()
806 (display "static output not used\n")))
807 #t)))))
808 (inputs
809 (list ghc-case-insensitive
810 ghc-data-default
811 ghc-ifelse
812 ghc-monad-loops
813 ghc-ncurses
814 ghc-optparse-applicative
815 ghc-random
816 ghc-vector))
817 (home-page "https://joeyh.name/code/scroll/")
818 (synopsis "scroll(6), a roguelike game")
819 (description
820 "You're a bookworm that's stuck on a scroll. You have to dodge between
821 words and use spells to make your way down the page as the scroll is read. Go
822 too slow and you'll get wound up in the scroll and crushed.")
823 (license license:gpl2)))
824
825 (define-public shellcheck
826 (package
827 (name "shellcheck")
828 (version "0.8.0")
829 (source
830 (origin
831 (method url-fetch)
832 (uri (string-append
833 "https://hackage.haskell.org/package/ShellCheck/ShellCheck-"
834 version ".tar.gz"))
835 (sha256
836 (base32 "05jlapp4m997w36h2wszdxz9gvczdczaylypsbn14jqpb650w232"))
837 (file-name (string-append name "-" version ".tar.gz"))))
838 (build-system haskell-build-system)
839 (arguments
840 '(#:haddock? #f ; TODO: Fails to build.
841 #:phases
842 (modify-phases %standard-phases
843 (add-after 'build 'build-man-page
844 (lambda _
845 (invoke "./manpage")))
846 (add-after 'install 'install-man-page
847 (lambda* (#:key outputs #:allow-other-keys)
848 (install-file "shellcheck.1"
849 (string-append (assoc-ref outputs "out")
850 "/share/man/man1/")))))))
851 (native-inputs
852 (list pandoc))
853 (inputs
854 (list ghc-aeson ghc-diff ghc-quickcheck ghc-regex-tdfa))
855 (home-page "https://www.shellcheck.net/")
856 (synopsis "Static analysis for shell scripts")
857 (description "@code{shellcheck} provides static analysis for
858 @command{bash} and @command{sh} shell scripts.
859 It gives warnings and suggestions in order to:
860
861 @enumerate
862 @item Point out and clarify typical beginner's syntax issues that cause
863 a shell to give cryptic error messages.
864 @item Point out and clarify typical intermediate level semantic problems
865 that cause a shell to behave strangely and counter-intuitively.
866 @item Point out subtle caveats, corner cases and pitfalls that may cause an
867 advanced user's otherwise working script to fail under future circumstances.
868 @end enumerate")
869 ;; CVE-2021-28794 is for a completely different, unofficial add-on.
870 (properties `((lint-hidden-cve . ("CVE-2021-28794"))))
871 (license license:gpl3+)))
872
873 (define-public shelltestrunner
874 (package
875 (name "shelltestrunner")
876 (version "1.9")
877 (source (origin
878 (method url-fetch)
879 (uri (string-append "mirror://hackage/package/shelltestrunner-"
880 version "/shelltestrunner-" version ".tar.gz"))
881 (sha256
882 (base32
883 "1a5kzqbwg6990249ypw0cx6cqj6663as1kbj8nzblcky8j6kbi6b"))))
884 (build-system haskell-build-system)
885 (arguments
886 '(#:phases
887 (modify-phases %standard-phases
888 (delete 'check)
889 (add-after 'install 'check
890 (lambda* (#:key outputs tests? parallel-tests? #:allow-other-keys)
891 ;; This test is inspired by the Makefile in the upstream
892 ;; repository, which is missing in the Hackage release tarball
893 ;; along with some of the tests. The Makefile would not work
894 ;; anyway as it ties into the 'stack' build tool.
895 (let* ((out (assoc-ref outputs "out"))
896 (shelltest (string-append out "/bin/shelltest"))
897 (numjobs (if parallel-tests?
898 (number->string (parallel-job-count))
899 "1")))
900 (if tests?
901 (invoke shelltest (string-append "-j" numjobs)
902 "tests/examples")
903 (format #t "test suite not run~%"))
904 #t))))))
905 (inputs
906 (list ghc-diff
907 ghc-cmdargs
908 ghc-filemanip
909 ghc-hunit
910 ghc-pretty-show
911 ghc-regex-tdfa
912 ghc-safe
913 ghc-utf8-string
914 ghc-test-framework
915 ghc-test-framework-hunit))
916 (home-page "https://github.com/simonmichael/shelltestrunner")
917 (synopsis "Test CLI programs")
918 (description
919 "shelltestrunner (executable: @command{shelltest}) is a command-line tool
920 for testing command-line programs, or general shell commands. It reads simple
921 test specifications defining a command to run, some input, and the expected
922 output, stderr, and exit status.")
923 (license license:gpl3+)))
924
925 (define-public stylish-haskell
926 (package
927 (name "stylish-haskell")
928 (version "0.13.0.0")
929 (source
930 (origin
931 (method url-fetch)
932 (uri
933 (string-append
934 "https://hackage.haskell.org/package/stylish-haskell/"
935 "stylish-haskell-" version ".tar.gz"))
936 (sha256
937 (base32
938 "0x9w3zh1lzp6l5xj3mynnlr0fzb5mbv0wwpfxp8fr6bk0jcrzjwf"))))
939 (build-system haskell-build-system)
940 (inputs
941 (list ghc-aeson
942 ghc-file-embed
943 ghc-haskell-src-exts
944 ghc-semigroups
945 ghc-syb
946 ghc-hsyaml
947 ghc-hsyaml-aeson
948 ghc-lib-parser
949 ghc-strict
950 ghc-optparse-applicative
951 ghc-hunit
952 ghc-test-framework
953 ghc-test-framework-hunit))
954 (home-page "https://github.com/jaspervdj/stylish-haskell")
955 (synopsis "Haskell code prettifier")
956 (description "Stylish-haskell is a Haskell code prettifier. The goal is
957 not to format all of the code in a file, to avoid \"getting in the way\".
958 However, this tool can e.g. clean up import statements and help doing various
959 tasks that get tedious very quickly. It can
960 @itemize
961 @item
962 Align and sort @code{import} statements
963 @item
964 Group and wrap @code{{-# LANGUAGE #-}} pragmas, remove (some) redundant
965 pragmas
966 @item
967 Remove trailing whitespaces
968 @item
969 Align branches in @code{case} and fields in records
970 @item
971 Convert line endings (customisable)
972 @item
973 Replace tabs by four spaces (turned off by default)
974 @item
975 Replace some ASCII sequences by their Unicode equivalent (turned off by
976 default)
977 @end itemize")
978 (license license:bsd-3)))