lol

Merge pull request #172207 from willcohen/emscripten-fix

emscriptenStdenv: create writable cache directory

authored by

Artturi and committed by
GitHub
749c2d5b 88d05579

+14 -14
+7 -3
pkgs/development/em-modules/generic/default.nix
··· 1 - { pkgs, lib, emscripten, python2 }: 1 + { pkgs, lib, emscripten, python3 }: 2 2 3 3 { buildInputs ? [], nativeBuildInputs ? [] 4 4 ··· 12 12 13 13 pname = "emscripten-${lib.getName args}"; 14 14 version = lib.getVersion args; 15 - buildInputs = [ emscripten python2 ] ++ buildInputs; 16 - nativeBuildInputs = [ emscripten python2 ] ++ nativeBuildInputs; 15 + buildInputs = [ emscripten python3 ] ++ buildInputs; 16 + nativeBuildInputs = [ emscripten python3 ] ++ nativeBuildInputs; 17 17 18 18 # fake conftest results with emscripten's python magic 19 19 EMCONFIGURE_JS=2; ··· 25 25 26 26 emconfigure ./configure --prefix=$out 27 27 28 + mkdir -p .emscriptencache 29 + export EM_CACHE=$(pwd)/.emscriptencache 30 + 28 31 runHook postConfigure 29 32 ''; 30 33 ··· 32 35 runHook preBuild 33 36 34 37 HOME=$TMPDIR 38 + 35 39 emmake make 36 40 37 41 runHook postBuild
+7 -11
pkgs/top-level/emscripten-packages.nix
··· 14 14 propagatedBuildInputs = [ zlib ]; 15 15 configurePhase = '' 16 16 HOME=$TMPDIR 17 + mkdir -p .emscriptencache 18 + export EM_CACHE=$(pwd)/.emscriptencache 17 19 emcmake cmake . $cmakeFlags -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_INSTALL_INCLUDEDIR=$dev/include 18 20 ''; 19 21 checkPhase = '' ··· 54 56 autoreconfPhase = "echo autoreconfPhase not used..."; 55 57 configurePhase = '' 56 58 HOME=$TMPDIR 59 + mkdir -p .emscriptencache 60 + export EM_CACHE=$(pwd)/.emscriptencache 57 61 emconfigure ./configure --prefix=$out --without-python 58 62 ''; 59 63 checkPhase = '' ··· 102 106 sed -e "s/\$(JSONC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(LIBXML20_LDFLAGS)/\$(JSONC_LDFLAGS) \$(LIBXML20_LDFLAGS) \$(ZLIB_LDFLAGS) /g" -i Makefile.emEnv 103 107 # https://gitlab.com/odfplugfest/xmlmirror/issues/11 104 108 sed -e "s/-o fastXmlLint.js/-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -o fastXmlLint.js/g" -i Makefile.emEnv 109 + mkdir -p .emscriptencache 110 + export EM_CACHE=$(pwd)/.emscriptencache 105 111 ''; 106 112 107 113 buildPhase = '' ··· 137 143 buildInputs = old.buildInputs ++ [ pkg-config ]; 138 144 # we need to reset this setting! 139 145 NIX_CFLAGS_COMPILE=""; 140 - configurePhase = '' 141 - # FIXME: Some tests require writing at $HOME 142 - HOME=$TMPDIR 143 - runHook preConfigure 144 - 145 - #export EMCC_DEBUG=2 146 - emconfigure ./configure --prefix=$out --shared 147 - 148 - runHook postConfigure 149 - ''; 150 146 dontStrip = true; 151 147 outputs = [ "out" ]; 152 148 buildPhase = '' ··· 161 157 echo "Compiling a custom test" 162 158 set -x 163 159 emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO \ 164 - -L. libz.so.${old.version} -I . -o example.js 160 + -L. libz.a -I . -o example.js 165 161 166 162 echo "Using node to execute the test" 167 163 ${pkgs.nodejs}/bin/node ./example.js