emscripten 1.29 -> 1.35

also updates to store files in $out/share/emscripten instead of $out/bin.
also fix issue with closure compiler.
This commit is contained in:
Matthew Bauer 2015-10-31 01:27:15 -05:00
parent 7eea66cabe
commit 3807372d5b
2 changed files with 23 additions and 20 deletions

View File

@ -1,7 +1,7 @@
{ stdenv, fetchgit, python }:
let
tag = "1.29.10";
tag = "1.35.4";
in
stdenv.mkDerivation rec {
@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
srcFC = fetchgit {
url = git://github.com/kripken/emscripten-fastcomp;
rev = "refs/tags/${tag}";
sha256 = "eee0f884c7e10e1b869b9d3afbb03bf69c63ec0560b136e3e8cd64ca00a41653";
sha256 = "3bd50787d78381f684f9b3f46fc91cc3d1803c3389e19ec41ee59c2deaf727d8";
};
srcFL = fetchgit {
url = git://github.com/kripken/emscripten-fastcomp-clang;
rev = "refs/tags/${tag}";
sha256 = "22c48e85dfacd9f2349d37fb421f0f848b65fc7b39e66984d04349ee3271667c";
sha256 = "ec0d22c04eec5f84695401e19a52704b28e8d2779b87388f399b5f63b54a9862";
};
buildInputs = [ python ];

View File

@ -1,7 +1,8 @@
{ stdenv, fetchgit, emscriptenfastcomp, python, nodejs, closurecompiler, jre }:
let
tag = "1.29.10";
tag = "1.35.4";
appdir = "share/emscripten";
in
stdenv.mkDerivation rec {
@ -10,26 +11,28 @@ stdenv.mkDerivation rec {
src = fetchgit {
url = git://github.com/kripken/emscripten;
rev = "refs/tags/${tag}";
sha256 = "0d7ed2b801ac37acaf907bd03ba42cce3ac4a4c330bf1ef28de25bbb3f39ba87";
sha256 = "466500356c8c0fbcee495b2dbd2ccf0bf9d7eaf303d274ebaf491122759dd233";
};
buildCommand = ''
mkdir $out
cp -a $src $out/bin
chmod -R +w $out/bin
grep -rl '^#!/usr.*python' $out/bin | xargs sed -i -s 's@^#!/usr.*python.*@#!${python}/bin/python@'
sed -i -e "s,EM_CONFIG = '~/.emscripten',EM_CONFIG = '$out/config'," $out/bin/tools/shared.py
sed -i -e 's,^.*did not see a source tree above the LLVM.*$, return True,' $out/bin/tools/shared.py
sed -i -e 's,def check_sanity(force=False):,def check_sanity(force=False):\n return,' $out/bin/tools/shared.py
mkdir -p $out/${appdir}
cp -r $src/* $out/${appdir}
chmod -R +w $out/${appdir}
grep -rl '^#!/usr.*python' $out/${appdir} | xargs sed -i -s 's@^#!/usr.*python.*@#!${python}/bin/python@'
sed -i -e "s,EM_CONFIG = '~/.emscripten',EM_CONFIG = '$out/${appdir}/config'," $out/${appdir}/tools/shared.py
sed -i -e 's,^.*did not see a source tree above the LLVM.*$, return True,' $out/${appdir}/tools/shared.py
sed -i -e 's,def check_sanity(force=False):,def check_sanity(force=False):\n return,' $out/${appdir}/tools/shared.py
mkdir $out/bin
ln -s $out/${appdir}/{em++,em-config,emar,embuilder.py,emcc,emcmake,emconfigure,emlink.py,emmake,emranlib,emrun,emscons} $out/bin
echo "EMSCRIPTEN_ROOT = '$out/bin'" > $out/config
echo "LLVM_ROOT = '${emscriptenfastcomp}'" >> $out/config
echo "PYTHON = '${python}/bin/python'" >> $out/config
echo "NODE_JS = '${nodejs}/bin/node'" >> $out/config
echo "JS_ENGINES = [NODE_JS]" >> $out/config
echo "COMPILER_ENGINE = NODE_JS" >> $out/config
echo "CLOSURE_COMPILER = '${closurecompiler}/bin/closure-compiler'" >> $out/config
echo "JAVA = '${jre}/bin/java'" >> $out/config
echo "EMSCRIPTEN_ROOT = '$out/${appdir}'" > $out/${appdir}/config
echo "LLVM_ROOT = '${emscriptenfastcomp}'" >> $out/${appdir}/config
echo "PYTHON = '${python}/bin/python'" >> $out/${appdir}/config
echo "NODE_JS = '${nodejs}/bin/node'" >> $out/${appdir}/config
echo "JS_ENGINES = [NODE_JS]" >> $out/${appdir}/config
echo "COMPILER_ENGINE = NODE_JS" >> $out/${appdir}/config
echo "CLOSURE_COMPILER = '${closurecompiler}/share/java/compiler.jar'" >> $out/${appdir}/config
echo "JAVA = '${jre}/bin/java'" >> $out/${appdir}/config
'';
meta = with stdenv.lib; {
homepage = https://github.com/kripken/emscripten;