nixpkgs/pkgs/development/compilers/llvm/3.9/default.nix

62 lines
1.9 KiB
Nix
Raw Normal View History

{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun, darwin }:
2016-08-26 07:31:39 +02:00
let
callPackage = newScope (self // { inherit stdenv isl version fetch; });
2016-12-28 19:56:55 +01:00
version = "3.9.1";
2016-08-26 07:31:39 +02:00
fetch = fetch_v version;
fetch_v = ver: name: sha256: fetchurl {
url = "http://llvm.org/releases/${version}/${name}-${ver}.src.tar.xz";
2016-08-26 07:31:39 +02:00
inherit sha256;
};
2016-12-28 19:56:55 +01:00
compiler-rt_src = fetch "compiler-rt" "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk";
clang-tools-extra_src = fetch "clang-tools-extra" "0d9nh7j7brbh9avigcn69dlaihsl9p3cf9s45mw6fxzzvrdvd999";
2016-08-26 07:31:39 +02:00
self = {
llvm = callPackage ./llvm.nix {
inherit compiler-rt_src stdenv;
};
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src stdenv;
};
clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
libstdcxxClang = ccWrapperFun {
cc = self.clang-unwrapped;
/* FIXME is this right? */
inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
extraPackages = [ libstdcxxHook ];
};
2016-08-26 07:31:39 +02:00
libcxxClang = ccWrapperFun {
cc = self.clang-unwrapped;
/* FIXME is this right? */
inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
extraPackages = [ self.libcxx self.libcxxabi ];
};
stdenv = stdenv.override (drv: {
allowedRequisites = null;
cc = self.clang;
# Don't include the libc++ and libc++abi from the original stdenv.
extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
});
libcxxStdenv = stdenv.override (drv: {
allowedRequisites = null;
cc = self.libcxxClang;
# Don't include the libc++ and libc++abi from the original stdenv.
extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
});
2016-08-26 07:31:39 +02:00
lldb = callPackage ./lldb.nix {};
libcxx = callPackage ./libc++ {};
libcxxabi = callPackage ./libc++abi.nix {};
};
in self