mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
55 lines
1.4 KiB
Nix
55 lines
1.4 KiB
Nix
{ stdenv, fetchFromGitHub, cmake, python, ... }:
|
|
|
|
let
|
|
rev = "1.37.10";
|
|
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";
|
|
sha256 = "0zl55jaas3cibjscr5q1q6rgw63wqwyc9iffhvs4xi9g1bk5cnx9";
|
|
inherit rev;
|
|
};
|
|
|
|
srcFL = fetchFromGitHub {
|
|
owner = "kripken";
|
|
repo = "emscripten-fastcomp-clang";
|
|
sha256 = "0cdvld0lfl3cl7m6yax7f87ip9iq4rmz8icr68l2g8bl2w8qd89j";
|
|
inherit rev;
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake python ];
|
|
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"
|
|
"-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;
|
|
};
|
|
|
|
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;
|
|
};
|
|
}
|