2018-05-23 00:21:35 +01:00
|
|
|
{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith, darwin }:
|
2016-08-26 06:31:39 +01:00
|
|
|
let
|
|
|
|
callPackage = newScope (self // { inherit stdenv isl version fetch; });
|
|
|
|
|
2016-12-28 18:56:55 +00:00
|
|
|
version = "3.9.1";
|
2016-08-26 06:31:39 +01:00
|
|
|
|
|
|
|
fetch = fetch_v version;
|
|
|
|
fetch_v = ver: name: sha256: fetchurl {
|
2016-09-11 09:11:44 +01:00
|
|
|
url = "http://llvm.org/releases/${version}/${name}-${ver}.src.tar.xz";
|
2016-08-26 06:31:39 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2016-12-28 18:56:55 +00:00
|
|
|
compiler-rt_src = fetch "compiler-rt" "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk";
|
|
|
|
clang-tools-extra_src = fetch "clang-tools-extra" "0d9nh7j7brbh9avigcn69dlaihsl9p3cf9s45mw6fxzzvrdvd999";
|
2016-08-26 06:31:39 +01: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-08-26 06:31:39 +01:00
|
|
|
|
2018-05-23 00:21:35 +01:00
|
|
|
libcxxClang = wrapCCWith {
|
2016-10-25 15:29:40 +01:00
|
|
|
cc = self.clang-unwrapped;
|
|
|
|
extraPackages = [ self.libcxx self.libcxxabi ];
|
|
|
|
};
|
|
|
|
|
2017-09-11 19:44:32 +01:00
|
|
|
stdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.clang;
|
|
|
|
});
|
|
|
|
|
|
|
|
libcxxStdenv = stdenv.override (drv: {
|
|
|
|
allowedRequisites = null;
|
|
|
|
cc = self.libcxxClang;
|
|
|
|
});
|
2016-10-25 15:29:40 +01:00
|
|
|
|
2016-08-26 06:31:39 +01:00
|
|
|
lldb = callPackage ./lldb.nix {};
|
|
|
|
|
|
|
|
libcxx = callPackage ./libc++ {};
|
|
|
|
|
|
|
|
libcxxabi = callPackage ./libc++abi.nix {};
|
|
|
|
};
|
|
|
|
in self
|