2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
haskellPackages.mkDerivation rec {
|
|
|
|
|
|
|
|
pname = "carp";
|
2021-02-19 19:06:45 +00:00
|
|
|
version = "0.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "carp-lang";
|
|
|
|
repo = "Carp";
|
|
|
|
rev = "v${version}";
|
2021-02-19 19:06:45 +00:00
|
|
|
sha256 = "sha256-nTSMY8bq0b/JvE/XQGDC4St2sqdni12E5WQU5FXnuCg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
buildTools = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
executableHaskellDepends = with haskellPackages; [
|
2021-02-19 19:06:45 +00:00
|
|
|
HUnit blaze-markup blaze-html split ansi-terminal cmark
|
|
|
|
edit-distance hashable open-browser optparse-applicative
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
isExecutable = true;
|
|
|
|
|
|
|
|
# The carp executable must know where to find its core libraries and other
|
|
|
|
# files. Set the environment variable CARP_DIR so that it points to the root
|
|
|
|
# of the Carp repo. See:
|
|
|
|
# https://github.com/carp-lang/Carp/blob/master/docs/Install.md#setting-the-carp_dir
|
|
|
|
#
|
|
|
|
# Also, clang must be available run-time because carp is compiled to C which
|
|
|
|
# is then compiled with clang.
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/carp \
|
|
|
|
--set CARP_DIR $src \
|
|
|
|
--prefix PATH : ${clang}/bin
|
|
|
|
wrapProgram $out/bin/carp-header-parse \
|
|
|
|
--set CARP_DIR $src \
|
|
|
|
--prefix PATH : ${clang}/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
description = "A statically typed lisp, without a GC, for real-time applications";
|
|
|
|
homepage = "https://github.com/carp-lang/Carp";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ jluttine ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Windows not (yet) supported.
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = with lib.platforms; unix ++ darwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
}
|