From e277984d0b845636e24add13e5c3af8d6d6b0922 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 11 Feb 2023 00:31:41 +0200 Subject: [PATCH 1/2] 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' --- pkgs/development/compilers/gcc/10/default.nix | 131 ++++++++------- pkgs/development/compilers/gcc/11/default.nix | 129 +++++++------- pkgs/development/compilers/gcc/12/default.nix | 130 +++++++------- .../development/compilers/gcc/4.8/default.nix | 150 +++++++++-------- .../development/compilers/gcc/4.9/default.nix | 150 +++++++++-------- pkgs/development/compilers/gcc/6/default.nix | 158 ++++++++++-------- pkgs/development/compilers/gcc/7/default.nix | 123 +++++++------- pkgs/development/compilers/gcc/8/default.nix | 122 +++++++------- pkgs/development/compilers/gcc/9/default.nix | 127 +++++++------- .../compilers/gcc/common/configure-flags.nix | 3 +- .../compilers/gcc/common/dependencies.nix | 2 +- 11 files changed, 649 insertions(+), 576 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 6ce7779d566e..441bad3ae68f 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -24,7 +24,7 @@ , threadsCross ? null # for MinGW , crossStageStatic ? false , gnused ? null -, cloog # unused; just for compat with gcc4, as we override the parameter on some places +, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places , buildPackages , libxcrypt }: @@ -83,6 +83,67 @@ let majorVersion = "10"; 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 gcc10.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 ({ @@ -158,39 +219,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 ''; @@ -198,32 +232,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; @@ -232,8 +241,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; @@ -256,10 +264,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 ; diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 482cc5f362e5..323435272f27 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 ; diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index 5d8205a75519..955088c3ed1a 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -123,6 +123,67 @@ let majorVersion = "12"; 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 gcc12.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 ({ @@ -198,42 +259,12 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - langAda - langGo - libucontext - 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 ''; @@ -241,32 +272,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; @@ -275,8 +281,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; @@ -299,10 +304,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 ; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index e2e9cb66d0a9..75189b0c81ab 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -111,6 +111,82 @@ let majorVersion = "4"; 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 + javaEcj + javaAntlr + xlibs + javaAwtGtk + crossMingw + stageNameAddon + crossNameAddon + ; + # inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc48.cc.override)" | jq '.[]' --raw-output' + inherit + binutils + boehmgc + buildPackages + cloog + crossStageStatic + enableLTO + enableMultilib + enablePlugin + enableShared + fetchpatch + fetchurl + gettext + gmp + gnused + gtk2 + isl + langC + langCC + langFortran + langGo + langJava + langJit + langObjC + langObjCpp + lib + libICE + libSM + libX11 + libXi + libXrandr + libXrender + libXt + libXtst + libart_lgpl + libcCross threadsCross + libmpc + mpfr + name + noSysDirs + patchelf + perl + pkg-config + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + unzip + which + x11Support + xorgproto + zip + zlib + ; + }; + in # We need all these X libraries when building AWT with GTK. @@ -158,74 +234,16 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - version - langJava - javaAwtGtk - texinfo - which - gettext - pkg-config - gnused - patchelf - gmp - mpfr - libmpc - cloog - isl - zlib - boehmgc - zip - unzip - gtk2 - libart_lgpl - perl - xlibs - ; - }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; + inherit (callFile ../common/dependencies.nix { }) + depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; - preConfigure = import ../common/pre-configure.nix { - inherit lib; - inherit version targetPlatform hostPlatform buildPlatform langJava langGo crossStageStatic enableMultilib; - }; + preConfigure = callFile ../common/pre-configure.nix { }; dontDisableStatic = true; configurePlatforms = [ "build" "host" "target" ]; - configureFlags = import ../common/configure-flags.nix { - inherit - lib - stdenv - targetPackages - crossStageStatic libcCross threadsCross - version - - binutils gmp mpfr libmpc isl - cloog - - enableLTO - enableMultilib - enablePlugin - enableShared - - langC - langCC - langFortran - langJava javaAwtGtk javaAntlr javaEcj - langGo - langObjC - langObjCpp - langJit - ; - }; + configureFlags = callFile ../common/configure-flags.nix { }; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetPlatformConfig = targetPlatform.config; @@ -234,8 +252,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; @@ -273,10 +290,7 @@ stdenv.mkDerivation ({ ++ optionals javaAwtGtk [ gmp mpfr ] )); - inherit - (import ../common/extra-target-flags.nix { - inherit lib stdenv crossStageStatic libcCross threadsCross; - }) + inherit (callFile ../common/extra-target-flags.nix { }) EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index eba68c39fd50..7aa6f261fbc4 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -127,6 +127,82 @@ let majorVersion = "4"; 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 + javaEcj + javaAntlr + xlibs + javaAwtGtk + crossMingw + stageNameAddon + crossNameAddon + ; + # inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc49.cc.override)" | jq '.[]' --raw-output' + inherit + binutils + boehmgc + buildPackages + cloog + crossStageStatic + enableLTO + enableMultilib + enablePlugin + enableShared + fetchpatch + fetchurl + gettext + gmp + gnused + gtk2 + isl + langC + langCC + langFortran + langGo + langJava + langJit + langObjC + langObjCpp + lib + libICE + libSM + libX11 + libXi + libXrandr + libXrender + libXt + libXtst + libart_lgpl + libcCross threadsCross + libmpc + mpfr + name + noSysDirs + patchelf + perl + pkg-config + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + unzip + which + x11Support + xorgproto + zip + zlib + ; + }; + in # We need all these X libraries when building AWT with GTK. @@ -178,74 +254,16 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - version - langJava - javaAwtGtk - texinfo - which - gettext - pkg-config - gnused - patchelf - gmp - mpfr - libmpc - cloog - isl - zlib - boehmgc - zip - unzip - gtk2 - libart_lgpl - perl - xlibs - ; - }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; + inherit (callFile ../common/dependencies.nix { }) + depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget; - preConfigure = import ../common/pre-configure.nix { - inherit lib; - inherit version targetPlatform hostPlatform buildPlatform langJava langGo crossStageStatic enableMultilib; - }; + preConfigure = callFile ../common/pre-configure.nix { }; dontDisableStatic = true; configurePlatforms = [ "build" "host" "target" ]; - configureFlags = import ../common/configure-flags.nix { - inherit - lib - stdenv - targetPackages - crossStageStatic libcCross threadsCross - version - - binutils gmp mpfr libmpc isl - cloog - - enableLTO - enableMultilib - enablePlugin - enableShared - - langC - langCC - langFortran - langJava javaAwtGtk javaAntlr javaEcj - langGo - langObjC - langObjCpp - langJit - ; - }; + configureFlags = callFile ../common/configure-flags.nix { }; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetPlatformConfig = targetPlatform.config; @@ -254,8 +272,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; @@ -293,10 +310,7 @@ stdenv.mkDerivation ({ ++ optionals javaAwtGtk [ gmp mpfr ] )); - inherit - (import ../common/extra-target-flags.nix { - inherit lib stdenv crossStageStatic libcCross threadsCross; - }) + inherit (callFile ../common/extra-target-flags.nix { }) EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 27d57a509aae..f8b5d56e3f3d 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -31,7 +31,7 @@ , threadsCross ? null # for MinGW , crossStageStatic ? false , gnused ? null -, cloog # unused; just for compat with gcc4, as we override the parameter on some places +, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places , buildPackages }: @@ -115,6 +115,86 @@ let majorVersion = "6"; 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 + javaEcj + javaAntlr + xlibs + javaAwtGtk + crossMingw + stageNameAddon + crossNameAddon + ; + # inherit generated with 'nix eval --json --impure --expr "with import ./. {}; lib.attrNames (lib.functionArgs gcc6.cc.override)" | jq '.[]' --raw-output' + inherit + binutils + boehmgc + buildPackages + cloog + crossStageStatic + enableLTO + enableMultilib + enablePlugin + enableShared + fetchFromGitHub + fetchpatch + fetchurl + flex + gettext + gmp + gnatboot + gnused + gtk2 + isl + langAda + langC + langCC + langFortran + langGo + langJava + langJit + langObjC + langObjCpp + lib + libICE + libSM + libX11 + libXi + libXrandr + libXrender + libXt + libXtst + libart_lgpl + libcCross + libmpc + mpfr + name + noSysDirs + patchelf + perl + pkg-config + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + threadsCross + unzip + which + x11Support + xorgproto + zip + zlib + ; + }; in # We need all these X libraries when building AWT with GTK. @@ -193,78 +273,18 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler langJava crossStageStatic libcCross crossMingw; - 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 - ; - }) 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 langJava langAda langGo crossStageStatic enableMultilib; - }; + preConfigure = callFile ../common/pre-configure.nix { }; dontDisableStatic = true; 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 - langCC - langFortran - langJava javaAwtGtk javaAntlr javaEcj - langAda - langGo - langObjC - langObjCpp - langJit - ; - }; + configureFlags = callFile ../common/configure-flags.nix { }; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetPlatformConfig = targetPlatform.config; @@ -273,8 +293,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; @@ -312,10 +331,7 @@ stdenv.mkDerivation ({ ++ optionals javaAwtGtk [ gmp mpfr ] )); - inherit - (import ../common/extra-target-flags.nix { - inherit lib stdenv crossStageStatic libcCross threadsCross; - }) + inherit (callFile ../common/extra-target-flags.nix { }) EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index d22e85c61adc..ee55a9eac521 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -21,7 +21,7 @@ , threadsCross ? null # for MinGW , crossStageStatic ? false , gnused ? null -, cloog # unused; just for compat with gcc4, as we override the parameter on some places +, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places , buildPackages }: @@ -91,6 +91,63 @@ let majorVersion = "7"; 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 gcc7.cc.override)" | jq '.[]' --raw-output' + inherit + binutils + buildPackages + cloog + crossStageStatic + enableLTO + enableMultilib + enablePlugin + enableShared + fetchpatch + fetchurl + gettext + gmp + gnused + isl + langC + langCC + langFortran + langGo + langJit + langObjC + langObjCpp + lib + libcCross + libmpc + mpfr + name + noSysDirs + patchelf + perl + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + threadsCross + which + zip + zlib + ; + }; + in stdenv.mkDerivation ({ @@ -165,66 +222,20 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - 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_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"; NIX_LDFLAGS = lib.optionalString hostPlatform.isSunOS "-lm -ldl"; - preConfigure = import ../common/pre-configure.nix { - inherit lib; - inherit version targetPlatform hostPlatform buildPlatform langGo crossStageStatic enableMultilib; - }; + preConfigure = callFile ../common/pre-configure.nix { }; dontDisableStatic = true; 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 - langCC - langFortran - langGo - langObjC - langObjCpp - langJit - ; - } ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419" + configureFlags = (callFile ../common/configure-flags.nix { }) + ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419" ++ optional targetPlatform.isNetBSD "--disable-libcilkrts" ; @@ -235,8 +246,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; @@ -261,10 +271,7 @@ stdenv.mkDerivation ({ LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - inherit - (import ../common/extra-target-flags.nix { - inherit lib stdenv crossStageStatic libcCross threadsCross; - }) + inherit (callFile ../common/extra-target-flags.nix { }) EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 2b43fc124bf0..dbcdd6a22a55 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -21,7 +21,7 @@ , threadsCross ? null # for MinGW , crossStageStatic ? false , gnused ? null -, cloog # unused; just for compat with gcc4, as we override the parameter on some places +, cloog ? null # unused; just for compat with gcc4, as we override the parameter on some places , buildPackages }: @@ -73,6 +73,63 @@ let majorVersion = "8"; 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 gcc8.cc.override)" | jq '.[]' --raw-output' + inherit + binutils + buildPackages + cloog + crossStageStatic + enableLTO + enableMultilib + enablePlugin + enableShared + fetchpatch + fetchurl + gettext + gmp + gnused + isl + langC + langCC + langFortran + langGo + langJit + langObjC + langObjCpp + lib + libcCross + libmpc + mpfr + name + noSysDirs + patchelf + perl + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + threadsCross + which + zip + zlib + ; + }; + in stdenv.mkDerivation ({ @@ -147,65 +204,18 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - 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 langGo crossStageStatic enableMultilib; - }; + preConfigure = callFile ../common/pre-configure.nix { }; dontDisableStatic = true; 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 - langCC - langFortran - langGo - langObjC - langObjCpp - langJit - ; - }; + configureFlags = callFile ../common/configure-flags.nix { }; targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null; targetPlatformConfig = targetPlatform.config; @@ -214,8 +224,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; @@ -238,10 +247,7 @@ stdenv.mkDerivation ({ LIBRARY_PATH = optionals (targetPlatform == hostPlatform) (makeLibraryPath (optional (zlib != null) zlib)); - inherit - (import ../common/extra-target-flags.nix { - inherit lib stdenv crossStageStatic libcCross threadsCross; - }) + inherit (callFile ../common/extra-target-flags.nix { }) EXTRA_FLAGS_FOR_TARGET EXTRA_LDFLAGS_FOR_TARGET ; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index ebf0bf056390..74432b3e3c1c 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -84,6 +84,66 @@ let majorVersion = "9"; 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 gcc9.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 + mpfr + name + noSysDirs + patchelf + perl + profiledCompiler + reproducibleBuild + staticCompiler + stdenv + targetPackages + texinfo + threadsCross + which + zip + zlib + ; + }; + in stdenv.mkDerivation ({ @@ -158,69 +218,18 @@ stdenv.mkDerivation ({ inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; - inherit (import ../common/dependencies.nix { - inherit - lib - stdenv - buildPackages - targetPackages - crossStageStatic - threadsCross - langAda - 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 { }; dontDisableStatic = true; 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; @@ -229,8 +238,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; @@ -253,10 +261,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 ; diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index 25e59148440a..78d13cb941e3 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -25,7 +25,6 @@ , langJit }: -assert cloog != null -> lib.versionOlder version "5"; assert langJava -> lib.versionOlder version "7"; # Note [Windows Exception Handling] @@ -188,7 +187,7 @@ let # Optional features ++ lib.optional (isl != null) "--with-isl=${isl}" - ++ lib.optionals (cloog != null) [ + ++ lib.optionals (lib.versionOlder version "5" && cloog != null) [ "--with-cloog=${cloog}" "--disable-cloog-version-check" "--enable-cloog-backend=isl" diff --git a/pkgs/development/compilers/gcc/common/dependencies.nix b/pkgs/development/compilers/gcc/common/dependencies.nix index a193ec887a0a..d3ae3e33c46c 100644 --- a/pkgs/development/compilers/gcc/common/dependencies.nix +++ b/pkgs/development/compilers/gcc/common/dependencies.nix @@ -79,7 +79,7 @@ in ++ [ targetPackages.stdenv.cc.bintools # For linking code at run-time ] - ++ optionals (cloog != null) [ cloog ] + ++ optionals (lib.versionOlder version "5" && cloog != null) [ cloog ] ++ optionals (isl != null) [ isl ] ++ optionals (zlib != null) [ zlib ] ++ optionals langJava [ boehmgc zip unzip ] From 6986717510265f9135c88655f64efb8b316503e8 Mon Sep 17 00:00:00 2001 From: Artturin Date: Sat, 11 Feb 2023 23:20:56 +0200 Subject: [PATCH 2/2] gcc: add common/meta.nix inherit has to be used otherwise makeOverridable attributes are added --- pkgs/development/compilers/gcc/10/default.nix | 25 +++++++------------ pkgs/development/compilers/gcc/11/default.nix | 24 ++++++------------ pkgs/development/compilers/gcc/12/default.nix | 24 ++++++------------ .../development/compilers/gcc/4.8/default.nix | 24 ++++++------------ .../development/compilers/gcc/4.9/default.nix | 24 ++++++------------ pkgs/development/compilers/gcc/6/default.nix | 22 ++++++---------- pkgs/development/compilers/gcc/7/default.nix | 24 ++++++------------ pkgs/development/compilers/gcc/8/default.nix | 24 ++++++------------ pkgs/development/compilers/gcc/9/default.nix | 24 ++++++------------ .../development/compilers/gcc/common/meta.nix | 19 ++++++++++++++ 10 files changed, 92 insertions(+), 142 deletions(-) create mode 100644 pkgs/development/compilers/gcc/common/meta.nix diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 441bad3ae68f..97ed0ee9b058 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -278,24 +278,17 @@ stdenv.mkDerivation ({ inherit enableMultilib enableShared; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; + } // optionalAttrs (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt" && crossStageStatic) { diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 323435272f27..f29da83bb570 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -284,22 +284,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; }; } diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index 955088c3ed1a..3a8af389469b 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -318,22 +318,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; }; } diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 75189b0c81ab..cee54a092178 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -305,22 +305,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well - as libraries for these languages (libstdc++, libgcj, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = with lib.maintainers; [ veprbl ]; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = lib.platforms.darwin; }; } diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 7aa6f261fbc4..e1ae025cd272 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -324,22 +324,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well - as libraries for these languages (libstdc++, libgcj, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = with lib.maintainers; [ veprbl ]; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; } diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index f8b5d56e3f3d..c3410a72fc7d 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -345,20 +345,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, Java, and Ada, as well - as libraries for these languages (libstdc++, libgcj, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; } diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index ee55a9eac521..4d8d1f51ff67 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -285,22 +285,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; } diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index dbcdd6a22a55..e19d0888f00b 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -261,22 +261,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; } diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 74432b3e3c1c..ae26908a10aa 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -275,22 +275,14 @@ stdenv.mkDerivation ({ inherit enableShared enableMultilib; meta = { - homepage = "https://gcc.gnu.org/"; - license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; - - longDescription = '' - The GNU Compiler Collection includes compiler front ends for C, C++, - Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as - libraries for these languages (libstdc++, libgomp,...). - - GCC development is a part of the GNU Project, aiming to improve the - compiler used in the GNU system including the GNU/Linux variant. - ''; - - maintainers = lib.teams.gcc.members; - - platforms = lib.platforms.unix; + inherit (callFile ../common/meta.nix { }) + homepage + license + description + longDescription + platforms + maintainers + ; badPlatforms = [ "aarch64-darwin" ]; }; } diff --git a/pkgs/development/compilers/gcc/common/meta.nix b/pkgs/development/compilers/gcc/common/meta.nix new file mode 100644 index 000000000000..84c3dc189b1f --- /dev/null +++ b/pkgs/development/compilers/gcc/common/meta.nix @@ -0,0 +1,19 @@ +{ lib, version, }: + +with lib; { + homepage = "https://gcc.gnu.org/"; + license = licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ + description = "GNU Compiler Collection, version ${version}"; + longDescription = '' + The GNU Compiler Collection includes compiler front ends for C, C++, + Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as + libraries for these languages (libstdc++, libgomp,...). + + GCC development is a part of the GNU Project, aiming to improve the + compiler used in the GNU system including the GNU/Linux variant. + ''; + + platforms = platforms.unix; + maintainers = if versionOlder version "5" then [ maintainers.veprbl ] else teams.gcc.members; + +}