2018-07-21 01:44:44 +01:00
|
|
|
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
|
2017-09-13 18:12:08 +01:00
|
|
|
|
|
|
|
let
|
2018-03-18 12:34:46 +00:00
|
|
|
rev = emscriptenVersion;
|
2017-09-13 18:12:08 +01:00
|
|
|
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "emscripten-fastcomp-${rev}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kripken";
|
|
|
|
repo = "emscripten-fastcomp";
|
2018-03-18 12:34:46 +00:00
|
|
|
sha256 = "04j698gmp686b5lricjakm5hyh2z2kh28m1ffkghmkyz4zkzmx98";
|
2017-09-13 18:12:08 +01:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
|
|
|
srcFL = fetchFromGitHub {
|
|
|
|
owner = "kripken";
|
|
|
|
repo = "emscripten-fastcomp-clang";
|
2018-03-18 12:34:46 +00:00
|
|
|
sha256 = "1ici51mmpgg80xk3y8f376nbbfak6rz27qdy98l8lxkrymklp5g5";
|
2017-09-13 18:12:08 +01:00
|
|
|
inherit rev;
|
|
|
|
};
|
|
|
|
|
2018-03-18 12:34:46 +00:00
|
|
|
nativeBuildInputs = [ cmake python gtest ];
|
2017-09-13 18:12:08 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cp -Lr ${srcFL} tools/clang
|
|
|
|
chmod +w -R tools/clang
|
|
|
|
'';
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'"
|
|
|
|
"-DLLVM_INCLUDE_EXAMPLES=OFF"
|
2018-03-18 12:34:46 +00:00
|
|
|
"-DLLVM_INCLUDE_TESTS=ON"
|
|
|
|
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
|
|
|
|
"-DLLVM_BUILD_TESTS=ON"
|
|
|
|
"-DCLANG_INCLUDE_TESTS=ON"
|
2017-09-13 18:12:08 +01:00
|
|
|
] ++ (stdenv.lib.optional stdenv.isLinux
|
|
|
|
# necessary for clang to find crtend.o
|
|
|
|
"-DGCC_INSTALL_PREFIX=${gcc}"
|
|
|
|
);
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
isClang = true;
|
|
|
|
inherit gcc;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/kripken/emscripten-fastcomp;
|
|
|
|
description = "Emscripten LLVM";
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ qknight matthewbauer ];
|
|
|
|
license = stdenv.lib.licenses.ncsa;
|
|
|
|
};
|
|
|
|
}
|