2016-12-31 18:13:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, python, ... }:
|
2014-07-12 16:17:50 +01:00
|
|
|
|
|
|
|
let
|
2017-06-05 14:28:35 +01:00
|
|
|
rev = "1.37.13";
|
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-06-05 14:28:35 +01:00
|
|
|
sha256 = "1r4f4d5dmhxqwmpf2psainx7sj1j26fdp5acifdwg4sbbpsv96az";
|
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-06-05 14:28:35 +01:00
|
|
|
sha256 = "1p0108iz77vmzm7i1aa29sk93g5vd95xiwmags18qkr7x3fmfqsw";
|
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
|
|
|
};
|
|
|
|
}
|