clang: Add compat lib attribute to have stdenv.cc.cc.lib always work

Fixes tarball evaluation:

http://hydra.nixos.org/build/35042997/nixlog/1/raw
This commit is contained in:
Tuomas Tynkkynen 2016-05-02 00:55:08 +03:00
parent ef44e78849
commit 36c4c73575
3 changed files with 132 additions and 126 deletions

View File

@ -2,7 +2,7 @@
let let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in stdenv.mkDerivation { self = stdenv.mkDerivation {
name = "clang-${version}"; name = "clang-${version}";
unpackPhase = '' unpackPhase = ''
@ -41,6 +41,7 @@ in stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
passthru = { passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true; isClang = true;
} // stdenv.lib.optionalAttrs stdenv.isLinux { } // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc; inherit gcc;
@ -52,4 +53,5 @@ in stdenv.mkDerivation {
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
}; };
} };
in self

View File

@ -2,7 +2,7 @@
let let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in stdenv.mkDerivation { self = stdenv.mkDerivation {
name = "clang-${version}"; name = "clang-${version}";
unpackPhase = '' unpackPhase = ''
@ -41,6 +41,7 @@ in stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
passthru = { passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true; isClang = true;
} // stdenv.lib.optionalAttrs stdenv.isLinux { } // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc; inherit gcc;
@ -52,4 +53,5 @@ in stdenv.mkDerivation {
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
}; };
} };
in self

View File

@ -2,7 +2,7 @@
let let
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in stdenv.mkDerivation { self = stdenv.mkDerivation {
name = "clang-${version}"; name = "clang-${version}";
unpackPhase = '' unpackPhase = ''
@ -41,6 +41,7 @@ in stdenv.mkDerivation {
enableParallelBuilding = true; enableParallelBuilding = true;
passthru = { passthru = {
lib = self; # compatibility with gcc, so that `stdenv.cc.cc.lib` works on both
isClang = true; isClang = true;
} // stdenv.lib.optionalAttrs stdenv.isLinux { } // stdenv.lib.optionalAttrs stdenv.isLinux {
inherit gcc; inherit gcc;
@ -52,4 +53,5 @@ in stdenv.mkDerivation {
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
}; };
} };
in self