about summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/10/default.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-02-07 19:35:20 +0200
committerArtturin <Artturin@artturin.com>2023-02-08 04:07:48 +0200
commit951c2fb2ddc783fc95122163b6982f232ee54900 (patch)
tree4e52178363141d64acae8df3e36fba77c2a41268 /pkgs/development/compilers/gcc/10/default.nix
parentc4269cd7bffdf97dd14746535222dc9ee8fc6c12 (diff)
gcc10,gcc11,gcc12: move dependencies to common/dependencies.nix
Diffstat (limited to 'pkgs/development/compilers/gcc/10/default.nix')
-rw-r--r--pkgs/development/compilers/gcc/10/default.nix52
1 files changed, 25 insertions, 27 deletions
diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix
index 76374201f456d..6ce7779d566e2 100644
--- a/pkgs/development/compilers/gcc/10/default.nix
+++ b/pkgs/development/compilers/gcc/10/default.nix
@@ -158,34 +158,32 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler crossStageStatic
     libcCross crossMingw;
 
-  depsBuildBuild = [ buildPackages.stdenv.cc ];
-  nativeBuildInputs = [ texinfo which gettext ]
-    ++ (optional (perl != null) perl)
-    ++ (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)
-    ;
-
-  # 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 libxcrypt
-    targetPackages.stdenv.cc.bintools # For linking code at run-time
-  ] ++ (optional (isl != null) isl)
-    ++ (optional (zlib != null) zlib)
+  inherit (import ../common/dependencies.nix {
+    inherit
+      lib
+      stdenv
+      buildPackages
+      targetPackages
+      crossStageStatic
+      threadsCross
+      langAda
+      libxcrypt
+      gnatboot
+      version
+      texinfo
+      which
+      gettext
+      gnused
+      patchelf
+      gmp
+      mpfr
+      libmpc
+      isl
+      zlib
+      zip
+      perl
     ;
-
-  depsTargetTarget = optional (!crossStageStatic && threadsCross != {} && threadsCross.package != null) threadsCross.package;
+  }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;
 
   NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";