emscriptenPackages.zlib: use emscriptenStdenv

main
Will Cohen 2 years ago
parent b5f228c836
commit 0340075cc6
  1. 18
      pkgs/top-level/emscripten-packages.nix

@ -14,6 +14,8 @@ rec {
propagatedBuildInputs = [ zlib ]; propagatedBuildInputs = [ zlib ];
configurePhase = '' configurePhase = ''
HOME=$TMPDIR HOME=$TMPDIR
mkdir -p .emscriptencache
export EM_CACHE=$(pwd)/.emscriptencache
emcmake cmake . $cmakeFlags -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_INSTALL_INCLUDEDIR=$dev/include emcmake cmake . $cmakeFlags -DCMAKE_INSTALL_PREFIX=$out -DCMAKE_INSTALL_INCLUDEDIR=$dev/include
''; '';
checkPhase = '' checkPhase = ''
@ -54,6 +56,8 @@ rec {
autoreconfPhase = "echo autoreconfPhase not used..."; autoreconfPhase = "echo autoreconfPhase not used...";
configurePhase = '' configurePhase = ''
HOME=$TMPDIR HOME=$TMPDIR
mkdir -p .emscriptencache
export EM_CACHE=$(pwd)/.emscriptencache
emconfigure ./configure --prefix=$out --without-python emconfigure ./configure --prefix=$out --without-python
''; '';
checkPhase = '' checkPhase = ''
@ -102,6 +106,8 @@ rec {
sed -e "s/\$(JSONC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(LIBXML20_LDFLAGS)/\$(JSONC_LDFLAGS) \$(LIBXML20_LDFLAGS) \$(ZLIB_LDFLAGS) /g" -i Makefile.emEnv sed -e "s/\$(JSONC_LDFLAGS) \$(ZLIB_LDFLAGS) \$(LIBXML20_LDFLAGS)/\$(JSONC_LDFLAGS) \$(LIBXML20_LDFLAGS) \$(ZLIB_LDFLAGS) /g" -i Makefile.emEnv
# https://gitlab.com/odfplugfest/xmlmirror/issues/11 # https://gitlab.com/odfplugfest/xmlmirror/issues/11
sed -e "s/-o fastXmlLint.js/-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -o fastXmlLint.js/g" -i Makefile.emEnv sed -e "s/-o fastXmlLint.js/-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -o fastXmlLint.js/g" -i Makefile.emEnv
mkdir -p .emscriptencache
export EM_CACHE=$(pwd)/.emscriptencache
''; '';
buildPhase = '' buildPhase = ''
@ -137,16 +143,6 @@ rec {
buildInputs = old.buildInputs ++ [ pkg-config ]; buildInputs = old.buildInputs ++ [ pkg-config ];
# we need to reset this setting! # we need to reset this setting!
NIX_CFLAGS_COMPILE=""; NIX_CFLAGS_COMPILE="";
configurePhase = ''
# FIXME: Some tests require writing at $HOME
HOME=$TMPDIR
runHook preConfigure
#export EMCC_DEBUG=2
emconfigure ./configure --prefix=$out --shared
runHook postConfigure
'';
dontStrip = true; dontStrip = true;
outputs = [ "out" ]; outputs = [ "out" ];
buildPhase = '' buildPhase = ''
@ -161,7 +157,7 @@ rec {
echo "Compiling a custom test" echo "Compiling a custom test"
set -x set -x
emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO \ emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO \
-L. libz.so.${old.version} -I . -o example.js -L. libz.a -I . -o example.js
echo "Using node to execute the test" echo "Using node to execute the test"
${pkgs.nodejs}/bin/node ./example.js ${pkgs.nodejs}/bin/node ./example.js

Loading…
Cancel
Save