2017-09-16 01:38:38 +01:00
|
|
|
{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
|
2018-05-23 00:21:35 +01:00
|
|
|
, libxml2, python2, isl, fetchurl, overrideCC, wrapCCWith
|
2017-09-16 01:38:38 +01:00
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
|
|
|
|
|
2017-12-19 22:28:32 +00:00
|
|
|
release_version = "5.0.1";
|
2017-09-16 01:38:38 +01:00
|
|
|
version = release_version; # differentiating these is important for rc's
|
|
|
|
|
|
|
|
fetch = name: sha256: fetchurl {
|
|
|
|
url = "http://llvm.org/releases/${release_version}/${name}-${version}.src.tar.xz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2017-12-19 22:28:32 +00:00
|
|
|
compiler-rt_src = fetch "compiler-rt" "1nlmm0b3wpdwxkldqp1klzv3rpqf94q2a248xgqb7aapyhbi9paf";
|
|
|
|
clang-tools-extra_src = fetch "clang-tools-extra" "09fjii7w43kvxvsxxs6gig9vz95vnvx1779rqd36h8kksvws3bcs";
|
2017-09-16 01:38:38 +01:00
|
|
|
|
|
|
|
# Add man output without introducing extra dependencies.
|
|
|
|
overrideManOutput = drv:
|
|
|
|
let drv-manpages = drv.override { enableManpages = true; }; in
|
2018-01-03 15:51:31 +00:00
|
|
|
drv // { man = drv-manpages.out; /*outputs = drv.outputs ++ ["man"];*/ };
|
2017-09-16 01:38:38 +01:00
|
|
|
|
|
|
|
llvm = callPackage ./llvm.nix {
|
|
|
|
inherit compiler-rt_src stdenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
clang-unwrapped = callPackage ./clang {
|
|
|
|
inherit clang-tools-extra_src stdenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
self = {
|
|
|
|
llvm = overrideManOutput llvm;
|
|
|
|
clang-unwrapped = overrideManOutput clang-unwrapped;
|
|
|
|
|
2017-12-31 10:07:57 +00:00
|
|
|
libclang = self.clang-unwrapped.lib;
|
2017-09-16 01:38:38 +01:00
|
|
|
llvm-manpages = lowPrio self.llvm.man;
|
|
|
|
clang-manpages = lowPrio self.clang-unwrapped.man;
|
|
|
|
|
|
|
|
clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
|
|
|
|
|
2018-05-23 00:21:35 +01:00
|
|
|
libstdcxxClang = wrapCCWith {
|
2017-09-16 01:38:38 +01:00
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
extraPackages = [ libstdcxxHook ];
|
|
|
|
};
|
|
|
|
|
2018-05-23 00:21:35 +01:00
|
|
|
libcxxClang = wrapCCWith {
|
2017-09-16 01:38:38 +01:00
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
extraPackages = [ self.libcxx self.libcxxabi ];
|
|
|
|
};
|
|
|
|
|
|
|
|
stdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.clang;
|
|
|
|
});
|
|
|
|
|
|
|
|
libcxxStdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.libcxxClang;
|
|
|
|
});
|
|
|
|
|
|
|
|
lld = callPackage ./lld.nix {};
|
|
|
|
|
|
|
|
lldb = callPackage ./lldb.nix {};
|
|
|
|
|
|
|
|
libcxx = callPackage ./libc++ {};
|
|
|
|
|
|
|
|
libcxxabi = callPackage ./libc++abi.nix {};
|
|
|
|
|
|
|
|
openmp = callPackage ./openmp.nix {};
|
|
|
|
};
|
|
|
|
|
|
|
|
in self
|