diff options
author | sternenseemann <sternenseemann@systemli.org> | 2023-01-03 22:45:05 +0100 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2023-01-03 22:45:05 +0100 |
commit | 12af3ee5c596b0a6798b299c97336fa3f5f063ed (patch) | |
tree | dfd7f16a472ed0de6db93f42bc137e0d6d1a1c25 /pkgs/development/compilers/emscripten | |
parent | a05354790bb2474249eca45b0156f518626999c7 (diff) |
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.
Diffstat (limited to 'pkgs/development/compilers/emscripten')
-rw-r--r-- | pkgs/development/compilers/emscripten/default.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix index 44ba33247b40..eca67f832102 100644 --- a/pkgs/development/compilers/emscripten/default.nix +++ b/pkgs/development/compilers/emscripten/default.nix @@ -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"; |