lol

Merge pull request #7817 from gridaphobe/cc-wrapper-isgnu-isclang

Add isGNU and isClang attributes to cc-wrapper

+42 -32
+1 -1
pkgs/applications/graphics/inkscape/default.nix
··· 18 18 patchShebangs share/extensions 19 19 '' 20 20 # Clang gets misdetected, so hardcode the right answer 21 - + stdenv.lib.optionalString (stdenv.cc.cc.isClang or false) '' 21 + + stdenv.lib.optionalString stdenv.cc.isClang '' 22 22 substituteInPlace src/ui/tool/node.h \ 23 23 --replace "#if __cplusplus >= 201103L" "#if true" 24 24 '';
+1 -1
pkgs/applications/networking/browsers/opera/default.nix
··· 6 6 , kdeSupport ? false, qt4, kdelibs 7 7 }: 8 8 9 - assert stdenv.isLinux && stdenv.cc.cc.isGNU or false && stdenv.cc.libc != null; 9 + assert stdenv.isLinux && stdenv.cc.isGNU && stdenv.cc.libc != null; 10 10 11 11 let 12 12 mirror = http://get.geo.opera.com/pub/opera;
+2 -1
pkgs/build-support/cc-wrapper/default.nix
··· 10 10 , zlib ? null, extraPackages ? [] 11 11 , dyld ? null # TODO: should this be a setup-hook on dyld? 12 12 , setupHook ? ./setup-hook.sh 13 + , isGNU ? false, isClang ? false 13 14 }: 14 15 15 16 with stdenv.lib; ··· 41 42 # The wrapper scripts use 'cat', so we may need coreutils. 42 43 coreutils = if nativeTools then null else coreutils; 43 44 44 - passthru = { inherit nativeTools nativeLibc nativePrefix; }; 45 + passthru = { inherit nativeTools nativeLibc nativePrefix isGNU isClang; }; 45 46 46 47 buildCommand = 47 48 ''
+1 -1
pkgs/development/compilers/gcl/default.nix
··· 10 10 11 11 ( 12 12 assert a.stdenv ? cc ; 13 - assert a.stdenv.cc.cc.isGNU or false ; 13 + assert a.stdenv.cc.isGNU ; 14 14 assert a.stdenv.cc ? libc ; 15 15 assert a.stdenv.cc.libc != null ; 16 16
+1 -1
pkgs/development/compilers/llvm/3.5/clang.nix
··· 1 1 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }: 2 2 let 3 - gcc = if stdenv.cc.cc.isGNU or false then stdenv.cc.cc else stdenv.cc.cc.gcc; 3 + gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; 4 4 in stdenv.mkDerivation { 5 5 name = "clang-${version}"; 6 6
+1 -1
pkgs/development/compilers/llvm/3.6/clang/default.nix
··· 1 1 { stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src }: 2 2 3 3 let 4 - gcc = if stdenv.cc.cc.isGNU or false then stdenv.cc.cc else stdenv.cc.cc.gcc; 4 + gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; 5 5 in stdenv.mkDerivation { 6 6 name = "clang-${version}"; 7 7
+1 -1
pkgs/development/guile-modules/guile-lib/default.nix
··· 1 1 {stdenv, fetchurl, guile, texinfo}: 2 2 3 - assert stdenv ? cc && stdenv.cc.cc.isGNU or false; 3 + assert stdenv ? cc && stdenv.cc.isGNU; 4 4 5 5 stdenv.mkDerivation rec { 6 6 name = "guile-lib-0.2.2";
+1 -1
pkgs/development/libraries/ffmpeg/generic.nix
··· 129 129 "--disable-stripping" 130 130 # Disable mmx support for 0.6.90 131 131 (verFix null "0.6.90" "--disable-mmx") 132 - ] ++ optional (stdenv.cc.cc.isClang or false) "--cc=clang"; 132 + ] ++ optional stdenv.cc.isClang "--cc=clang"; 133 133 134 134 nativeBuildInputs = [ perl pkgconfig texinfo yasm ]; 135 135
+1 -1
pkgs/development/libraries/fftw/default.nix
··· 21 21 ++ optional (precision != "double") "--enable-${precision}" 22 22 # all x86_64 have sse2 23 23 ++ optional stdenv.isx86_64 "--enable-sse2" 24 - ++ optional (stdenv.cc.cc.isGNU or false) "--enable-openmp"; 24 + ++ optional stdenv.cc.isGNU "--enable-openmp"; 25 25 26 26 enableParallelBuilding = true; 27 27
+1 -1
pkgs/development/libraries/gamin/default.nix
··· 18 18 19 19 patches = [ ./deadlock.patch ] 20 20 ++ map fetchurl (import ./debian-patches.nix) 21 - ++ stdenv.lib.optional (stdenv.cc.cc.isClang or false) ./returnval.patch; 21 + ++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch; 22 22 23 23 24 24 meta = with stdenv.lib; {
+1 -1
pkgs/development/libraries/glib/default.nix
··· 7 7 8 8 with stdenv.lib; 9 9 10 - assert !stdenv.isDarwin -> stdenv.cc.cc.isGNU or false; 10 + assert !stdenv.isDarwin -> stdenv.cc.isGNU; 11 11 12 12 # TODO: 13 13 # * Add gio-module-fam
+1 -1
pkgs/development/libraries/glibc/default.nix
··· 8 8 , withGd ? false, gd ? null, libpng ? null 9 9 }: 10 10 11 - assert stdenv.cc.cc.isGNU or false; 11 + assert stdenv.cc.isGNU; 12 12 13 13 let 14 14 build = import ./common.nix;
+1 -1
pkgs/development/libraries/gsm/default.nix
··· 37 37 makeFlags = [ 38 38 "SHELL=${stdenv.shell}" 39 39 "INSTALL_ROOT=$(out)" 40 - ] ++ optional (stdenv.cc.cc.isClang or false) "CC=clang"; 40 + ] ++ optional stdenv.cc.isClang "CC=clang"; 41 41 42 42 preInstall = "mkdir -p $out/{bin,lib,man/man1,man/man3,include/gsm}"; 43 43
+1 -1
pkgs/development/libraries/jbigkit/default.nix
··· 10 10 11 11 postPatch = '' 12 12 sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile 13 - '' + stdenv.lib.optionalString (stdenv.cc.cc.isClang or false) '' 13 + '' + stdenv.lib.optionalString stdenv.cc.isClang '' 14 14 substituteInPlace Makefile libjbig/Makefile pbmtools/Makefile \ 15 15 --replace "CC = gcc" "CC = clang" 16 16 '';
+1 -1
pkgs/development/libraries/judy/default.nix
··· 10 10 11 11 # gcc 4.8 optimisations break judy. 12 12 # http://sourceforge.net/p/judy/mailman/message/31995144/ 13 - preConfigure = stdenv.lib.optionalString (stdenv.cc.cc.isGNU or false) '' 13 + preConfigure = stdenv.lib.optionalString stdenv.cc.isGNU '' 14 14 configureFlagsArray+=("CFLAGS=-fno-strict-aliasing -fno-aggressive-loop-optimizations") 15 15 ''; 16 16
+1 -1
pkgs/development/libraries/libcdr/default.nix
··· 12 12 13 13 nativeBuildInputs = [ pkgconfig ]; 14 14 15 - configureFlags = if (stdenv.cc.cc.isClang or false) 15 + configureFlags = if stdenv.cc.isClang 16 16 then [ "--disable-werror" ] else null; 17 17 18 18 CXXFLAGS="--std=gnu++0x"; # For c++11 constants in lcms2.h
+1 -1
pkgs/development/libraries/libfpx/default.nix
··· 12 12 NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-D__unix" else null; 13 13 14 14 # This dead code causes a duplicate symbol error in Clang so just remove it 15 - postPatch = if (stdenv.cc.cc.isClang or false) then '' 15 + postPatch = if stdenv.cc.isClang then '' 16 16 substituteInPlace jpeg/ejpeg.h --replace "int No_JPEG_Header_Flag" "" 17 17 '' else null; 18 18
+1 -1
pkgs/development/libraries/libmad/default.nix
··· 12 12 # optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad 13 13 # It is included here in order to fix a build failure in Clang 14 14 # But it may be useful to fix other, currently unknown problems as well 15 - ++ stdenv.lib.optional (stdenv.cc.cc.isClang or false) [ ./optimize.diff ]; 15 + ++ stdenv.lib.optional stdenv.cc.isClang [ ./optimize.diff ]; 16 16 17 17 nativeBuildInputs = [ autoconf ]; 18 18
+1 -1
pkgs/development/libraries/librevenge/default.nix
··· 23 23 # Clang generates warnings in Boost's header files 24 24 # -Werror causes these warnings to be interpreted as errors 25 25 # Simplest solution: disable -Werror 26 - configureFlags = if (stdenv.cc.cc.isClang or false) 26 + configureFlags = if stdenv.cc.isClang 27 27 then [ "--disable-werror" ] else null; 28 28 29 29 meta = {
+1 -1
pkgs/development/libraries/libsodium/default.nix
··· 8 8 sha256 = "120jkda2q58p0n68banh64vsfm3hgqnacagj425d218cr4ycdkyb"; 9 9 }; 10 10 11 - NIX_LDFLAGS = stdenv.lib.optionalString (stdenv.cc.cc.isGNU or false) "-lssp"; 11 + NIX_LDFLAGS = stdenv.lib.optionalString stdenv.cc.isGNU "-lssp"; 12 12 13 13 doCheck = true; 14 14
+1 -1
pkgs/development/libraries/pixman/default.nix
··· 14 14 15 15 postInstall = glib.flattenInclude; 16 16 17 - patches = stdenv.lib.optional (stdenv.cc.cc.isClang or false) ./fix-clang36.patch; 17 + patches = stdenv.lib.optional stdenv.cc.isClang ./fix-clang36.patch; 18 18 19 19 meta = { 20 20 homepage = http://pixman.org;
+1 -1
pkgs/development/tools/misc/astyle/default.nix
··· 12 12 sha256 = "1b0f4wm1qmgcswmixv9mwbp86hbdqxk754hml8cjv5vajvqwdpzv"; 13 13 }; 14 14 15 - sourceRoot = if (stdenv.cc.cc.isClang or false) 15 + sourceRoot = if stdenv.cc.isClang 16 16 then "astyle/build/clang" 17 17 else "astyle/build/gcc"; 18 18
+1 -1
pkgs/servers/x11/xorg/overrides.nix
··· 80 80 }; 81 81 82 82 libxkbfile = attrs: attrs // { 83 - patches = lib.optional (stdenv.cc.cc.isClang or false) ./libxkbfile-clang36.patch; 83 + patches = lib.optional stdenv.cc.isClang ./libxkbfile-clang36.patch; 84 84 }; 85 85 86 86 libpciaccess = attrs : attrs // {
+8 -6
pkgs/stdenv/darwin/default.nix
··· 90 90 cc = "/usr"; 91 91 outPath = nativePrefix; 92 92 }; 93 + isClang = true; 93 94 }; 94 95 }; 95 96 pkgs = allPackages { ··· 129 130 130 131 cc = import ../../build-support/cc-wrapper { 131 132 inherit stdenv; 132 - nativeTools = false; 133 - nativeLibc = true; 134 - binutils = pkgs.darwin.cctools; 135 - cc = pkgs.llvmPackages.clang-unwrapped; 136 - coreutils = pkgs.coreutils; 137 - shell = "${pkgs.bash}/bin/bash"; 133 + nativeTools = false; 134 + nativeLibc = true; 135 + binutils = pkgs.darwin.cctools; 136 + cc = pkgs.llvmPackages.clang-unwrapped; 137 + coreutils = pkgs.coreutils; 138 + shell = "${pkgs.bash}/bin/bash"; 138 139 extraPackages = [ pkgs.libcxx ]; 140 + isClang = true; 139 141 }; 140 142 141 143 shell = "${pkgs.bash}/bin/bash";
+2
pkgs/stdenv/linux/default.nix
··· 91 91 nativeTools = false; 92 92 nativeLibc = false; 93 93 cc = gccPlain; 94 + isGNU = true; 94 95 libc = glibc; 95 96 inherit binutils coreutils; 96 97 name = name; ··· 234 235 gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) { 235 236 nativeTools = false; 236 237 nativeLibc = false; 238 + isGNU = true; 237 239 cc = stage4.stdenv.cc.cc; 238 240 libc = stage4.pkgs.glibc; 239 241 inherit (stage4.pkgs) binutils coreutils;
+1
pkgs/stdenv/nix/default.nix
··· 20 20 inherit stdenv; 21 21 binutils = pkgs.binutils; 22 22 cc = pkgs.gcc.cc; 23 + isGNU = true; 23 24 coreutils = pkgs.coreutils; 24 25 shell = pkgs.bash + "/bin/sh"; 25 26 };
+1 -1
pkgs/tools/networking/atftp/default.nix
··· 1 1 { lib, stdenv, fetchurl, readline, tcp_wrappers, pcre, makeWrapper }: 2 2 assert stdenv.isLinux; 3 - assert stdenv.cc.cc.isGNU or false; 3 + assert stdenv.cc.isGNU; 4 4 let 5 5 version = "0.7"; 6 6 debianPatch = fetchurl {
+1 -1
pkgs/tools/security/tor/default.nix
··· 13 13 # ./configure time check for any of this. 14 14 buildInputs = [ libevent openssl zlib torsocks ]; 15 15 16 - CFLAGS = stdenv.lib.optionalString (stdenv.cc.cc.isGNU or false) "-lgcc_s"; 16 + CFLAGS = stdenv.lib.optionalString stdenv.cc.isGNU "-lgcc_s"; 17 17 18 18 # Patch 'torify' to point directly to torsocks. 19 19 patchPhase = ''
+1 -1
pkgs/tools/video/rtmpdump/default.nix
··· 24 24 ++ optional gnutlsSupport "CRYPTO=GNUTLS" 25 25 ++ optional opensslSupport "CRYPTO=OPENSSL" 26 26 ++ optional stdenv.isDarwin "SYS=darwin" 27 - ++ optional (stdenv.cc.cc.isClang or false) "CC=clang"; 27 + ++ optional stdenv.cc.isClang "CC=clang"; 28 28 29 29 buildInputs = [ zlib ] 30 30 ++ optional gnutlsSupport gnutls
+4
pkgs/top-level/all-packages.nix
··· 3437 3437 3438 3438 clangWrapSelf = build: (import ../build-support/cc-wrapper) { 3439 3439 cc = build; 3440 + isClang = true; 3440 3441 stdenv = clangStdenv; 3441 3442 libc = glibc; 3442 3443 binutils = binutils; ··· 4497 4498 nativePrefix = stdenv.cc.nativePrefix or ""; 4498 4499 cc = baseCC; 4499 4500 libc = libc; 4501 + isGNU = baseCC.isGNU or false; 4502 + isClang = baseCC.isClang or false; 4500 4503 inherit stdenv binutils coreutils zlib; 4501 4504 }; 4502 4505 ··· 4536 4539 nativePrefix = stdenv.cc.nativePrefix or ""; 4537 4540 cc = baseGCC; 4538 4541 libc = glibc; 4542 + isGNU = true; 4539 4543 inherit stdenv binutils coreutils zlib; 4540 4544 setupHook = ../build-support/cc-wrapper/setup-hook-stdinc.sh; 4541 4545 };