Unverified Commit 8dc28b27 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #215156 from Artturin/addgcccommondep

gcc: add common/dependencies.nix
parents e24aeba8 951c2fb2
Loading
Loading
Loading
Loading
+25 −27
Original line number Diff line number Diff line
@@ -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";

+25 −27
Original line number Diff line number Diff line
@@ -164,34 +164,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";

+27 −28
Original line number Diff line number Diff line
@@ -198,35 +198,34 @@ 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)
    ++ (optional (langGo && stdenv.hostPlatform.isMusl) libucontext)
  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
    ;

  depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross.package;
  }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;

  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";

+31 −30
Original line number Diff line number Diff line
@@ -158,37 +158,38 @@ 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)
    # 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
    targetPackages.stdenv.cc.bintools # For linking code at run-time
  ] ++ (optional (cloog != null) cloog)
    ++ (optional (isl != null) isl)
    ++ (optional (zlib != null) zlib)
    ++ (optionals langJava [ boehmgc zip unzip ])
    ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
  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
    ;

  depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross;
  }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;

  preConfigure = import ../common/pre-configure.nix {
    inherit lib;
+31 −30
Original line number Diff line number Diff line
@@ -178,37 +178,38 @@ 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)
    # 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
    targetPackages.stdenv.cc.bintools # For linking code at run-time
  ] ++ (optional (cloog != null) cloog)
    ++ (optional (isl != null) isl)
    ++ (optional (zlib != null) zlib)
    ++ (optionals langJava [ boehmgc zip unzip ])
    ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
  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
    ;

  depsTargetTarget = optional (!crossStageStatic && threadsCross != {}) threadsCross;
  }) depsBuildBuild nativeBuildInputs depsBuildTarget buildInputs depsTargetTarget;

  preConfigure = import ../common/pre-configure.nix {
    inherit lib;
Loading