0e2e3afd65
The source distribution contains binaries (probably for testing) that make the Avira virus scanner treat it as malware on account of a “bad ELF header”. Apart from being preferable in general, the HTTPS download makes the file opaque to the overeager AV scanner in transparent proxying setups. Also adapt to the fact that the canonical downloads now point to a URL like this: https://releases.llvm.org/4.0.1/llvm-4.0.1.src.tar.xz
81 lines
2.5 KiB
Nix
81 lines
2.5 KiB
Nix
{ lowPrio, newScope, stdenv, targetPlatform, cmake, libstdcxxHook
|
|
, libxml2, python2, isl, fetchurl, overrideCC, wrapCC, ccWrapperFun
|
|
, darwin
|
|
}:
|
|
|
|
let
|
|
callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
|
|
|
|
release_version = "4.0.1";
|
|
version = release_version; # differentiating these is important for rc's
|
|
|
|
fetch = name: sha256: fetchurl {
|
|
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
|
inherit sha256;
|
|
};
|
|
|
|
compiler-rt_src = fetch "compiler-rt" "0h5lpv1z554szi4r4blbskhwrkd78ir50v3ng8xvk1s86fa7gj53";
|
|
clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m";
|
|
|
|
# Add man output without introducing extra dependencies.
|
|
overrideManOutput = drv:
|
|
let drv-manpages = drv.override { enableManpages = true; }; in
|
|
drv // { man = drv-manpages.man; /*outputs = drv.outputs ++ ["man"];*/ };
|
|
|
|
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;
|
|
|
|
llvm-manpages = lowPrio self.llvm.man;
|
|
clang-manpages = lowPrio self.clang-unwrapped.man;
|
|
|
|
clang = if stdenv.cc.isGNU then self.libstdcxxClang else self.libcxxClang;
|
|
|
|
libstdcxxClang = ccWrapperFun {
|
|
cc = self.clang-unwrapped;
|
|
/* FIXME is this right? */
|
|
inherit (stdenv.cc) libc nativeTools nativeLibc;
|
|
extraPackages = [ libstdcxxHook ];
|
|
};
|
|
|
|
libcxxClang = ccWrapperFun {
|
|
cc = self.clang-unwrapped;
|
|
/* FIXME is this right? */
|
|
inherit (stdenv.cc) 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;
|
|
});
|
|
|
|
lld = callPackage ./lld.nix {};
|
|
|
|
lldb = callPackage ./lldb.nix {};
|
|
|
|
libcxx = callPackage ./libc++ {};
|
|
|
|
libcxxabi = callPackage ./libc++abi.nix {};
|
|
|
|
openmp = callPackage ./openmp.nix {};
|
|
};
|
|
|
|
in self
|