1{ stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
2
3haskellPackages.mkDerivation rec {
4
5 pname = "carp";
6 version = "0.3.0";
7
8 src = fetchFromGitHub {
9 owner = "carp-lang";
10 repo = "Carp";
11 rev = "v${version}";
12 sha256 = "07yk3gy4l6h3k7sh8al7lgwk75a13zxwfp7siqpb5gnnqr1z3brc";
13 };
14
15 buildDepends = [ makeWrapper ];
16
17 executableHaskellDepends = with haskellPackages; [
18 HUnit blaze-markup blaze-html split cmdargs ansi-terminal cmark
19 edit-distance
20 ];
21
22 isExecutable = true;
23
24 # The carp executable must know where to find its core libraries and other
25 # files. Set the environment variable CARP_DIR so that it points to the root
26 # of the Carp repo. See:
27 # https://github.com/carp-lang/Carp/blob/master/docs/Install.md#setting-the-carp_dir
28 #
29 # Also, clang must be available run-time because carp is compiled to C which
30 # is then compiled with clang.
31 postInstall = ''
32 wrapProgram $out/bin/carp \
33 --set CARP_DIR $src \
34 --prefix PATH : ${clang}/bin
35 wrapProgram $out/bin/carp-header-parse \
36 --set CARP_DIR $src \
37 --prefix PATH : ${clang}/bin
38 '';
39
40 description = "A statically typed lisp, without a GC, for real-time applications";
41 homepage = https://github.com/carp-lang/Carp;
42 license = stdenv.lib.licenses.asl20;
43 maintainers = with stdenv.lib.maintainers; [ jluttine ];
44
45 # Windows not (yet) supported.
46 platforms = with stdenv.lib.platforms; unix ++ darwin;
47
48}