projects/guix·blob javascript-team · refs

1195 lines · 45.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Siniša Biđin <[email protected]>
3;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2016, 2017, 2018 Nikita <[email protected]>
5;;; Copyright © 2017 Danny Milosavljevic <[email protected]>
6;;; Copyright © 2017, 2018 Alex Vong <[email protected]>
7;;; Copyright © 2017–2019, 2021 Tobias Geerinckx-Rice <[email protected]>
8;;; Copyright © 2018 Timothy Sample <[email protected]>
9;;; Copyright © 2018 Arun Isaac <[email protected]>
10;;; Copyright © 2016, 2017 Leo Famulari <[email protected]>
11;;; Copyright © 2015 Paul van der Walt <[email protected]>
12;;; Copyright © 2019, 2020 Kyle Meyer <[email protected]>
13;;; Copyright © 2015 John Soo <[email protected]>
14;;; Copyright © 2019, 2020, 2022-2024 Efraim Flashner <[email protected]>
15;;; Copyright © 2019, 2020 Alex Griffin <[email protected]>
16;;; Copyright © 2020 Alexandru-Sergiu Marton <[email protected]>
17;;; Copyright © 2020 Brian Leung <[email protected]>
18;;; Copyright © 2021 EuAndreh <[email protected]>
19;;; Copyright © 2021 Stefan Reichör <[email protected]>
20;;; Copyright © 2021 Morgan Smith <[email protected]>
21;;; Copyright © 2022 David Thompson <[email protected]>
22;;; Copyright © 2024 jgart <[email protected]>
23;;; Copyright © 2026 Konstantin Suntsov <[email protected]>
24;;;
25;;; This file is part of GNU Guix.
26;;;
27;;; GNU Guix is free software; you can redistribute it and/or modify it
28;;; under the terms of the GNU General Public License as published by
29;;; the Free Software Foundation; either version 3 of the License, or (at
30;;; your option) any later version.
31;;;
32;;; GNU Guix is distributed in the hope that it will be useful, but
33;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35;;; GNU General Public License for more details.
36;;;
37;;; You should have received a copy of the GNU General Public License
38;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39
40(define-module (gnu packages haskell-apps)
41 #:use-module (guix download)
42 #:use-module (guix gexp)
43 #:use-module (guix git-download)
44 #:use-module (guix packages)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix build-system haskell)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages bash)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages freedesktop)
51 #:use-module (gnu packages gl)
52 #:use-module (gnu packages haskell)
53 #:use-module (gnu packages haskell-check)
54 #:use-module (gnu packages haskell-crypto)
55 #:use-module (gnu packages haskell-web)
56 #:use-module (gnu packages haskell-xyz)
57 #:use-module (gnu packages lsof)
58 #:use-module (gnu packages ncurses)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages rsync)
62 #:use-module (gnu packages version-control)
63 #:use-module (gnu packages xorg))
64
65(define-public apply-refact
66 (package
67 (name "apply-refact")
68 (version "0.15.0.0")
69 (source (origin
70 (method url-fetch)
71 (uri (hackage-uri "apply-refact" version))
72 (sha256
73 (base32
74 "0iny8ynxx46afbzjp14rvpd4sqk8c1p5883mbln53gmlxcm8zq53"))))
75 (build-system haskell-build-system)
76 (properties '((upstream-name . "apply-refact")))
77 (inputs (list ghc-refact
78 ghc-data-default
79 ghc-exactprint
80 ghc-paths
81 ghc-extra
82 ghc-syb
83 ghc-filemanip
84 ghc-uniplate
85 ghc-unix-compat
86 ghc-optparse-applicative))
87 (native-inputs (list ghc-tasty ghc-tasty-golden ghc-tasty-expected-failure
88 ghc-silently))
89 (home-page "https://github.com/mpickering/apply-refact")
90 (synopsis "Perform refactorings specified by the refact library")
91 (description
92 "This package lets you perform refactorings specified by the refact
93library. It is primarily used with HLint's @code{--refactor} flag.")
94 (license license:bsd-3)))
95
96;; cabal-install depends on Cabal, which is part of GHC. You can only
97;; update this packages after updating GHC.
98(define-public cabal-install
99 (package
100 (name "cabal-install")
101 (version "3.12.1.0")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (hackage-uri "cabal-install" version))
106 (sha256
107 (base32 "1cmifq189i4x0r0yha3dl8nrzzfh92bnd2saak7dqvvjkkysqj38"))))
108 (build-system haskell-build-system)
109 (properties '((upstream-name . "cabal-install")))
110 (inputs (list ghc-async
111 ghc-base16-bytestring
112 ghc-cabal-install-solver
113 ghc-cryptohash-sha256
114 ghc-echo
115 ghc-edit-distance
116 ghc-hashable
117 ghc-http
118 ghc-network-uri
119 ghc-random
120 ghc-tar
121 ghc-zlib
122 ghc-hackage-security
123 ghc-open-browser
124 ghc-regex-base
125 ghc-regex-posix
126 ghc-safe-exceptions
127 ghc-semaphore-compat
128 ghc-resolv
129 ghc-lukko))
130 (native-inputs (list ghc-tasty
131 ghc-tasty-golden
132 ghc-tasty-quickcheck
133 ghc-tasty-expected-failure
134 ghc-tasty-hunit
135 ghc-tree-diff
136 ghc-quickcheck
137 ghc-tasty
138 ghc-tasty-hunit
139 ghc-tasty
140 ghc-tasty-hunit
141 ghc-tagged
142 ghc-tagged
143 ghc-tasty
144 ghc-tasty-expected-failure
145 ghc-tasty-hunit
146 ghc-tasty-quickcheck
147 ghc-quickcheck
148 ghc-pretty-show))
149 (arguments
150 `(#:cabal-revision ("2"
151 "0fdzqdkg2vbyg0lnbk9bdskr2d23hwjpmnc7jnvpzkcmxmcvl99n")
152 ;; The tests depend on Cabal-{QuickCheck,described,tests,tree-diff},
153 ;; which are not distributed on hackage.
154 #:tests? #f))
155 (home-page "https://www.haskell.org/cabal/")
156 (synopsis "Command-line interface for Cabal and Hackage")
157 (description
158 "The cabal command-line program simplifies the process of managing
159Haskell software by automating the fetching, configuration, compilation and
160installation of Haskell libraries and programs.")
161 (license license:bsd-3)))
162
163(define-public cpphs
164 (package
165 (name "cpphs")
166 (version "1.20.9.1")
167 (source
168 (origin
169 (method url-fetch)
170 (uri (hackage-uri "cpphs" version))
171 (sha256
172 (base32
173 "17wi7fma2qaqdm1hwgaam3fd140v9bpa8ky0wg708h1pqc5v2nbz"))))
174 (build-system haskell-build-system)
175 (properties '((upstream-name . "cpphs")))
176 (inputs (list ghc-polyparse))
177 (arguments
178 `(#:cabal-revision ("2"
179 "0vxav36p0kplp4dpd17i4cfzrsl3r437d840xwv83lf1bqp7mrxc")))
180 (home-page "https://projects.haskell.org/cpphs/")
181 (synopsis "Liberalised re-implementation of cpp, the C pre-processor")
182 (description "Cpphs is a re-implementation of the C pre-processor that is
183both more compatible with Haskell, and itself written in Haskell so that it
184can be distributed with compilers. This version of the C pre-processor is
185pretty-much feature-complete and compatible with traditional (K&R)
186pre-processors. Additional features include: a plain-text mode; an option to
187unlit literate code files; and an option to turn off macro-expansion.")
188 (license (list license:lgpl2.1+ license:gpl3+))))
189
190;; Darcs has no https support:
191;; http://darcs.net/manual/Configuring_darcs.html#SECTION00440070000000000000
192;; and results of search engines will show that if the protocol is http, https
193;; is never mentioned.
194(define-public darcs
195 (package
196 (name "darcs")
197 (version "2.16.5")
198 (source
199 (origin
200 (method url-fetch)
201 (uri (hackage-uri "darcs" version))
202 (sha256
203 (base32
204 "0ar4markr71l9hzrbgcz4q37cf2rf3936i6qi8p827p36v96qg6n"))
205 (modules '((guix build utils)))
206 ;; Remove time-dependent code for reproducibility.
207 (snippet
208 '(begin
209 (substitute* "darcs/darcs.hs"
210 (("__DATE__") "\"1970-01-01\"")
211 (("__TIME__") "\"00:00:00\""))
212 #t))))
213 (build-system haskell-build-system)
214 (properties '((upstream-name . "darcs")))
215 (arguments
216 `(#:tests? #f ; TODO: Needs QuickCheck ==2.13.*, and more…
217 #:configure-flags '("-fpkgconfig" "-fcurl" "-flibiconv" "-fthreaded"
218 "-fnetwork-uri" "-fhttp" "--flag=executable"
219 "--flag=library")
220 #:haddock? #f
221 #:phases
222 (modify-phases %standard-phases
223 (add-after 'patch-source-shebangs 'patch-sh
224 (lambda _
225 (substitute* "tests/issue538.sh"
226 (("/bin/sh") (which "sh")))
227 #t))
228 (add-before 'configure 'update-constraints
229 (lambda _
230 (substitute* "darcs.cabal"
231 (("(attoparsec|base|bytestring|constraints|cryptonite|hashable|memory|regex-tdfa|time)\\s+[^,]+" all dep)
232 dep))))
233 (add-after 'register 'remove-libraries
234 (lambda* (#:key outputs #:allow-other-keys)
235 (delete-file-recursively (string-append (assoc-ref outputs "out") "/lib")))))))
236 (inputs (list ghc-regex-base
237 ghc-regex-tdfa
238 ghc-regex-applicative
239 ghc-fgl
240 ghc-html
241 ghc-memory
242 ghc-cryptonite
243 ghc-base16-bytestring
244 ghc-utf8-string
245 ghc-vector
246 ghc-tar
247 ghc-data-ordlist
248 ghc-attoparsec
249 ghc-zip-archive
250 ghc-async
251 ghc-constraints
252 ghc-unix-compat
253 ghc-old-time
254 ghc-temporary
255 ghc-hashable
256 ghc-mmap
257 ghc-zlib
258 ghc-network-uri
259 ghc-network
260 ghc-conduit
261 ghc-http-conduit
262 ghc-http-types
263 curl))
264 (native-inputs (list ghc-cmdargs
265 ghc-findbin
266 ghc-quickcheck
267 ghc-leancheck
268 ghc-hunit
269 ghc-test-framework
270 ghc-test-framework-hunit
271 ghc-test-framework-quickcheck2
272 ghc-test-framework-leancheck
273 ghc-monad-control
274 ghc-system-filepath
275 ghc-system-fileio
276 ghc-transformers-base
277 pkg-config))
278 (home-page "http://darcs.net")
279 (synopsis "Distributed Revision Control System")
280 (description
281 "Darcs is a revision control system. It is:
282
283@enumerate
284@item Distributed: Every user has access to the full command set, removing boundaries
285between server and client or committer and non-committers.
286@item Interactive: Darcs is easy to learn and efficient to use because it asks you
287questions in response to simple commands, giving you choices in your work flow.
288You can choose to record one change in a file, while ignoring another. As you update
289from upstream, you can review each patch name, even the full diff for interesting
290patches.
291@item Smart: Originally developed by physicist David Roundy, darcs is based on a
292unique algebra of patches called @url{http://darcs.net/Theory,Patchtheory}.
293@end enumerate")
294 (license license:gpl2)))
295
296(define-public ghcid
297 (package
298 (name "ghcid")
299 (version "0.8.9")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (hackage-uri "ghcid" version))
304 (sha256
305 (base32 "1dq8lc0dwzib8y21279q4j54cmm7lvx64b3hw2yiym1kzi9rrhj4"))))
306 (build-system haskell-build-system)
307 (properties '((upstream-name . "ghcid")))
308 (inputs (list ghc-extra ghc-ansi-terminal ghc-cmdargs ghc-fsnotify
309 ghc-terminal-size))
310 (native-inputs (list ghc-tasty ghc-tasty-hunit))
311 (home-page "https://github.com/ndmitchell/ghcid#readme")
312 (synopsis "GHCi based bare bones IDE")
313 (description
314 "Either \"GHCi as a daemon\" or \"GHC + a bit of an IDE\". A very simple Haskell
315development tool which shows you the errors in your project and updates them whenever
316you save. Run @code{ghcid --topmost --command=ghci}, where @code{--topmost} makes the
317window on top of all others (Windows only) and @code{--command} is the command to start
318GHCi on your project (defaults to @code{ghci} if you have a @file{.ghci} file, or else
319to @code{cabal repl}).")
320 (license license:bsd-3)))
321
322(define-public git-annex
323 (package
324 (name "git-annex")
325 (version "10.20250721")
326 (source
327 (origin
328 ;; hackage release doesn't include everything needed for extra bits.
329 (method git-fetch)
330 (uri (git-reference
331 (url "https://git.joeyh.name/git/git-annex.git")
332 (commit version)))
333 (file-name (git-file-name name version))
334 (sha256
335 (base32 "1a2g4z9fl90kyl7k6clmc61ma2njnljr4na6jbf04m43qnnr9s5a"))))
336 (build-system haskell-build-system)
337 (properties '((upstream-name . "git-annex")))
338 (arguments
339 `(#:configure-flags
340 '("--flags=-Android -Webapp Servant")
341 #:haddock? #f
342 #:phases
343 (modify-phases %standard-phases
344 (add-before 'configure 'patch-shell-for-tests
345 (lambda _
346 ;; Shell.hs defines "/bin/sh" that is used in Git hooks. We
347 ;; shouldn't patch hooks with Guix's current bash because the
348 ;; hooks can exist after that bash is garbage collected, but
349 ;; let's temporarily patch it so that we can run the tests.
350 (copy-file "Utility/Shell.hs" "/tmp/Shell.hs")
351 (substitute* "Utility/Shell.hs"
352 (("/bin/sh") (which "sh")))))
353 (add-before 'configure 'patch-webapp
354 (lambda _
355 ;; Replace loose references to xdg-open so that 'git annex
356 ;; webapp' runs without making the user also install xdg-utils.
357 (substitute* '("Assistant/WebApp/DashBoard.hs"
358 "Utility/WebApp.hs")
359 (("xdg-open") (which "xdg-open")))
360 ;; Also replace loose references to lsof.
361 (substitute* "Assistant/Threads/Watcher.hs"
362 (("\"lsof\"")
363 (string-append "\"" (which "lsof") "\"")))))
364 (add-before 'configure 'factor-setup
365 (lambda _
366 ;; Factor out necessary build logic from the provided
367 ;; `Setup.hs' script. The script as-is does not work because
368 ;; it cannot find its dependencies, and there is no obvious way
369 ;; to tell it where to look.
370 (call-with-output-file "PreConf.hs"
371 (lambda (out)
372 (format out "import qualified Build.Configure as Configure~%")
373 (format out "main = Configure.run Configure.tests~%")))
374 (call-with-output-file "Setup.hs"
375 (lambda (out)
376 (format out "import Distribution.Simple~%")
377 (format out "main = defaultMain~%")))))
378 (add-before 'configure 'pre-configure
379 (lambda _
380 (invoke "runhaskell" "PreConf.hs")))
381 (add-after 'build 'build-manpages
382 (lambda _
383 (invoke "make" "mans")))
384 (replace 'check
385 (lambda* (#:key tests? #:allow-other-keys)
386 ;; We need to set the path so that Git recognizes
387 ;; `git annex' as a custom command.
388 (setenv "PATH" (string-append (getenv "PATH") ":"
389 (getcwd) "/dist/build/git-annex"))
390 (when tests?
391 (with-directory-excursion "dist/build/git-annex"
392 (symlink "git-annex" "git-annex-shell")
393 (symlink "git-annex" "git-remote-annex")
394 (symlink "git-annex" "git-remote-tor-annex"))
395 (invoke "git-annex" "test"))))
396 (add-after 'check 'unpatch-shell-and-rebuild
397 (lambda args
398 ;; Undo `patch-shell-for-tests'.
399 (copy-file "/tmp/Shell.hs" "Utility/Shell.hs")
400 (apply (assoc-ref %standard-phases 'build) args)))
401 (add-after 'install 'install-more
402 (lambda* (#:key outputs #:allow-other-keys)
403 (let* ((out (assoc-ref outputs "out"))
404 (bash (string-append out "/etc/bash_completion.d"))
405 (fish (string-append out "/share/fish/vendor_completions.d"))
406 (zsh (string-append out "/share/zsh/site-functions")))
407 (setenv "PREFIX" out)
408 (invoke "make" "install-mans")
409 (mkdir-p bash)
410 (copy-file "bash-completion.bash"
411 (string-append bash "/git-annex"))
412 (mkdir-p fish)
413 (with-output-to-file (string-append fish "/git-annex.fish")
414 (lambda _
415 (invoke (string-append out "/bin/git-annex")
416 "--fish-completion-script" "git-annex")))
417 (mkdir-p zsh)
418 (with-output-to-file (string-append zsh "/_git-annex")
419 (lambda _
420 (invoke (string-append out "/bin/git-annex")
421 "--zsh-completion-script" "git-annex"))))))
422 (add-after 'install 'install-symlinks
423 (lambda* (#:key outputs #:allow-other-keys)
424 (let* ((out (assoc-ref outputs "out"))
425 (bin (string-append out "/bin")))
426 (symlink (string-append bin "/git-annex")
427 (string-append bin "/git-annex-shell"))
428 (symlink (string-append bin "/git-annex")
429 (string-append bin "/git-remote-annex"))
430 (symlink (string-append bin "/git-annex")
431 (string-append bin "/git-remote-tor-annex"))))))))
432 (inputs (list curl
433 ghc-network-uri
434 ghc-optparse-applicative
435 ghc-uuid
436 ghc-data-default
437 ghc-case-insensitive
438 ghc-random
439 ghc-dlist
440 ghc-unix-compat
441 ghc-safesemaphore
442 ghc-async
443 ghc-disk-free-space
444 ghc-ifelse
445 ghc-monad-logger
446 ghc-free
447 ghc-utf8-string
448 ghc-sandi
449 ghc-monad-control
450 ghc-bloomfilter
451 ghc-edit-distance
452 ghc-resourcet
453 ghc-http-client
454 ghc-http-client-tls
455 ghc-http-types
456 ghc-http-conduit
457 ghc-http-client-restricted
458 ghc-conduit
459 ghc-old-locale
460 ghc-persistent-sqlite
461 ghc-persistent
462 ghc-persistent-template
463 ghc-unliftio-core
464 ghc-microlens
465 ghc-aeson
466 ghc-vector
467 ghc-tagsoup
468 ghc-unordered-containers
469 ghc-feed
470 ghc-regex-tdfa
471 ghc-socks
472 ghc-byteable
473 ghc-stm-chans
474 ghc-securemem
475 ghc-crypto-api
476 ghc-memory
477 ghc-split
478 ghc-attoparsec
479 ghc-concurrent-output
480 ghc-unbounded-delays
481 ghc-quickcheck
482 ghc-tasty
483 ghc-tasty-hunit
484 ghc-tasty-quickcheck
485 ghc-tasty-rerun
486 ghc-ansi-terminal
487 ghc-aws
488 ghc-dav
489 ghc-network
490 ghc-network-bsd
491 ghc-git-lfs
492 ghc-clock
493 ghc-crypton
494 ghc-servant
495 ghc-servant-server
496 ghc-servant-client
497 ghc-servant-client-core
498 ghc-warp
499 ghc-warp-tls
500 ghc-os-string
501 ghc-file-io
502 ghc-mountpoints
503 ghc-yesod
504 ghc-yesod-static
505 ghc-yesod-form
506 ghc-yesod-core
507 ghc-path-pieces
508 ghc-wai
509 ghc-wai-extra
510 ghc-blaze-builder
511 ghc-clientsession
512 ghc-shakespeare
513 ghc-hinotify
514 ghc-dbus
515 ghc-fdo-notify
516 ghc-network-multicast
517 ghc-network-info
518 ghc-torrent
519 ghc-magic
520 lsof
521 rsync
522 xdg-utils))
523 (propagated-inputs
524 (list git))
525 (native-inputs (list perl ghc-filepath-bytestring))
526 (home-page "https://git-annex.branchable.com/")
527 (synopsis "Manage files with Git, without checking in their contents")
528 (description "This package allows managing files with Git, without
529checking the file contents into Git. It can store files in many places,
530such as local hard drives and cloud storage services. It can also be
531used to keep a folder in sync between computers.")
532 ;; The main author has released all his changes under AGPLv3+ as of March
533 ;; 2019 (7.20190219-187-g40ecf58d4). These are also licensed under the
534 ;; original GPLv3+ license, but going forward new changes will be under
535 ;; only AGPLv3+. The other licenses below cover code written by others.
536 ;; See git-annex's COPYRIGHT file for details on each file.
537 (license (list license:agpl3+
538 license:gpl3+
539 license:bsd-2
540 license:expat
541 license:gpl2))))
542
543(define-public hlint
544 (package
545 (name "hlint")
546 (version "3.10")
547 (source
548 (origin
549 (method url-fetch)
550 (uri (hackage-uri "hlint" version))
551 (sha256
552 (base32 "0dzy7spc45v88yplczhd3la464bhcbaihi619a45bd06ghrp55nr"))))
553 (build-system haskell-build-system)
554 (properties '((upstream-name . "hlint")))
555 (inputs (list ghc-unordered-containers
556 ghc-vector
557 ghc-file-embed
558 ghc-utf8-string
559 ghc-data-default
560 cpphs
561 ghc-cmdargs
562 ghc-uniplate
563 ghc-ansi-terminal
564 ghc-extra
565 ghc-refact
566 ghc-aeson
567 ghc-deriving-aeson
568 ghc-filepattern
569 ghc-lib-parser
570 ghc-lib-parser-ex
571 hscolour
572 ghc-yaml))
573 (home-page "https://github.com/ndmitchell/hlint#readme")
574 (synopsis "Suggest improvements for Haskell source code")
575 (description
576 "HLint reads Haskell programs and suggests changes that
577hopefully make them easier to read. HLint also makes it easy to disable
578unwanted suggestions, and to add your own custom suggestions.")
579 (license license:bsd-3)))
580
581(define-public hoogle
582 (package
583 (name "hoogle")
584 (version "5.0.18.4")
585 (source
586 (origin
587 (method url-fetch)
588 (uri (hackage-uri "hoogle" version))
589 (sha256
590 (base32 "08z32d87vqzhapb2vw21h25jb2g74csxlpvd8f54xl91k3ijs3wx"))
591 (patches (search-patches "hoogle-crypton-connection-0.4.X.patch"))))
592 (build-system haskell-build-system)
593 (properties '((upstream-name . "hoogle")))
594 (inputs (list ghc-quickcheck
595 ghc-aeson
596 ghc-blaze-html
597 ghc-blaze-markup
598 ghc-cmdargs
599 ghc-conduit
600 ghc-conduit-extra
601 ghc-crypton-connection
602 ghc-data-default-class
603 ghc-extra
604 ghc-foundation
605 ghc-old-locale
606 ghc-hashable
607 ghc-haskell-src-exts
608 ghc-http-conduit
609 ghc-http-types
610 ghc-js-flot
611 ghc-js-jquery
612 ghc-mmap
613 ghc-process-extras
614 ghc-resourcet
615 ghc-safe
616 ghc-storable-tuple
617 ghc-tar
618 ghc-uniplate
619 ghc-utf8-string
620 ghc-vector
621 ghc-wai
622 ghc-wai-logger
623 ghc-warp
624 ghc-warp-tls
625 ghc-zlib
626 ghc-semigroups))
627 (home-page "https://hoogle.haskell.org/")
628 (synopsis "Haskell API Search")
629 (description
630 "Hoogle is a Haskell API search engine, which allows
631you to search many standard Haskell libraries by either function name,
632or by approximate type signature.")
633 (license license:bsd-3)))
634
635(define-public hscolour
636 (package
637 (name "hscolour")
638 (version "1.25")
639 (source
640 (origin
641 (method url-fetch)
642 (uri (hackage-uri "hscolour" version))
643 (sha256
644 (base32 "0z679khnmb6as1zcdb44n9qjk7in32jpm4ldscpqg7jrapd31kjl"))))
645 (build-system haskell-build-system)
646 (properties '((upstream-name . "hscolour")))
647 (home-page "https://hackage.haskell.org/package/hscolour")
648 (synopsis "Script to colourise Haskell code")
649 (description "HSColour is a small Haskell script to colourise Haskell
650code. It currently has six output formats: ANSI terminal codes (optionally
651XTerm-256colour codes), HTML 3.2 with font tags, HTML 4.01 with CSS, HTML 4.01
652with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
653and mIRC chat codes.")
654 (license license:bsd-3)))
655
656(define-public lhs2tex
657 (package
658 (name "lhs2tex")
659 (version "1.26")
660 (source
661 (origin
662 (method url-fetch)
663 (uri (hackage-uri "lhs2tex" version))
664 (sha256
665 (base32 "19f6x07bl2pj824l394zpv7dy1677n6f24iy6nps2w9f39fsb8r6"))))
666 (build-system haskell-build-system)
667 (properties '((upstream-name . "lhs2tex")))
668 (inputs (list ghc-regex-compat))
669 (home-page "https://github.com/kosmikus/lhs2tex")
670 (synopsis "Preprocessor for typesetting Haskell sources with LaTeX")
671 (description
672 "This tool is primarily intended for people who want to write articles or
673books using LaTeX that contain some Haskell code. It works on literate Haskell
674documents where the non-Haskell parts form essentially a valid LaTeX document,
675then processes the Haskell code in the document and replaces it with formatted
676LaTeX output.")
677 (license license:gpl2+)))
678
679(define-public kmonad
680 (package
681 (name "kmonad")
682 (version "0.4.5")
683 (source
684 (origin
685 (method git-fetch)
686 (uri (git-reference
687 (url "https://github.com/kmonad/kmonad")
688 (commit version)))
689 (file-name (git-file-name name version))
690 (sha256
691 (base32 "0ng07i2zb98gx7giz7cjxjx908p1v14wn913k810n550k2gfbvp9"))))
692 (build-system haskell-build-system)
693 (arguments
694 (list
695 #:haddock? #f ;Haddock fails to generate docs
696 #:phases
697 #~(modify-phases %standard-phases
698 (add-after 'unpack 'patch-git-path
699 (lambda* (#:key inputs #:allow-other-keys)
700 (substitute* "src/KMonad/Args/TH.hs"
701 (("\"git\"")
702 (string-append "\""
703 (search-input-file inputs "/bin/git") "\"")))))
704 (add-after 'install 'install-udev-rules
705 (lambda* (#:key outputs #:allow-other-keys)
706 (let* ((rules (string-append #$output "/lib/udev/rules.d")))
707 (mkdir-p rules)
708 (call-with-output-file (string-append rules "/70-kmonad.rules")
709 (lambda (port)
710 (display (string-append
711 "KERNEL==\"uinput\", MODE=\"0660\", "
712 "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"")
713 port))) #t)))
714 (add-after 'install-udev-rules 'install-documentation
715 (lambda* (#:key outputs #:allow-other-keys)
716 (let* ((doc (string-append #$output "/share/doc/"
717 #$name "-"
718 #$version)))
719 (copy-recursively "doc" doc)
720 (copy-recursively "keymap"
721 (string-append doc "/keymap")) #t))))))
722 (native-inputs (list ghc-hspec
723 hspec-discover
724 git))
725 (inputs (list ghc-cereal
726 ghc-exceptions
727 ghc-hinotify
728 ghc-lens
729 ghc-megaparsec
730 ghc-optparse-applicative
731 ghc-resourcet
732 ghc-rio
733 ghc-unliftio
734 ghc-unordered-containers
735 ghc-template-haskell))
736 (home-page "https://github.com/kmonad/kmonad")
737 (synopsis "Advanced keyboard manager")
738 (description
739 "KMonad is a keyboard remapping utility that supports
740advanced functionality, such as custom keymap layers and modifiers, macros,
741and conditional mappings that send a different keycode when tapped or held.
742By operating at a lower level than most similar tools, it supports X11,
743Wayland, and Linux console environments alike.")
744 (license license:expat)))
745
746(define-public matterhorn
747 (package
748 (name "matterhorn")
749 (version "90000.1.2")
750 (source
751 (origin
752 ;; use git repo instead of hackage URL because the hackage tarball
753 ;; doesn't contain the sample config file
754 (method git-fetch)
755 (uri (git-reference
756 (url "https://github.com/matterhorn-chat/matterhorn")
757 (commit version)))
758 (file-name (git-file-name name version))
759 (sha256
760 (base32 "0i3q7896ss4dnmqs83klia4i9psv0w9ahy3k5yrm20m6qwmair5b"))
761 (snippet
762 #~(substitute* "matterhorn.cabal"
763 (("base-compat >= 0\\.9 && < 0\\.13")
764 "base-compat >= 0.9 && < 0.15")
765 (("bytestring >= 0\\.10 && < 0\\.12")
766 "bytestring >= 0.10 && < 0.13")
767 (("containers >= 0\\.5\\.7 && < 0\\.7")
768 "containers >= 0.5.7 && < 0.8")
769 (("crypton-connection >= 0\\.3\\.1 && < 0\\.4")
770 "crypton-connection >= 0.3.1 && < 0.5")
771 (("filepath >= 1\\.4 && < 1\\.5")
772 "filepath >= 1.4 && < 1.6")
773 (("hashable >= 1\\.2 && < 1\\.5")
774 "hashable >= 1.2 && < 1.6")
775 (("tasty >= 0\\.11 && < 1\\.5")
776 "tasty >= 0.11 && < 1.6")
777 (("text >= 1\\.2\\.5\\.0 && < 2\\.1")
778 "text >= 1.2.5.0 && < 2.2")))
779 (modules '((guix build utils)))))
780 (build-system haskell-build-system)
781 (properties '((upstream-name . "matterhorn")))
782 (inputs (list ghc-aeson
783 ghc-aspell-pipe
784 ghc-async
785 ghc-base-compat
786 ghc-bimap
787 ghc-brick
788 ghc-brick-skylighting
789 ghc-commonmark
790 ghc-commonmark-extensions
791 ghc-config-ini
792 ghc-crypton-connection
793 ghc-data-clist
794 ghc-gitrev
795 ghc-hashable
796 ghc-hclip
797 ghc-mattermost-api
798 ghc-microlens-platform
799 ghc-network-uri
800 ghc-random
801 ghc-semigroups
802 ghc-skylighting-core
803 ghc-split
804 ghc-stm-delay
805 ghc-strict
806 ghc-tasty
807 ghc-temporary
808 ghc-text-zipper
809 ghc-timezone-olson
810 ghc-timezone-series
811 ghc-unix-compat
812 ghc-unordered-containers
813 ghc-utf8-string
814 ghc-uuid
815 ghc-vector
816 ghc-vty
817 ghc-vty-crossplatform
818 ghc-word-wrap
819 ghc-xdg-basedir))
820 (native-inputs (list ghc-checkers
821 ghc-mattermost-api-qc
822 ghc-tasty
823 ghc-tasty-hunit
824 ghc-tasty-quickcheck
825 ghc-unique))
826 (arguments
827 (list
828 #:phases
829 #~(modify-phases %standard-phases
830 (add-after 'unpack 'fix-requirements
831 (lambda _
832 (for-each (lambda (dep)
833 (substitute* "matterhorn.cabal"
834 (((string-append "(,\\s" dep
835 "\\s*>=\\s[0-9].[0-9]).*")
836 all pat)
837 pat)))
838 (list "random"
839 "data-clist"
840 "semigroups"
841 "word-wrap"
842 "unix-compat"
843 "skylighting-core"
844 "checkers"
845 "vty"
846 "vty-crossplatform"
847 "brick"))))
848 (add-after 'install 'install-config-file
849 (lambda _
850 (install-file "./docs/sample-config.ini"
851 (string-append #$output "/share/doc/"
852 #$name "-" #$version "/etc/")))))))
853 (home-page "https://hackage.haskell.org/package/matterhorn")
854 (synopsis "Terminal client for the Mattermost chat system")
855 (description
856 "This is a terminal client for the Mattermost chat system.")
857 (license license:bsd-3)))
858
859(define-public nixfmt
860 (package
861 (name "nixfmt")
862 (version "1.1.0")
863 (source
864 (origin
865 (method git-fetch)
866 (uri
867 (git-reference
868 (url "https://github.com/NixOS/nixfmt")
869 (commit (string-append "v" version))))
870 (sha256
871 (base32 "19sydkdw1579qmvzx0zq06s23bm6m6l9wp1kvsfhxawk8pkz2pc2"))
872 (snippet
873 #~(substitute* "nixfmt.cabal"
874 (("(megaparsec|filepath) *[0-9<>=^&|. ]*" _ package)
875 package)))
876 (modules '((guix build utils)))))
877 (build-system haskell-build-system)
878 (inputs (list ghc-megaparsec
879 ghc-parser-combinators
880 ghc-scientific
881 ghc-pretty-simple
882 ghc-cmdargs
883 ghc-file-embed
884 ghc-safe-exceptions))
885 (home-page "https://github.com/NixOS/nixfmt")
886 (synopsis "Official formatter for Nix code")
887 (description
888 "Nixfmt is a formatter for Nix that ensures consistent and clear
889formatting by forgetting all existing formatting during parsing.")
890 (license license:mpl2.0)))
891
892(define-public ormolu
893 (package
894 (name "ormolu")
895 (version "0.8.0.2")
896 (source
897 (origin
898 (method url-fetch)
899 (uri (hackage-uri "ormolu" version))
900 (sha256
901 (base32 "1fh2m4sy8vzxvm1qm9413apzblqf4sla3454mx64ngkwx0pgi2ad"))
902 (patches (search-patches "ormolu-support-cabal-syntax-3.12.patch"))))
903 (build-system haskell-build-system)
904 (properties '((upstream-name . "ormolu")))
905 (inputs (list ghc-cabal-syntax
906 ghc-diff
907 ghc-lib-parser
908 ghc-memotrie
909 ghc-ansi-terminal
910 ghc-choice
911 ghc-file-embed
912 ghc-lib-parser
913 ghc-megaparsec
914 ghc-syb
915 ghc-optparse-applicative
916 ghc-th-env
917 ghc-unliftio))
918 (native-inputs (list ghc-quickcheck
919 ghc-hspec
920 ghc-hspec-megaparsec
921 ghc-path
922 ghc-path-io
923 ghc-temporary
924 hspec-discover))
925 (home-page "https://github.com/tweag/ormolu")
926 (synopsis "Formatter for Haskell source code")
927 (description "This package provides a formatter for Haskell source code.")
928 (license license:bsd-3)))
929
930(define-public greenclip
931 (package
932 (name "greenclip")
933 (version "4.2")
934 (source
935 (origin
936 (method git-fetch)
937 (uri (git-reference
938 (url "https://github.com/erebe/greenclip")
939 (commit (string-append "v" version))))
940 (file-name (git-file-name name version))
941 (sha256
942 (base32 "10r485q055ci29fmpsjy55n1yqfil53cvdxldlzw2n6mpynmckyv"))))
943 (build-system haskell-build-system)
944 (native-inputs
945 (list pkg-config))
946 (inputs
947 (list libx11
948 libxext
949 libxscrnsaver
950 ghc-x11
951 ghc-exceptions
952 ghc-hashable
953 ghc-microlens
954 ghc-microlens-mtl
955 ghc-protolude
956 ghc-tomland
957 ghc-vector
958 ghc-wordexp))
959 (home-page "https://github.com/erebe/greenclip")
960 (synopsis "Simple Clipboard manager")
961 (description "@code{greenclip} is a clipboard manager written in
962Haskell.")
963 (license license:bsd-3)))
964
965(define-public raincat
966 (package
967 (name "raincat")
968 (version "1.2.1")
969 (source
970 (origin
971 (method url-fetch)
972 (uri (hackage-uri "Raincat" version))
973 (sha256
974 (base32
975 "10y9zi22m6hf13c9h8zd9vg7mljpwbw0r3djb6r80bna701fdf6c"))))
976 (build-system haskell-build-system)
977 (properties '((upstream-name . "Raincat")))
978 (arguments
979 `(#:phases
980 (modify-phases %standard-phases
981 (add-after 'install 'wrap-executable
982 (lambda* (#:key inputs outputs #:allow-other-keys)
983 (let ((out (assoc-ref outputs "out")))
984 (wrap-program (string-append out "/bin/raincat")
985 `("LD_LIBRARY_PATH" ":" =
986 (,(string-append (assoc-ref inputs "freeglut")
987 "/lib"))))
988 #t))))))
989 (inputs
990 (list bash-minimal
991 ghc-extensible-exceptions
992 ghc-random
993 ghc-glut
994 freeglut
995 ghc-opengl
996 ghc-sdl2
997 ghc-sdl2-image
998 ghc-sdl2-mixer))
999 (home-page "https://www.gamecreation.org/games/raincat")
1000 (synopsis "Puzzle game with a cat in lead role")
1001 (description "Project Raincat is a game developed by Carnegie Mellon
1002students through GCS during the Fall 2008 semester. Raincat features game
1003play inspired from classics Lemmings and The Incredible Machine. The project
1004proved to be an excellent learning experience for the programmers. Everything
1005is programmed in Haskell.")
1006 (license license:bsd-3)))
1007
1008(define-public scroll
1009 (package
1010 (name "scroll")
1011 (version "1.20250228.2")
1012 (source
1013 (origin
1014 (method url-fetch)
1015 (uri (hackage-uri "scroll" version))
1016 (sha256
1017 (base32
1018 "1p1741zqsxg017d08ym1clzqcdlai487wb6q12m1q7dr6i8c0gfj"))))
1019 (build-system haskell-build-system)
1020 (properties '((upstream-name . "scroll")
1021 (updater-extra-inputs "ghc-base-compat")))
1022 (inputs
1023 (list ghc-base-compat
1024 ghc-case-insensitive
1025 ghc-data-default
1026 ghc-ifelse
1027 ghc-monad-loops
1028 ghc-ncurses
1029 ghc-optparse-applicative
1030 ghc-random
1031 ghc-vector))
1032 (home-page "https://joeyh.name/code/scroll/")
1033 (synopsis "Roguelike game")
1034 (description
1035 "You're a bookworm that's stuck on a scroll. You have to dodge between
1036words and use spells to make your way down the page as the scroll is read. Go
1037too slow and you'll get wound up in the scroll and crushed.")
1038 (license license:gpl2)))
1039
1040(define-public shellcheck
1041 (package
1042 (name "shellcheck")
1043 (version "0.10.0")
1044 (source
1045 (origin
1046 (method url-fetch)
1047 (uri (hackage-uri "ShellCheck" version))
1048 (sha256
1049 (base32 "08bdjcdl457xz2vh8y2w29bcwh1k7sfzyvszln3498vm5m1xn22d"))
1050 (file-name (string-append name "-" version ".tar.gz"))))
1051 (build-system haskell-build-system)
1052 (arguments
1053 (list #:haddock? #f ; TODO: Fails to build.
1054 #:cabal-revision '("1" "1935jrzy1r3g9cc74b330fmxnz2i1j8hsdk9jnl557qgk6xjqzs7")
1055 #:phases
1056 #~(modify-phases %standard-phases
1057 (add-after 'build 'build-man-page
1058 (lambda _
1059 (chmod "manpage" #o555)
1060 (invoke "./manpage")))
1061 (add-after 'install 'install-man-page
1062 (lambda* (#:key outputs #:allow-other-keys)
1063 (install-file "shellcheck.1"
1064 (string-append #$output
1065 "/share/man/man1/"))))
1066 (add-after 'register 'remove-libraries
1067 (lambda* (#:key outputs #:allow-other-keys)
1068 (delete-file-recursively (string-append #$output "/lib")))))))
1069 (native-inputs
1070 (list pandoc))
1071 (inputs
1072 (list ghc-aeson ghc-diff ghc-fgl ghc-quickcheck ghc-regex-tdfa))
1073 (home-page "https://www.shellcheck.net/")
1074 (synopsis "Static analysis for shell scripts")
1075 (description "@code{shellcheck} provides static analysis for
1076@command{bash} and @command{sh} shell scripts.
1077It gives warnings and suggestions in order to:
1078
1079@enumerate
1080@item Point out and clarify typical beginner's syntax issues that cause
1081a shell to give cryptic error messages.
1082@item Point out and clarify typical intermediate level semantic problems
1083that cause a shell to behave strangely and counter-intuitively.
1084@item Point out subtle caveats, corner cases and pitfalls that may cause an
1085advanced user's otherwise working script to fail under future circumstances.
1086@end enumerate")
1087 ;; CVE-2021-28794 is for a completely different, unofficial add-on.
1088 (properties `((lint-hidden-cve . ("CVE-2021-28794")) (upstream-name . "ShellCheck")))
1089 (license license:gpl3+)))
1090
1091(define-public shelltestrunner
1092 (package
1093 (name "shelltestrunner")
1094 (version "1.10")
1095 (source
1096 (origin
1097 (method url-fetch)
1098 (uri (hackage-uri "shelltestrunner" version))
1099 (sha256
1100 (base32 "1c6bjyxqa4mgnh3w4pqp6sbr5cf160n7jf9i1b4b9sdxzdjk7g87"))))
1101 (build-system haskell-build-system)
1102 (properties '((upstream-name . "shelltestrunner")))
1103 (arguments
1104 '(#:phases
1105 (modify-phases %standard-phases
1106 (delete 'check)
1107 (add-after 'install 'check
1108 (lambda* (#:key outputs tests? parallel-tests? #:allow-other-keys)
1109 ;; This test is inspired by the Makefile in the upstream
1110 ;; repository, which is missing in the Hackage release tarball
1111 ;; along with some of the tests. The Makefile would not work
1112 ;; anyway as it ties into the 'stack' build tool.
1113 (let* ((out (assoc-ref outputs "out"))
1114 (shelltest (string-append out "/bin/shelltest"))
1115 (numjobs (if parallel-tests?
1116 (number->string (parallel-job-count))
1117 "1")))
1118 (if tests?
1119 (invoke shelltest (string-append "-j" numjobs)
1120 "tests/examples")
1121 (format #t "test suite not run~%"))
1122 #t))))))
1123 (inputs (list ghc-diff
1124 ghc-filemanip
1125 ghc-hunit
1126 ghc-cmdargs
1127 ghc-pretty-show
1128 ghc-regex-tdfa
1129 ghc-safe
1130 ghc-test-framework
1131 ghc-test-framework-hunit
1132 ghc-utf8-string
1133 ghc-hspec
1134 ghc-hspec-core
1135 ghc-hspec-contrib))
1136 (home-page "https://github.com/simonmichael/shelltestrunner")
1137 (synopsis "Test CLI programs")
1138 (description
1139 "shelltestrunner (executable: @command{shelltest}) is a command-line tool
1140for testing command-line programs, or general shell commands. It reads simple
1141test specifications defining a command to run, some input, and the expected
1142output, stderr, and exit status.")
1143 (license license:gpl3+)))
1144
1145(define-public stylish-haskell
1146 (package
1147 (name "stylish-haskell")
1148 (version "0.15.1.0")
1149 (source
1150 (origin
1151 (method url-fetch)
1152 (uri (hackage-uri "stylish-haskell" version))
1153 (sha256
1154 (base32 "06y6f7bv5j5k7q81194v9jqcbmmqcv7h8ii3lq1783bpfnyd6h19"))))
1155 (build-system haskell-build-system)
1156 (properties '((upstream-name . "stylish-haskell")))
1157 (inputs (list ghc-aeson
1158 ghc-file-embed
1159 ghc-regex-tdfa
1160 ghc-syb
1161 ghc-hsyaml-aeson
1162 ghc-hsyaml
1163 ghc-semigroups
1164 ghc-lib-parser
1165 ghc-lib-parser-ex
1166 ghc-strict
1167 ghc-optparse-applicative))
1168 (native-inputs (list ghc-hunit ghc-random ghc-test-framework
1169 ghc-test-framework-hunit))
1170 (home-page "https://github.com/haskell/stylish-haskell")
1171 (synopsis "Haskell code prettifier")
1172 (description
1173 "Stylish-haskell is a Haskell code prettifier. The goal is
1174not to format all of the code in a file, to avoid \"getting in the way\".
1175However, this tool can e.g. clean up import statements and help doing various
1176tasks that get tedious very quickly. It can
1177@itemize
1178@item
1179Align and sort @code{import} statements
1180@item
1181Group and wrap @code{{-# LANGUAGE #-}} pragmas, remove (some) redundant
1182pragmas
1183@item
1184Remove trailing whitespaces
1185@item
1186Align branches in @code{case} and fields in records
1187@item
1188Convert line endings (customisable)
1189@item
1190Replace tabs by four spaces (turned off by default)
1191@item
1192Replace some ASCII sequences by their Unicode equivalent (turned off by
1193default)
1194@end itemize")
1195 (license license:bsd-3)))