gcc6: move dependencies to common/dependencies.nix

the (vc4 redox) flex conditional was missing in all other gcc version
because gcc6 was the default at the time it was added

that is one of the problems common/dependencies.nix fixes
This commit is contained in:
Artturin
2023-02-08 04:06:21 +02:00
parent 5564beebfe
commit 18f9f26a79
2 changed files with 40 additions and 33 deletions
+33 -31
View File
@@ -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";
@@ -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 ]