nixpkgs/pkgs/development/compilers/carp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
2018-09-17 07:30:05 +02:00
2019-11-23 17:10:17 +01:00
haskellPackages.mkDerivation rec {
2018-09-17 07:30:05 +02:00
pname = "carp";
2022-07-08 06:57:18 +02:00
version = "0.5.5";
2018-09-17 07:30:05 +02:00
src = fetchFromGitHub {
owner = "carp-lang";
repo = "Carp";
rev = "v${version}";
2022-07-08 06:57:18 +02:00
sha256 = "sha256-B7SBzjegFzL2gGivIJE6BZcLD3f0Bsh8yndjScG2TZI=";
2018-09-17 07:30:05 +02: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 18:51:52 +01:00
buildTools = [ makeWrapper ];
2018-09-17 07:30:05 +02:00
executableHaskellDepends = with haskellPackages; [
2021-02-19 18:51:52 +01:00
HUnit blaze-markup blaze-html split ansi-terminal cmark
edit-distance hashable open-browser optparse-applicative
2018-09-17 07:30:05 +02: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";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jluttine ];
2018-09-17 07:30:05 +02:00
# Windows not (yet) supported.
platforms = with lib.platforms; unix ++ darwin;
2018-09-17 07:30:05 +02:00
}