nixpkgs/pkgs/development/compilers/llvm/4/default.nix
Will Dietz 6f6c06adc1 llvm4.0: Rename "4.0" (and _40) to "4" (and _4).
This reflects upstream versioning change, and allows
us to replace 4.0 with 4.1 (which is now a minor revision)
without changing the attribute name.

Thanks to @vcunat for the idea.
2017-03-02 17:19:44 -06:00

52 lines
1.5 KiB
Nix

{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }:
let
callPackage = newScope (self // { inherit stdenv isl release_version version fetch; });
release_version = "4.0.0";
rc = "rc3";
version = "${release_version}${rc}";
fetch = name: sha256: fetchurl {
url = "http://llvm.org/pre-releases/${release_version}/${rc}/${name}-${version}.src.tar.xz";
# Once 4 is released, use this instead:
# url = "http://llvm.org/releases/${release-version}/${name}-${version}.src.tar.xz";
inherit sha256;
};
compiler-rt_src = fetch "compiler-rt" "0jfqhz95cp15c5688c6l9mr12s0qp86milpcrjlc93dc2jy08ba5";
clang-tools-extra_src = fetch "clang-tools-extra" "1c9c507w3f5vm153rdd0kmzvv2ski6z439izk01zf5snfwkqxkq8";
self = {
llvm = callPackage ./llvm.nix {
inherit compiler-rt_src stdenv;
};
clang-unwrapped = callPackage ./clang {
inherit clang-tools-extra_src stdenv;
};
clang = wrapCC self.clang-unwrapped;
libcxxClang = ccWrapperFun {
cc = self.clang-unwrapped;
isClang = true;
inherit (self) stdenv;
/* FIXME is this right? */
inherit (stdenv.cc) libc nativeTools nativeLibc;
extraPackages = [ self.libcxx self.libcxxabi ];
};
stdenv = overrideCC stdenv self.clang;
libcxxStdenv = overrideCC stdenv self.libcxxClang;
lld = callPackage ./lld.nix {};
lldb = callPackage ./lldb.nix {};
libcxx = callPackage ./libc++ {};
libcxxabi = callPackage ./libc++abi.nix {};
};
in self