2016-12-31 18:13:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, python, ... }:
|
2014-07-12 16:17:50 +01:00
|
|
|
|
|
|
|
let
|
2017-08-03 09:33:06 +01:00
|
|
|
rev = "1.37.16";
|
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-08-03 09:33:06 +01:00
|
|
|
sha256 = "0wj9sc0gciaiidcjv6wb0qn6ks06xds7q34351masc7qpvd217by";
|
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-08-03 09:33:06 +01:00
|
|
|
sha256 = "1akdgxzxhzjbhp4d14ajcrp9jrf39x004a726ly2gynqc185l4j7";
|
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
|
|
|
};
|
|
|
|
}
|