2023-01-11 07:51:40 +00:00
|
|
|
{ lib, fetchFromGitHub, fetchpatch, makeWrapper, clang, haskellPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
haskellPackages.mkDerivation rec {
|
|
|
|
pname = "carp";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.5.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "carp-lang";
|
|
|
|
repo = "Carp";
|
|
|
|
rev = "v${version}";
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "sha256-B7SBzjegFzL2gGivIJE6BZcLD3f0Bsh8yndjScG2TZI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
# Compat with GHC 9.2 / Stackage LTS 20, can be dropped at the next release
|
|
|
|
# https://github.com/carp-lang/Carp/pull/1449
|
|
|
|
(fetchpatch {
|
|
|
|
name = "carp-lts-20.patch";
|
|
|
|
url = "https://github.com/carp-lang/Carp/commit/25f50c92a57cc91b6cb4ec48df658439f936b641.patch";
|
|
|
|
sha256 = "14yjv0hcvw1qyjmrhksrj6chac3n14d1f1gcaxldfa05llrbfqk0";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
# -Werror breaks build with GHC >= 9.0
|
|
|
|
# https://github.com/carp-lang/Carp/issues/1386
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CarpHask.cabal --replace "-Werror" ""
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Statically typed lisp, without a GC, for real-time applications";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/carp-lang/Carp";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ jluttine ];
|
2024-04-21 15:54:59 +00:00
|
|
|
# Not actively maintained at the moment
|
|
|
|
broken = true;
|
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
|
|
|
}
|