summaryrefslogtreecommitdiff
path: root/doc/languages-frameworks/emscripten.section.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/languages-frameworks/emscripten.section.md')
-rw-r--r--doc/languages-frameworks/emscripten.section.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/languages-frameworks/emscripten.section.md b/doc/languages-frameworks/emscripten.section.md
index ea9ddf5c6d71..c538067005aa 100644
--- a/doc/languages-frameworks/emscripten.section.md
+++ b/doc/languages-frameworks/emscripten.section.md
@@ -47,6 +47,7 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
env = (old.env or { }) // {
NIX_CFLAGS_COMPILE = "";
};
+
configurePhase = ''
# FIXME: Some tests require writing at $HOME
HOME=$TMPDIR
@@ -57,15 +58,29 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
runHook postConfigure
'';
+
dontStrip = true;
outputs = [ "out" ];
+
buildPhase = ''
+ runHook preBuild
+
emmake make
+
+ runHook postBuild
'';
+
installPhase = ''
+ runHook preInstall
+
emmake make install
+
+ runHook postInstall
'';
+
checkPhase = ''
+ runHook preCheck
+
echo "================= testing zlib using node ================="
echo "Compiling a custom test"
@@ -84,6 +99,8 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
echo "it seems to work! very good."
fi
echo "================= /testing zlib using node ================="
+
+ runHook postCheck
'';
postPatch = pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
@@ -116,6 +133,7 @@ pkgs.buildEmscriptenPackage rec {
openjdk
json_c
];
+
nativeBuildInputs = [
pkg-config
writableTmpDirAsHomeHook
@@ -129,6 +147,8 @@ pkgs.buildEmscriptenPackage rec {
};
configurePhase = ''
+ runHook preConfigure
+
rm -f fastXmlLint.js*
# a fix for ERROR:root:For asm.js, TOTAL_MEMORY must be a multiple of 16MB, was 234217728
# https://gitlab.com/odfplugfest/xmlmirror/issues/8
@@ -138,10 +158,16 @@ pkgs.buildEmscriptenPackage rec {
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
sed -e "s/-o fastXmlLint.js/-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -o fastXmlLint.js/g" -i Makefile.emEnv
+
+ runHook postConfigure
'';
buildPhase = ''
+ runHook preBuild
+
make -f Makefile.emEnv
+
+ runHook postBuild
'';
outputs = [
@@ -150,6 +176,8 @@ pkgs.buildEmscriptenPackage rec {
];
installPhase = ''
+ runHook preInstall
+
mkdir -p $out/share
mkdir -p $doc/share/${name}
@@ -163,9 +191,13 @@ pkgs.buildEmscriptenPackage rec {
cp *.json $out/share
cp *.rng $out/share
cp README.md $doc/share/${name}
+ runHook postInstall
'';
+
checkPhase = ''
+ runHook preCheck
+ runHook postCheck
'';
}
```