Skip to content

Commit e0e573b

Browse files
committed
libiconvReal: build with bootstrap SDK to avoid infinite recursion on Darwin
1 parent c5b6bb7 commit e0e573b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

pkgs/development/libraries/libiconv/default.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
fetchurl,
33
stdenv,
44
lib,
5+
darwin,
56
updateAutotoolsGnuConfigScriptsHook,
67
enableStatic ? stdenv.hostPlatform.isStatic,
78
enableShared ? !stdenv.hostPlatform.isStatic,
@@ -10,7 +11,12 @@
1011

1112
# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
1213

13-
stdenv.mkDerivation rec {
14+
let
15+
# libiconv is propagated by the SDK in the stdenv. Avoid an infinite recursion by using a stdenv
16+
# with an SDK that does not try to propagate it.
17+
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else stdenv;
18+
in
19+
stdenv'.mkDerivation rec {
1420
pname = "libiconv";
1521
version = "1.19";
1622

@@ -124,6 +130,6 @@ stdenv.mkDerivation rec {
124130
mainProgram = "iconv";
125131

126132
# This library is not needed on GNU platforms.
127-
hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
133+
hydraPlatforms = lib.platforms.cygwin ++ lib.platforms.darwin ++ lib.platforms.freebsd;
128134
};
129135
}

0 commit comments

Comments
 (0)