at 23.11-beta 60 lines 1.9 kB view raw
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 }: 5 6let 7 version = "2.4.2"; 8 src = fetchFromGitHub { 9 owner = "koka-lang"; 10 repo = "koka"; 11 rev = "v${version}"; 12 sha256 = "sha256-sVjaIzOxNuBtDswpDl5gLB10Sw945TQAf2ywrKumqqk="; 13 fetchSubmodules = true; 14 }; 15 kklib = stdenv.mkDerivation { 16 pname = "kklib"; 17 inherit version; 18 src = "${src}/kklib"; 19 nativeBuildInputs = [ cmake ]; 20 outputs = [ "out" "dev" ]; 21 postInstall = '' 22 mkdir -p ''${!outputDev}/share/koka/v${version} 23 cp -a ../../kklib ''${!outputDev}/share/koka/v${version} 24 ''; 25 }; 26 inherit (pkgsHostTarget.targetPackages.stdenv) cc; 27 runtimeDeps = [ 28 cc 29 cc.bintools.bintools 30 pkgsHostTarget.gnumake 31 pkgsHostTarget.cmake 32 ]; 33in 34mkDerivation rec { 35 pname = "koka"; 36 inherit version src; 37 isLibrary = false; 38 isExecutable = true; 39 libraryToolDepends = [ hpack ]; 40 executableHaskellDepends = [ 41 array base bytestring cond containers directory isocline mtl 42 parsec process text time kklib 43 ]; 44 executableToolDepends = [ alex makeWrapper ]; 45 postInstall = '' 46 mkdir -p $out/share/koka/v${version} 47 cp -a lib $out/share/koka/v${version} 48 ln -s ${kklib.dev}/share/koka/v${version}/kklib $out/share/koka/v${version} 49 wrapProgram "$out/bin/koka" \ 50 --set CC "${lib.getBin cc}/bin/${cc.targetPrefix}cc" \ 51 --prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}" 52 ''; 53 doCheck = false; 54 prePatch = "hpack"; 55 description = "Koka language compiler and interpreter"; 56 homepage = "https://github.com/koka-lang/koka"; 57 changelog = "${homepage}/blob/master/doc/spec/news.mdk"; 58 license = lib.licenses.asl20; 59 maintainers = with lib.maintainers; [ siraben sternenseemann ]; 60}