emscripten: fake cc-wrapper-esque passthru attrs for GHC
For the GHC JavaScript backend, we'll use emscripten in place of targetCC. To avoid having too much special logic for this, we'll make the emscripten derivation look like the result of wrapCC as far as GHC is concerned, i.e. we need targetPrefix and bintools. For bintools, we'll just reexpose emscripten, as it has emar, the only relevant bintools. That the other ones are missing doesn't matter in practice, as the GHC build system won't attempt to use them. targetPrefix can immediately be (ab)used to make sure GHC will correctly call emcc etc. instead of plain cc.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
, llvmPackages
|
||||
, symlinkJoin, makeWrapper, substituteAll
|
||||
, mkYarnModules
|
||||
, emscripten
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -116,6 +117,13 @@ stdenv.mkDerivation rec {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
# HACK: Make emscripten look more like a cc-wrapper to GHC
|
||||
# when building the javascript backend.
|
||||
targetPrefix = "em";
|
||||
bintools = emscripten;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/emscripten-core/emscripten";
|
||||
description = "An LLVM-to-JavaScript Compiler";
|
||||
|
||||
Reference in New Issue
Block a user