about summary refs log tree commit diff
path: root/pkgs/development/compilers/emscripten
diff options
context:
space:
mode:
authorJoachim Schiele <js@lastlog.de>2018-03-18 13:34:46 +0100
committerGitHub <noreply@github.com>2018-03-18 13:34:46 +0100
commitf41a3e7d7d327ea66459d17bfbe4a751b2496cb1 (patch)
treeaebc1382dfa04bc080be776421868f1f92cfde49 /pkgs/development/compilers/emscripten
parent705fee515050b23f0b8d9371ee3edd18879d50af (diff)
downloadnixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar.gz
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar.bz2
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar.lz
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar.xz
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.tar.zst
nixlib-f41a3e7d7d327ea66459d17bfbe4a751b2496cb1.zip
Emscripten 1.37.16 to 1.37.36 (#37291)
* trying to build emscriptenPackages not all fail

* reading the console.log it turns out python executable is not in place and that is why emconfigure didnt work

* backup commit

* much more targets are compiling now

* added common revisioning

* revision bump to 1.37.36 (not tested)

* fixed xmllint

* forcing unit testing, will implement the tests after i get home

* json_c test working

* added tests

* tiny fixes

* added documentation
Diffstat (limited to 'pkgs/development/compilers/emscripten')
-rw-r--r--pkgs/development/compilers/emscripten/default.nix24
1 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix
index ae80ad6fc808..ac972c99a959 100644
--- a/pkgs/development/compilers/emscripten/default.nix
+++ b/pkgs/development/compilers/emscripten/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler
-, jre, binaryen, enableWasm ? true
+{ emscriptenVersion, stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler, pkgs
+, jre, binaryen, enableWasm ? true ,  python2Packages, cmake
 }:
 
 let
-  rev = "1.37.16";
+  rev = emscriptenVersion;
   appdir = "share/emscripten";
 in
 
@@ -13,10 +13,12 @@ stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten";
-    sha256 = "1qyhjx5zza01vnwmj6qzxbkagxknn4kzb6gw12fqw5q8pa8fy4zy";
+    sha256 = "02p0cp86vd1mydlpq544xbydggpnrq9dhbxx7h08j235frjm5cdc";
     inherit rev;
   };
 
+  buildInputs = [ nodejs cmake python ];
+
   buildCommand = ''
     mkdir -p $out/${appdir}
     cp -r $src/* $out/${appdir}
@@ -38,9 +40,23 @@ stdenv.mkDerivation {
     echo "COMPILER_ENGINE = NODE_JS" >> $out/${appdir}/config
     echo "CLOSURE_COMPILER = '${closurecompiler}/share/java/closure-compiler-v${closurecompiler.version}.jar'" >> $out/${appdir}/config
     echo "JAVA = '${jre}/bin/java'" >> $out/${appdir}/config
+    # to make the test(s) below work
+    echo "SPIDERMONKEY_ENGINE = []" >> $out/${appdir}/config
   ''
   + stdenv.lib.optionalString enableWasm ''
     echo "BINARYEN_ROOT = '${binaryen}'" >> $out/share/emscripten/config
+  ''
+  +
+  ''
+    echo "--------------- running test -----------------"
+    # quick hack to get the test working
+    HOME=$TMPDIR
+    cp $out/${appdir}/config $HOME/.emscripten
+    export PATH=$PATH:$out/bin
+
+    #export EMCC_DEBUG=2  
+    ${python}/bin/python $src/tests/runner.py test_hello_world
+    echo "--------------- /running test -----------------"
   '';
 
   meta = with stdenv.lib; {