summary refs log tree commit diff
path: root/pkgs/development/compilers/gcc/11
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-02-11 00:31:41 +0200
committerArtturin <Artturin@artturin.com>2023-02-11 21:17:30 +0200
commite277984d0b845636e24add13e5c3af8d6d6b0922 (patch)
treefc955940a98377348240d7a9af0259a7f2f1657e /pkgs/development/compilers/gcc/11
parentd4e299de09ab7401629340ec903056af066b6f93 (diff)
downloadnixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar.gz
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar.bz2
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar.lz
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar.xz
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.tar.zst
nixpkgs-e277984d0b845636e24add13e5c3af8d6d6b0922.zip
gcc: add callFile to make it more convenient to call files
inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gccX.cc.override)" | jq '.[]' --raw-output'
Diffstat (limited to 'pkgs/development/compilers/gcc/11')
-rw-r--r--pkgs/development/compilers/gcc/11/default.nix129
1 files changed, 67 insertions, 62 deletions
diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix
index 482cc5f362e..323435272f2 100644
--- a/pkgs/development/compilers/gcc/11/default.nix
+++ b/pkgs/development/compilers/gcc/11/default.nix
@@ -89,6 +89,67 @@ let majorVersion = "11";
     stageNameAddon = if crossStageStatic then "stage-static" else "stage-final";
     crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-";
 
+    callFile = lib.callPackageWith {
+      # lets
+      inherit
+        majorVersion
+        version
+        buildPlatform
+        hostPlatform
+        targetPlatform
+        patches
+        crossMingw
+        stageNameAddon
+        crossNameAddon
+      ;
+      # inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc11.cc.override)" | jq '.[]' --raw-output'
+      inherit
+        binutils
+        buildPackages
+        cloog
+        crossStageStatic
+        enableLTO
+        enableMultilib
+        enablePlugin
+        enableShared
+        fetchpatch
+        fetchurl
+        gettext
+        gmp
+        gnatboot
+        gnused
+        isl
+        langAda
+        langC
+        langCC
+        langD
+        langFortran
+        langGo
+        langJit
+        langObjC
+        langObjCpp
+        lib
+        libcCross
+        libmpc
+        libxcrypt
+        mpfr
+        name
+        noSysDirs
+        patchelf
+        perl
+        profiledCompiler
+        reproducibleBuild
+        staticCompiler
+        stdenv
+        targetPackages
+        texinfo
+        threadsCross
+        which
+        zip
+        zlib
+      ;
+    };
+
 in
 
 stdenv.mkDerivation ({
@@ -164,39 +225,12 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler crossStageStatic
     libcCross crossMingw;
 
-  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
-    ;
-  }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;
+  inherit (callFile ../common/dependencies.nix { })
+    depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;
 
   NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
-  preConfigure = (import ../common/pre-configure.nix {
-    inherit lib;
-    inherit version targetPlatform hostPlatform buildPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib;
-  }) + ''
+  preConfigure = (callFile ../common/pre-configure.nix { }) + ''
     ln -sf ${libxcrypt}/include/crypt.h libsanitizer/sanitizer_common/crypt.h
   '';
 
@@ -204,32 +238,7 @@ stdenv.mkDerivation ({
 
   configurePlatforms = [ "build" "host" "target" ];
 
-  configureFlags = import ../common/configure-flags.nix {
-    inherit
-      lib
-      stdenv
-      targetPackages
-      crossStageStatic libcCross threadsCross
-      version
-
-      binutils gmp mpfr libmpc isl
-
-      enableLTO
-      enableMultilib
-      enablePlugin
-      enableShared
-
-      langC
-      langD
-      langCC
-      langFortran
-      langAda
-      langGo
-      langObjC
-      langObjCpp
-      langJit
-      ;
-  };
+  configureFlags = callFile ../common/configure-flags.nix { };
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
   targetPlatformConfig = targetPlatform.config;
@@ -238,8 +247,7 @@ stdenv.mkDerivation ({
     (targetPlatform == hostPlatform && hostPlatform == buildPlatform)
     (if profiledCompiler then "profiledbootstrap" else "bootstrap");
 
-  inherit
-    (import ../common/strip-attributes.nix { inherit lib stdenv langJit; })
+  inherit (callFile ../common/strip-attributes.nix { })
     stripDebugList
     stripDebugListTarget
     preFixup;
@@ -262,10 +270,7 @@ stdenv.mkDerivation ({
 
   LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib));
 
-  inherit
-    (import ../common/extra-target-flags.nix {
-      inherit lib stdenv crossStageStatic langD libcCross threadsCross;
-    })
+  inherit (callFile ../common/extra-target-flags.nix { })
     EXTRA_FLAGS_FOR_TARGET
     EXTRA_LDFLAGS_FOR_TARGET
     ;