diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 450b23310337..27d57a509aae 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -193,38 +193,40 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava crossStageStatic libcCross crossMingw; - depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ texinfo which gettext ] - ++ (optional (perl != null) perl) - ++ (optional javaAwtGtk pkg-config) - ++ (optional (with stdenv.targetPlatform; isVc4 || isRedox) flex) - ++ (optional langAda gnatboot) - # The builder relies on GNU sed (for instance, Darwin's `sed' fails with - # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. - ++ (optional buildPlatform.isDarwin gnused) + inherit (import ../common/dependencies.nix { + inherit + lib + stdenv + buildPackages + targetPackages + crossStageStatic + threadsCross + version + langAda + gnatboot + flex + langJava + javaAwtGtk + texinfo + which + gettext + pkg-config + gnused + patchelf + gmp + mpfr + libmpc + isl + zlib + boehmgc + zip + unzip + gtk2 + libart_lgpl + perl + xlibs ; - - # For building runtime libs - depsBuildTarget = - ( - if hostPlatform == buildPlatform then [ - targetPackages.stdenv.cc.bintools # newly-built gcc will be used - ] else assert targetPlatform == hostPlatform; [ # build != host == target - stdenv.cc - ] - ) - ++ optional targetPlatform.isLinux patchelf; - - buildInputs = [ - gmp mpfr libmpc - targetPackages.stdenv.cc.bintools # For linking code at run-time - ] ++ (optional (isl != null) isl) - ++ (optional (zlib != null) zlib) - ++ (optionals langJava [ boehmgc zip unzip ]) - ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs)) - ; - - depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package; + }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; diff --git a/pkgs/development/compilers/gcc/common/dependencies.nix b/pkgs/development/compilers/gcc/common/dependencies.nix index fe6d5a68d1cd..8bb794bf2359 100644 --- a/pkgs/development/compilers/gcc/common/dependencies.nix +++ b/pkgs/development/compilers/gcc/common/dependencies.nix @@ -15,6 +15,8 @@ , cloog ? null , isl ? null , zlib ? null +, gnatboot ? null +, flex ? null , boehmgc , zip , unzip @@ -22,8 +24,9 @@ , libart_lgpl , perl ? null , xlibs ? null -, langJava ? null -, javaAwtGtk ? null +, langJava ? false +, javaAwtGtk ? false +, langAda ? false , crossStageStatic ? null , threadsCross ? null }: @@ -44,6 +47,8 @@ in ] ++ optionals (perl != null) [ perl ] ++ optionals javaAwtGtk [ pkg-config ] + ++ optionals (with stdenv.targetPlatform; isVc4 || isRedox) [ flex ] + ++ optionals langAda [ gnatboot ] # The builder relies on GNU sed (for instance, Darwin's `sed' fails with # "-i may not be used with stdin"), and `stdenvNative' doesn't provide it. ++ optionals buildPlatform.isDarwin [ gnused ]