1 { stdenv, pkgsHostTarget, cmake, makeWrapper, mkDerivation, fetchFromGitHub
2 , alex, array, base, bytestring, cond, containers, directory, extra
3 , filepath, hpack, hspec, hspec-core, isocline, json, lib, mtl
4 , parsec, process, regex-compat, text, time }:
8 src = fetchFromGitHub {
12 sha256 = "sha256-+evs5g0qrplUMr8zC51GvUx2JXQBYJb39IaI4rC6CSA=";
13 fetchSubmodules = true;
15 kklib = stdenv.mkDerivation {
19 patches = [ ./kklib-mimalloc-macos-fix.diff ];
20 nativeBuildInputs = [ cmake ];
21 outputs = [ "out" "dev" ];
23 mkdir -p ''${!outputDev}/share/koka/v${version}
24 cp -a ../../kklib ''${!outputDev}/share/koka/v${version}
27 inherit (pkgsHostTarget.targetPackages.stdenv) cc;
31 pkgsHostTarget.gnumake
40 libraryToolDepends = [ hpack ];
41 executableHaskellDepends = [
42 array base bytestring cond containers directory isocline mtl
43 parsec process text time kklib
45 executableToolDepends = [ alex makeWrapper ];
47 mkdir -p $out/share/koka/v${version}
48 cp -a lib $out/share/koka/v${version}
49 ln -s ${kklib.dev}/share/koka/v${version}/kklib $out/share/koka/v${version}
50 wrapProgram "$out/bin/koka" \
51 --set CC "${lib.getBin cc}/bin/${cc.targetPrefix}cc" \
52 --prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}"
56 description = "Koka language compiler and interpreter";
57 homepage = "https://github.com/koka-lang/koka";
58 changelog = "${homepage}/blob/master/doc/spec/news.mdk";
59 license = lib.licenses.asl20;
60 maintainers = with lib.maintainers; [ siraben sternenseemann ];