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
This commit is contained in:
Joachim Schiele
2018-03-18 13:34:46 +01:00
committed by GitHub
parent 705fee5150
commit f41a3e7d7d
8 changed files with 340 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
{ stdenv, fetchFromGitHub, cmake, python, ... }:
{ emscriptenVersion, stdenv, llvm, fetchFromGitHub, cmake, python, gtest, ... }:
let
rev = "1.37.16";
rev = emscriptenVersion;
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in
stdenv.mkDerivation rec {
@@ -10,18 +10,18 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp";
sha256 = "0wj9sc0gciaiidcjv6wb0qn6ks06xds7q34351masc7qpvd217by";
sha256 = "04j698gmp686b5lricjakm5hyh2z2kh28m1ffkghmkyz4zkzmx98";
inherit rev;
};
srcFL = fetchFromGitHub {
owner = "kripken";
repo = "emscripten-fastcomp-clang";
sha256 = "1akdgxzxhzjbhp4d14ajcrp9jrf39x004a726ly2gynqc185l4j7";
sha256 = "1ici51mmpgg80xk3y8f376nbbfak6rz27qdy98l8lxkrymklp5g5";
inherit rev;
};
nativeBuildInputs = [ cmake python ];
nativeBuildInputs = [ cmake python gtest ];
preConfigure = ''
cp -Lr ${srcFL} tools/clang
chmod +w -R tools/clang
@@ -30,9 +30,10 @@ stdenv.mkDerivation rec {
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'"
"-DLLVM_INCLUDE_EXAMPLES=OFF"
"-DLLVM_INCLUDE_TESTS=OFF"
# "-DCLANG_INCLUDE_EXAMPLES=OFF"
"-DCLANG_INCLUDE_TESTS=OFF"
"-DLLVM_INCLUDE_TESTS=ON"
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
] ++ (stdenv.lib.optional stdenv.isLinux
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"

View File

@@ -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; {