2017-09-04 20:23:57 +01:00
|
|
|
{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
|
|
|
|
, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
2017-02-18 19:53:46 +00:00
|
|
|
let
|
2017-03-18 20:48:27 +00:00
|
|
|
callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-06-27 14:23:43 +01:00
|
|
|
release_version = "4.0.1";
|
2017-03-13 19:54:39 +00:00
|
|
|
version = release_version; # differentiating these is important for rc's
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-02-19 20:33:47 +00:00
|
|
|
fetch = name: sha256: fetchurl {
|
2017-10-05 11:17:23 +01:00
|
|
|
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
2017-02-18 19:53:46 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2017-06-27 14:23:43 +01:00
|
|
|
compiler-rt_src = fetch "compiler-rt" "0h5lpv1z554szi4r4blbskhwrkd78ir50v3ng8xvk1s86fa7gj53";
|
|
|
|
clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m";
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-06-24 12:11:43 +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-06-24 12:11:43 +01:00
|
|
|
|
|
|
|
llvm = callPackage ./llvm.nix {
|
|
|
|
inherit compiler-rt_src stdenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
clang-unwrapped = callPackage ./clang {
|
|
|
|
inherit clang-tools-extra_src stdenv;
|
|
|
|
};
|
|
|
|
|
2017-02-18 19:53:46 +00:00
|
|
|
self = {
|
2017-06-24 12:11:43 +01:00
|
|
|
llvm = overrideManOutput llvm;
|
|
|
|
clang-unwrapped = overrideManOutput clang-unwrapped;
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-12-31 10:07:57 +00:00
|
|
|
libclang = self.clang-unwrapped.lib;
|
2017-06-26 19:25:14 +01:00
|
|
|
llvm-manpages = lowPrio self.llvm.man;
|
|
|
|
clang-manpages = lowPrio self.clang-unwrapped.man;
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-09-11 19:35:36 +01:00
|
|
|
clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-09-11 19:35:36 +01:00
|
|
|
libstdcxxClang = ccWrapperFun {
|
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
/* FIXME is this right? */
|
2017-08-26 16:43:30 +01:00
|
|
|
inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
|
2017-09-11 19:35:36 +01:00
|
|
|
extraPackages = [ libstdcxxHook ];
|
|
|
|
};
|
2017-04-29 02:30:55 +01:00
|
|
|
|
2017-02-18 19:53:46 +00:00
|
|
|
libcxxClang = ccWrapperFun {
|
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
/* FIXME is this right? */
|
2017-08-26 16:43:30 +01:00
|
|
|
inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
|
2017-02-18 19:53:46 +00:00
|
|
|
extraPackages = [ self.libcxx self.libcxxabi ];
|
|
|
|
};
|
|
|
|
|
2017-09-04 20:23:57 +01:00
|
|
|
stdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.clang;
|
|
|
|
});
|
2017-02-18 19:53:46 +00:00
|
|
|
|
2017-09-11 19:35:36 +01:00
|
|
|
libcxxStdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.libcxxClang;
|
|
|
|
});
|
2017-02-18 19:53:46 +00:00
|
|
|
|
|
|
|
lld = callPackage ./lld.nix {};
|
|
|
|
|
|
|
|
lldb = callPackage ./lldb.nix {};
|
|
|
|
|
|
|
|
libcxx = callPackage ./libc++ {};
|
|
|
|
|
|
|
|
libcxxabi = callPackage ./libc++abi.nix {};
|
2017-09-11 19:35:36 +01:00
|
|
|
|
|
|
|
openmp = callPackage ./openmp.nix {};
|
2017-02-18 19:53:46 +00:00
|
|
|
};
|
2017-09-04 20:23:57 +01:00
|
|
|
|
2017-02-18 19:53:46 +00:00
|
|
|
in self
|