Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 pkgsHostTarget, 4 cmake, 5 makeWrapper, 6 mkDerivation, 7 fetchFromGitHub, 8 alex, 9 lib, 10 hpack, 11 aeson, 12 array, 13 async, 14 base, 15 bytestring, 16 co-log-core, 17 cond, 18 containers, 19 directory, 20 FloatingHex, 21 isocline, 22 lens, 23 lsp_2_4_0_0, 24 mtl, 25 network, 26 network-simple, 27 parsec, 28 process, 29 text, 30 text-rope, 31 time, 32}: 33 34let 35 version = "3.1.2"; 36 src = fetchFromGitHub { 37 owner = "koka-lang"; 38 repo = "koka"; 39 rev = "v${version}"; 40 hash = "sha256-BNkMtYf5maWtKEZzob+218ke1SIkrP7/nboQ2sZKkxI="; 41 fetchSubmodules = true; 42 }; 43 kklib = stdenv.mkDerivation { 44 pname = "kklib"; 45 inherit version; 46 src = "${src}/kklib"; 47 nativeBuildInputs = [ cmake ]; 48 outputs = [ 49 "out" 50 "dev" 51 ]; 52 postInstall = '' 53 mkdir -p ''${!outputDev}/share/koka/v${version} 54 cp -a ../../kklib ''${!outputDev}/share/koka/v${version} 55 ''; 56 }; 57 inherit (pkgsHostTarget.targetPackages.stdenv) cc; 58 runtimeDeps = [ 59 cc 60 cc.bintools.bintools 61 pkgsHostTarget.gnumake 62 pkgsHostTarget.cmake 63 ]; 64in 65mkDerivation rec { 66 pname = "koka"; 67 inherit version src; 68 isLibrary = false; 69 isExecutable = true; 70 libraryToolDepends = [ hpack ]; 71 executableHaskellDepends = [ 72 aeson 73 array 74 async 75 base 76 bytestring 77 co-log-core 78 cond 79 containers 80 directory 81 FloatingHex 82 isocline 83 lens 84 lsp_2_4_0_0 85 mtl 86 network 87 network-simple 88 parsec 89 process 90 text 91 text-rope 92 time 93 kklib 94 ]; 95 executableToolDepends = [ 96 alex 97 makeWrapper 98 ]; 99 postInstall = '' 100 mkdir -p $out/share/koka/v${version} 101 cp -a lib $out/share/koka/v${version} 102 ln -s ${kklib.dev}/share/koka/v${version}/kklib $out/share/koka/v${version} 103 wrapProgram "$out/bin/koka" \ 104 --set CC "${lib.getBin cc}/bin/${cc.targetPrefix}cc" \ 105 --prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}" 106 ''; 107 doCheck = false; 108 prePatch = "hpack"; 109 description = "Koka language compiler and interpreter"; 110 homepage = "https://github.com/koka-lang/koka"; 111 changelog = "${homepage}/blob/master/doc/spec/news.mdk"; 112 license = lib.licenses.asl20; 113 maintainers = with lib.maintainers; [ 114 siraben 115 sternenseemann 116 ]; 117}