Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / haskell-apps.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2017, 2018 ng0 <ng0@n0.is>
4 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018 Timothy Sample <samplet@ngyro.com>
6 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
7 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages haskell-apps)
26 #:use-module (guix download)
27 #:use-module (guix packages)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix build-system haskell)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages curl)
32 #:use-module (gnu packages gl)
33 #:use-module (gnu packages haskell)
34 #:use-module (gnu packages haskell-check)
35 #:use-module (gnu packages haskell-crypto)
36 #:use-module (gnu packages haskell-web)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages rsync)
41 #:use-module (gnu packages sdl)
42 #:use-module (gnu packages version-control))
43
44 ;; Darcs has no https support: http://irclog.perlgeek.de/darcs/2016-09-17
45 ;; http://darcs.net/manual/Configuring_darcs.html#SECTION00440070000000000000
46 ;; and results of search engines will show that if the protocol is http, https
47 ;; is never mentioned.
48 (define-public darcs
49 (package
50 (name "darcs")
51 (version "2.14.2")
52 (source
53 (origin
54 (method url-fetch)
55 (uri (string-append "https://hackage.haskell.org/package/darcs/"
56 "darcs-" version ".tar.gz"))
57 (sha256
58 (base32
59 "0zm2486gyhiga1amclbg92cd09bvki6vgh0ll75hv5kl72j61lb5"))
60 (modules '((guix build utils)))
61 ;; Remove time-dependent code for reproducibility.
62 (snippet
63 '(begin
64 (substitute* "darcs/darcs.hs"
65 (("__DATE__") "\"1970-01-01\"")
66 (("__TIME__") "\"00:00:00\""))
67 #t))))
68 (build-system haskell-build-system)
69 (arguments
70 `(#:configure-flags '("-fpkgconfig" "-fcurl" "-flibiconv" "-fthreaded"
71 "-fnetwork-uri" "-fhttp" "--flag=executable"
72 "--flag=library")
73 #:phases
74 (modify-phases %standard-phases
75 (add-after 'patch-source-shebangs 'patch-sh
76 (lambda _
77 (substitute* "tests/issue538.sh"
78 (("/bin/sh") (which "sh")))
79 #t)))))
80 (inputs
81 `(("ghc-cmdargs" ,ghc-cmdargs)
82 ("ghc-split" ,ghc-split)
83 ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)
84 ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
85 ("ghc-test-framework" ,ghc-test-framework)
86 ("ghc-quickcheck" ,ghc-quickcheck)
87 ("ghc-findbin" ,ghc-findbin)
88 ("ghc-hunit" ,ghc-hunit)
89 ("ghc-async" ,ghc-async)
90 ("ghc-attoparsec" ,ghc-attoparsec)
91 ("ghc-base16-bytestring" ,ghc-base16-bytestring)
92 ("ghc-bytestring-builder" ,ghc-bytestring-builder)
93 ("ghc-cryptohash" ,ghc-cryptohash)
94 ("ghc-data-ordlist" ,ghc-data-ordlist)
95 ("ghc-fgl" ,ghc-fgl)
96 ("ghc-system-filepath" ,ghc-system-filepath)
97 ("ghc-graphviz" ,ghc-graphviz)
98 ("ghc-hashable" ,ghc-hashable)
99 ("ghc-html" ,ghc-html)
100 ("ghc-mmap" ,ghc-mmap)
101 ("ghc-old-time" ,ghc-old-time)
102 ("ghc-random" ,ghc-random)
103 ("ghc-regex-applicative" ,ghc-regex-applicative)
104 ("ghc-regex-compat-tdfa" ,ghc-regex-compat-tdfa)
105 ("ghc-sandi" ,ghc-sandi)
106 ("ghc-shelly" ,ghc-shelly)
107 ("ghc-tar" ,ghc-tar)
108 ("ghc-transformers-compat" ,ghc-transformers-compat)
109 ("ghc-unix-compat" ,ghc-unix-compat)
110 ("ghc-utf8-string" ,ghc-utf8-string)
111 ("ghc-vector" ,ghc-vector)
112 ("ghc-zip-archive" ,ghc-zip-archive)
113 ("ghc-zlib" ,ghc-zlib)
114 ("ghc-http" ,ghc-http)
115 ("curl" ,curl)
116 ("ghc" ,ghc)
117 ("ncurses" ,ncurses)
118 ("perl" ,perl)
119 ("libiconv" ,libiconv)
120 ("ghc-network" ,ghc-network)
121 ("ghc-network-uri" ,ghc-network-uri)))
122 (native-inputs
123 `(("pkg-config" ,pkg-config)))
124 (home-page "http://darcs.net")
125 (synopsis "Distributed Revision Control System")
126 (description
127 "Darcs is a revision control system. It is:
128
129 @enumerate
130 @item Distributed: Every user has access to the full command set, removing boundaries
131 between server and client or committer and non-committers.
132 @item Interactive: Darcs is easy to learn and efficient to use because it asks you
133 questions in response to simple commands, giving you choices in your work flow.
134 You can choose to record one change in a file, while ignoring another. As you update
135 from upstream, you can review each patch name, even the full diff for interesting
136 patches.
137 @item Smart: Originally developed by physicist David Roundy, darcs is based on a
138 unique algebra of patches called @url{http://darcs.net/Theory,Patchtheory}.
139 @end enumerate")
140 (license license:gpl2)))
141
142 (define-public git-annex
143 (package
144 (name "git-annex")
145 (version "6.20180926")
146 (source
147 (origin
148 (method url-fetch)
149 (uri (string-append "https://hackage.haskell.org/package/"
150 "git-annex/git-annex-" version ".tar.gz"))
151 (sha256
152 (base32
153 "1251rj8h63y30sfqk0zh670yhz14p256y59n3590pg015pf3575d"))))
154 (build-system haskell-build-system)
155 (arguments
156 `(#:configure-flags
157 '("--flags=-Android -Assistant -Pairing -S3 -Webapp -WebDAV")
158 #:phases
159 (modify-phases %standard-phases
160 (add-before 'configure 'patch-shell
161 (lambda _
162 (substitute* "Utility/Shell.hs"
163 (("/bin/sh") (which "sh")))
164 #t))
165 (add-before 'configure 'factor-setup
166 (lambda _
167 ;; Factor out necessary build logic from the provided
168 ;; `Setup.hs' script. The script as-is does not work because
169 ;; it cannot find its dependencies, and there is no obvious way
170 ;; to tell it where to look. Note that we do not preserve the
171 ;; code that installs man pages here.
172 (call-with-output-file "PreConf.hs"
173 (lambda (out)
174 (format out "import qualified Build.Configure as Configure~%")
175 (format out "main = Configure.run Configure.tests~%")))
176 (call-with-output-file "Setup.hs"
177 (lambda (out)
178 (format out "import Distribution.Simple~%")
179 (format out "main = defaultMain~%")))
180 #t))
181 (add-before 'configure 'pre-configure
182 (lambda _
183 (invoke "runhaskell" "PreConf.hs")
184 #t))
185 (replace 'check
186 (lambda _
187 ;; We need to set the path so that Git recognizes
188 ;; `git annex' as a custom command.
189 (setenv "PATH" (string-append (getenv "PATH") ":"
190 (getcwd) "/dist/build/git-annex"))
191 (with-directory-excursion "dist/build/git-annex"
192 (symlink "git-annex" "git-annex-shell"))
193 (invoke "git-annex" "test")
194 #t))
195 (add-after 'install 'install-symlinks
196 (lambda* (#:key outputs #:allow-other-keys)
197 (let* ((out (assoc-ref outputs "out"))
198 (bin (string-append out "/bin")))
199 (symlink (string-append bin "/git-annex")
200 (string-append bin "/git-annex-shell"))
201 (symlink (string-append bin "/git-annex")
202 (string-append bin "/git-remote-tor-annex"))
203 #t))))))
204 (inputs
205 `(("curl" ,curl)
206 ("ghc-aeson" ,ghc-aeson)
207 ("ghc-async" ,ghc-async)
208 ("ghc-bloomfilter" ,ghc-bloomfilter)
209 ("ghc-byteable" ,ghc-byteable)
210 ("ghc-case-insensitive" ,ghc-case-insensitive)
211 ("ghc-crypto-api" ,ghc-crypto-api)
212 ("ghc-cryptonite" ,ghc-cryptonite)
213 ("ghc-data-default" ,ghc-data-default)
214 ("ghc-disk-free-space" ,ghc-disk-free-space)
215 ("ghc-dlist" ,ghc-dlist)
216 ("ghc-edit-distance" ,ghc-edit-distance)
217 ("ghc-esqueleto" ,ghc-esqueleto)
218 ("ghc-exceptions" ,ghc-exceptions)
219 ("ghc-feed" ,ghc-feed)
220 ("ghc-free" ,ghc-free)
221 ("ghc-hslogger" ,ghc-hslogger)
222 ("ghc-http-client" ,ghc-http-client)
223 ("ghc-http-conduit" ,ghc-http-conduit)
224 ("ghc-http-types" ,ghc-http-types)
225 ("ghc-ifelse" ,ghc-ifelse)
226 ("ghc-memory" ,ghc-memory)
227 ("ghc-monad-control" ,ghc-monad-control)
228 ("ghc-monad-logger" ,ghc-monad-logger)
229 ("ghc-network" ,ghc-network)
230 ("ghc-old-locale" ,ghc-old-locale)
231 ("ghc-optparse-applicative" ,ghc-optparse-applicative)
232 ("ghc-persistent" ,ghc-persistent)
233 ("ghc-persistent-sqlite" ,ghc-persistent-sqlite)
234 ("ghc-persistent-template" ,ghc-persistent-template)
235 ("ghc-quickcheck" ,ghc-quickcheck)
236 ("ghc-random" ,ghc-random)
237 ("ghc-regex-tdfa" ,ghc-regex-tdfa)
238 ("ghc-resourcet" ,ghc-resourcet)
239 ("ghc-safesemaphore" ,ghc-safesemaphore)
240 ("ghc-sandi" ,ghc-sandi)
241 ("ghc-securemem" ,ghc-securemem)
242 ("ghc-socks" ,ghc-socks)
243 ("ghc-split" ,ghc-split)
244 ("ghc-stm-chans" ,ghc-stm-chans)
245 ("ghc-tagsoup" ,ghc-tagsoup)
246 ("ghc-unix-compat" ,ghc-unix-compat)
247 ("ghc-unordered-containers" ,ghc-unordered-containers)
248 ("ghc-utf8-string" ,ghc-utf8-string)
249 ("ghc-uuid" ,ghc-uuid)
250 ("git" ,git)
251 ("rsync" ,rsync)))
252 (native-inputs
253 `(("ghc-tasty" ,ghc-tasty)
254 ("ghc-tasty-hunit" ,ghc-tasty-hunit)
255 ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)
256 ("ghc-tasty-rerun" ,ghc-tasty-rerun)))
257 (home-page "https://git-annex.branchable.com/")
258 (synopsis "Manage files with Git, without checking in their contents")
259 (description "This package allows managing files with Git, without
260 checking the file contents into Git. It can store files in many places,
261 such as local hard drives and cloud storage services. It can also be
262 used to keep a folder in sync between computers.")
263 ;; The web app is released under the AGPLv3+.
264 (license (list license:gpl3+
265 license:agpl3+))))
266
267 (define-public ghc-sdl2
268 (package
269 (name "ghc-sdl2")
270 (version "2.4.1.0")
271 (source
272 (origin
273 (method url-fetch)
274 (uri (string-append "https://hackage.haskell.org/package/"
275 "sdl2/sdl2-" version ".tar.gz"))
276 (sha256
277 (base32
278 "0p4b12fmxps0sbnkqdfy0qw19s355yrkw7fgw6xz53wzq706k991"))))
279 (build-system haskell-build-system)
280 (arguments '(#:tests? #f)) ; tests require graphical environment
281 (inputs
282 `(("ghc-exceptions" ,ghc-exceptions)
283 ("ghc-linear" ,ghc-linear)
284 ("ghc-statevar" ,ghc-statevar)
285 ("ghc-vector" ,ghc-vector)
286 ("sdl2" ,sdl2)))
287 (native-inputs
288 `(("ghc-weigh" ,ghc-weigh)
289 ("pkg-config" ,pkg-config)))
290 (home-page "http://hackage.haskell.org/package/sdl2")
291 (synopsis "High- and low-level bindings to the SDL library")
292 (description
293 "This package contains bindings to the SDL 2 library, in both high- and
294 low-level forms. The @code{SDL} namespace contains high-level bindings, where
295 enumerations are split into sum types, and we perform automatic
296 error-checking. The @code{SDL.Raw} namespace contains an almost 1-1
297 translation of the C API into Haskell FFI calls. As such, this does not
298 contain sum types nor error checking. Thus this namespace is suitable for
299 building your own abstraction over SDL, but is not recommended for day-to-day
300 programming.")
301 (license license:bsd-3)))
302
303 (define-public ghc-sdl2-mixer
304 (package
305 (name "ghc-sdl2-mixer")
306 (version "1.1.0")
307 (source
308 (origin
309 (method url-fetch)
310 (uri (string-append "https://hackage.haskell.org/package/sdl2-mixer/"
311 "sdl2-mixer-" version ".tar.gz"))
312 (sha256
313 (base32
314 "1k8avyccq5l9z7bwxigim312yaancxl1sr3q6a96bcm7pnhiak0g"))))
315 (build-system haskell-build-system)
316 (inputs
317 `(("ghc-data-default-class" ,ghc-data-default-class)
318 ("ghc-lifted-base" ,ghc-lifted-base)
319 ("ghc-monad-control" ,ghc-monad-control)
320 ("ghc-sdl2" ,ghc-sdl2)
321 ("ghc-vector" ,ghc-vector)
322 ("sdl2-mixer" ,sdl2-mixer)))
323 (native-inputs
324 `(("pkg-config" ,pkg-config)))
325 (home-page "http://hackage.haskell.org/package/sdl2-mixer")
326 (synopsis "Bindings to SDL2 mixer")
327 (description "This package provides Haskell bindings to
328 @code{SDL2_mixer}.")
329 (license license:bsd-3)))
330
331 (define-public ghc-sdl2-image
332 (package
333 (name "ghc-sdl2-image")
334 (version "2.0.0")
335 (source
336 (origin
337 (method url-fetch)
338 (uri (string-append "https://hackage.haskell.org/package/sdl2-image/"
339 "sdl2-image-" version ".tar.gz"))
340 (sha256
341 (base32
342 "1pr6dkg73cy9z0w54lrkj9c5bhxj56nl92lxikjy8kz6nyr455rr"))))
343 (build-system haskell-build-system)
344 (inputs
345 `(("ghc-sdl2" ,ghc-sdl2)
346 ("sdl2-image" ,sdl2-image)))
347 (native-inputs
348 `(("pkg-config" ,pkg-config)))
349 (home-page "http://hackage.haskell.org/package/sdl2-image")
350 (synopsis "Bindings to SDL2_image")
351 (description "This package provides Haskell bindings to
352 @code{SDL2_image}.")
353 (license license:expat)))
354
355 (define-public raincat
356 (package
357 (name "raincat")
358 (version "1.2.1")
359 (source
360 (origin
361 (method url-fetch)
362 (uri (string-append "http://hackage.haskell.org/package/Raincat/"
363 "Raincat-" version ".tar.gz"))
364 (sha256
365 (base32
366 "10y9zi22m6hf13c9h8zd9vg7mljpwbw0r3djb6r80bna701fdf6c"))))
367 (build-system haskell-build-system)
368 (arguments
369 `(#:phases
370 (modify-phases %standard-phases
371 (add-after 'install 'wrap-executable
372 (lambda* (#:key inputs outputs #:allow-other-keys)
373 (let ((out (assoc-ref outputs "out")))
374 (wrap-program (string-append out "/bin/raincat")
375 `("LD_LIBRARY_PATH" ":" =
376 (,(string-append (assoc-ref inputs "freeglut")
377 "/lib"))))
378 #t))))))
379 (inputs
380 `(("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
381 ("ghc-random" ,ghc-random)
382 ("ghc-glut" ,ghc-glut)
383 ("freeglut" ,freeglut)
384 ("ghc-opengl" ,ghc-opengl)
385 ("ghc-sdl2" ,ghc-sdl2)
386 ("ghc-sdl2-image" ,ghc-sdl2-image)
387 ("ghc-sdl2-mixer" ,ghc-sdl2-mixer)))
388 (home-page "http://www.bysusanlin.com/raincat/")
389 (synopsis "Puzzle game with a cat in lead role")
390 (description "Project Raincat is a game developed by Carnegie Mellon
391 students through GCS during the Fall 2008 semester. Raincat features game
392 play inspired from classics Lemmings and The Incredible Machine. The project
393 proved to be an excellent learning experience for the programmers. Everything
394 is programmed in Haskell.")
395 (license license:bsd-3)))