1 { runCommand, cctools }:
2 { haskellPackages, src, deps ? p : [], name }: let
3 inherit (haskellPackages) ghc ghcWithPackages;
4 with-env = ghcWithPackages deps;
5 ghcName = "${ghc.targetPrefix}ghc";
6 in runCommand name { buildInputs = [ with-env cctools ]; } ''
9 ${ghcName} ${src} -staticlib -outputdir . -o $out/lib/${name}.a -stubdir $out/include
10 for file in ${ghc}/lib/${ghcName}-${ghc.version}/include/*; do
11 ln -sv $file $out/include