Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / compilers / koka / default.nix
blob087b0ad1153b2920f673205b27d1ebaaa3235bca
1 { stdenv, buildPackages, cmake, gnumake, makeWrapper, mkDerivation, fetchFromGitHub
2 , alex, array, base, bytestring, cond, containers, directory, extra
3 , filepath, haskeline, hpack, hspec, hspec-core, json, lib, mtl
4 , parsec, process, regex-compat, text, time }:
6 let
7   version = "2.1.1";
8   src = fetchFromGitHub {
9     owner = "koka-lang";
10     repo = "koka";
11     rev = "v${version}";
12     sha256 = "sha256-cq+dljfTKJh5NgwQfxQQP9jRcg2PQxxBVEgQ59ll36o=";
13     fetchSubmodules = true;
14   };
15   kklib = stdenv.mkDerivation {
16     pname = "kklib";
17     inherit version;
18     src = "${src}/kklib";
19     nativeBuildInputs = [ cmake ];
20   };
21   runtimeDeps = [
22     buildPackages.stdenv.cc
23     buildPackages.stdenv.cc.bintools.bintools
24     gnumake
25     cmake
26   ];
28 mkDerivation rec {
29   pname = "koka";
30   inherit version src;
31   isLibrary = false;
32   isExecutable = true;
33   libraryToolDepends = [ hpack ];
34   executableHaskellDepends = [
35     array base bytestring cond containers directory haskeline mtl
36     parsec process text time kklib
37   ];
38   executableToolDepends = [ alex makeWrapper ];
39   postInstall = ''
40     mkdir -p $out/share/koka/v${version}
41     cp -a lib $out/share/koka/v${version}
42     cp -a contrib $out/share/koka/v${version}
43     cp -a kklib $out/share/koka/v${version}
44     wrapProgram "$out/bin/koka" \
45       --set CC "${lib.getBin buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" \
46       --prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}"
47   '';
48   doCheck = false;
49   prePatch = "hpack";
50   description = "Koka language compiler and interpreter";
51   homepage = "https://github.com/koka-lang/koka";
52   license = lib.licenses.asl20;
53   maintainers = with lib.maintainers; [ siraben sternenseemann ];