2016-12-31 18:13:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, python, ... }:
|
2014-07-12 16:17:50 +01:00
|
|
|
|
|
|
|
let
|
2017-03-11 04:13:10 +00:00
|
|
|
rev = "1.37.3";
|
2016-12-31 18:13:02 +00:00
|
|
|
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
2014-07-12 16:17:50 +01:00
|
|
|
in
|
2016-05-27 14:49:17 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2016-05-27 01:05:07 +01:00
|
|
|
name = "emscripten-fastcomp-${rev}";
|
2014-07-12 16:17:50 +01:00
|
|
|
|
2016-12-31 18:13:02 +00:00
|
|
|
src = fetchFromGitHub {
|
2016-05-27 01:05:07 +01:00
|
|
|
owner = "kripken";
|
|
|
|
repo = "emscripten-fastcomp";
|
2017-03-11 04:13:10 +00:00
|
|
|
sha256 = "0s5156g6576hm31628c2wbqwl9r6vn10z5ry59psl565zz3lpg8x";
|
2016-05-27 01:05:07 +01:00
|
|
|
inherit rev;
|
2014-07-12 16:17:50 +01:00
|
|
|
};
|
|
|
|
|
2016-05-27 01:05:07 +01:00
|
|
|
srcFL = fetchFromGitHub {
|
|
|
|
owner = "kripken";
|
|
|
|
repo = "emscripten-fastcomp-clang";
|
2017-03-11 04:13:10 +00:00
|
|
|
sha256 = "0jhk20wb7275n5m9niqkzmvrr8hh5v26glkmsfmng4p66cs7jkil";
|
2016-05-27 01:05:07 +01:00
|
|
|
inherit rev;
|
2014-07-12 16:17:50 +01:00
|
|
|
};
|
|
|
|
|
2016-12-31 18:13:02 +00:00
|
|
|
nativeBuildInputs = [ cmake python ];
|
|
|
|
preConfigure = ''
|
|
|
|
cp -Lr ${srcFL} tools/clang
|
|
|
|
chmod +w -R tools/clang
|
2014-07-12 16:17:50 +01:00
|
|
|
'';
|
2016-12-31 18:13:02 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-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"
|
|
|
|
] ++ (stdenv.lib.optional stdenv.isLinux
|
|
|
|
# necessary for clang to find crtend.o
|
|
|
|
"-DGCC_INSTALL_PREFIX=${gcc}"
|
|
|
|
);
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
isClang = true;
|
|
|
|
inherit gcc;
|
|
|
|
};
|
2016-05-27 01:05:13 +01:00
|
|
|
|
2014-07-12 16:17:50 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/kripken/emscripten-fastcomp;
|
2016-12-31 18:13:02 +00:00
|
|
|
description = "Emscripten LLVM";
|
2015-11-21 12:33:22 +00:00
|
|
|
platforms = platforms.all;
|
2016-05-27 14:44:29 +01:00
|
|
|
maintainers = with maintainers; [ qknight matthewbauer ];
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.ncsa;
|
2014-07-12 16:17:50 +01:00
|
|
|
};
|
|
|
|
}
|