2018-05-23 00:25:34 +01:00
|
|
|
{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin
|
|
|
|
, buildLlvmPackages # ourself, but from the previous stage, for cross
|
|
|
|
, targetLlvmPackages # ourself, but from the next stage, for cross
|
|
|
|
}:
|
|
|
|
|
2016-03-09 00:05:46 +00:00
|
|
|
let
|
|
|
|
callPackage = newScope (self // { inherit stdenv isl version fetch; });
|
|
|
|
|
2016-08-30 19:56:01 +01:00
|
|
|
version = "3.8.1";
|
2016-03-09 00:05:46 +00:00
|
|
|
|
|
|
|
fetch = fetch_v version;
|
|
|
|
fetch_v = ver: name: sha256: fetchurl {
|
|
|
|
url = "http://llvm.org/releases/${ver}/${name}-${ver}.src.tar.xz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2016-08-30 19:56:01 +01:00
|
|
|
compiler-rt_src = fetch "compiler-rt" "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d";
|
|
|
|
clang-tools-extra_src = fetch "clang-tools-extra" "15n39r4ssphpaq4a0wzyjm7ilwxb0bch6nrapy8c5s8d49h5qjk6";
|
2016-03-09 00:05:46 +00:00
|
|
|
|
|
|
|
self = {
|
|
|
|
llvm = callPackage ./llvm.nix {
|
|
|
|
inherit compiler-rt_src stdenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
clang-unwrapped = callPackage ./clang {
|
|
|
|
inherit clang-tools-extra_src stdenv;
|
|
|
|
};
|
|
|
|
|
2017-12-31 10:07:57 +00:00
|
|
|
libclang = self.clang-unwrapped.lib;
|
|
|
|
|
2017-09-11 19:44:32 +01:00
|
|
|
clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
|
|
|
|
|
2018-05-23 00:21:35 +01:00
|
|
|
libstdcxxClang = wrapCCWith {
|
2017-09-11 19:44:32 +01:00
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
extraPackages = [ libstdcxxHook ];
|
|
|
|
};
|
2016-03-09 00:05:46 +00:00
|
|
|
|
2018-05-23 00:21:35 +01:00
|
|
|
libcxxClang = wrapCCWith {
|
2016-10-25 15:29:40 +01:00
|
|
|
cc = self.clang-unwrapped;
|
2018-05-23 00:25:34 +01:00
|
|
|
extraPackages = [ targetLlvmPackages.libcxx targetLlvmPackages.libcxxabi ];
|
2016-10-25 15:29:40 +01:00
|
|
|
};
|
|
|
|
|
2017-09-11 19:44:32 +01:00
|
|
|
stdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.clang;
|
|
|
|
});
|
|
|
|
|
|
|
|
libcxxStdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
2018-05-23 00:25:34 +01:00
|
|
|
cc = buildLlvmPackages.libcxxClang;
|
2017-09-11 19:44:32 +01:00
|
|
|
});
|
2016-10-25 15:29:40 +01:00
|
|
|
|
2016-03-09 00:05:46 +00:00
|
|
|
lldb = callPackage ./lldb.nix {};
|
|
|
|
|
|
|
|
libcxx = callPackage ./libc++ {};
|
|
|
|
|
|
|
|
libcxxabi = callPackage ./libc++abi.nix {};
|
|
|
|
};
|
|
|
|
in self
|