From fc0f11e3d533fadbb7d2330b3d3b50bd4eae298e Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sat, 29 Aug 2020 13:28:02 +0200 Subject: [PATCH] emscripten: make emconfigure use wrapped binaries --- pkgs/development/compilers/emscripten/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix index ca355ce4fe65..0b43017aa120 100644 --- a/pkgs/development/compilers/emscripten/default.nix +++ b/pkgs/development/compilers/emscripten/default.nix @@ -33,8 +33,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ]; buildInputs = [ nodejs python3 ]; - outputs = [ "out" "appdir" ]; - buildPhase = '' patchShebangs . @@ -57,10 +55,17 @@ stdenv.mkDerivation rec { # to make the test(s) below work # echo "SPIDERMONKEY_ENGINE = []" >> .emscripten echo "BINARYEN_ROOT = '${binaryen}'" >> .emscripten + + # make emconfigure/emcmake use the correct (wrapped) binaries + sed -i "s|^EMCC =.*|EMCC='$out/bin/emcc'|" tools/shared.py + sed -i "s|^EMXX =.*|EMXX='$out/bin/em++'|" tools/shared.py + sed -i "s|^EMAR =.*|EMAR='$out/bin/emar'|" tools/shared.py + sed -i "s|^EMRANLIB =.*|EMRANLIB='$out/bin/emranlib'|" tools/shared.py ''; installPhase = '' - rm -rf cache + appdir=$out/share/emscripten + mkdir -p $appdir cp -r . $appdir chmod -R +w $appdir