@@ -33,8 +33,6 @@ stdenv.mkDerivation rec {
3333 nativeBuildInputs = [ makeWrapper ];
3434 buildInputs = [ nodejs python3 ];
3535
36− outputs = [ "out" "appdir" ];
37−
3836 buildPhase = ''
3937 patchShebangs .
4038
@@ -57,10 +55,17 @@ stdenv.mkDerivation rec {
5755 # to make the test(s) below work
5856 # echo "SPIDERMONKEY_ENGINE = []" >> .emscripten
5957 echo "BINARYEN_ROOT = '${binaryen}'" >> .emscripten
58+
59+ # make emconfigure/emcmake use the correct (wrapped) binaries
60+ sed -i "s|^EMCC =.*|EMCC='$out/bin/emcc'|" tools/shared.py
61+ sed -i "s|^EMXX =.*|EMXX='$out/bin/em++'|" tools/shared.py
62+ sed -i "s|^EMAR =.*|EMAR='$out/bin/emar'|" tools/shared.py
63+ sed -i "s|^EMRANLIB =.*|EMRANLIB='$out/bin/emranlib'|" tools/shared.py
6064 '';
6165
6266 installPhase = ''
63− rm -rf cache
67+ appdir=$out/share/emscripten
68+ mkdir -p $appdir
6469 cp -r . $appdir
6570 chmod -R +w $appdir
6671