@@ -225,16 +225,16 @@ let
225225 # `--with` flags for libraries needed for RTS linker
226226 configureFlags = [
227227 "--datadir=$doc/share/doc/ghc"
228- ] ++ lib . optionals ( ! targetPlatform . isGhcjs && ! targetPlatform . isWasm && ! targetPlatform . isAndroid ) [ "--with-curses-includes=${ targetPackages . ncurses . dev } /include" "--with-curses-libraries=${ targetPackages . ncurses . out } /lib"
229- ] ++ lib . optionals ( targetLibffi != null && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm ) [ "--with-system-libffi" "--with-ffi-includes=${ targetLibffi . dev } /include" "--with-ffi-libraries=${ targetLibffi . out } /lib"
228+ ] ++ lib . optionals ( ! targetPlatform . isGhcjs && ! targetPlatform . isWasm && ! targetPlatform . isAndroid ) [ "--with-curses-includes=${ lib . getDev targetPackages . ncurses } /include" "--with-curses-libraries=${ lib . getLib targetPackages . ncurses } /lib"
229+ ] ++ lib . optionals ( targetLibffi != null && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm ) [ "--with-system-libffi" "--with-ffi-includes=${ lib . getDev targetLibffi } /include" "--with-ffi-libraries=${ lib . getLib targetLibffi } /lib"
230230 ] ++ lib . optionals ( targetPlatform . isWasm ) [
231231 "--with-system-libffi"
232232 ] ++ lib . optionals ( ! enableIntegerSimple && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm ) [
233- "--with-gmp-includes=${ targetGmp . dev } /include" "--with-gmp-libraries=${ targetGmp . out } /lib"
233+ "--with-gmp-includes=${ lib . getDev targetGmp } /include" "--with-gmp-libraries=${ lib . getLib targetGmp } /lib"
234234 ] ++ lib . optionals ( targetPlatform == hostPlatform && hostPlatform . libc != "glibc" && ! targetPlatform . isWindows ) [
235- "--with-iconv-includes=${ libiconv } /include" "--with-iconv-libraries=${ libiconv } /lib"
235+ "--with-iconv-includes=${ lib . getDev libiconv } /include" "--with-iconv-libraries=${ lib . getLib libiconv } /lib"
236236 ] ++ lib . optionals ( targetPlatform != hostPlatform && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm ) [
237- "--with-iconv-includes=${ targetIconv } /include" "--with-iconv-libraries=${ targetIconv } /lib"
237+ "--with-iconv-includes=${ lib . getDev targetIconv } /include" "--with-iconv-libraries=${ lib . getLib targetIconv } /lib"
238238 ] ++ lib . optionals ( targetPlatform != hostPlatform ) [
239239 "--enable-bootstrap-with-devel-snapshot"
240240 ] ++ lib . optionals ( disableLargeAddressSpace ) [
261261 ;
262262
263263 # Splicer will pull out correct variations
264- libDeps = platform : lib . optional ( enableTerminfo && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm && ! targetPlatform . isAndroid ) [ targetPackages . ncurses targetPackages . ncurses . dev ]
264+ libDeps = platform : lib . optional ( enableTerminfo && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm && ! targetPlatform . isAndroid ) [ ( lib . getLib targetPackages . ncurses ) ( lib . getDev targetPackages . ncurses ) ]
265265 ++ lib . optional ( ! targetPlatform . isGhcjs ) targetLibffi
266266 ++ lib . optional ( ! enableIntegerSimple && ! targetPlatform . isGhcjs && ! targetPlatform . isWasm ) gmp
267267 ++ lib . optional ( platform . libc != "glibc" && ! targetPlatform . isWindows ) libiconv
@@ -487,8 +487,8 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
487487 export RANLIB="${ targetCC . bintools . bintools } /bin/${ targetCC . bintools . targetPrefix } ranlib"
488488 export READELF="${ targetCC . bintools . bintools } /bin/${ targetCC . bintools . targetPrefix } readelf"
489489 export STRIP="${ bintoolsFor . strip } /bin/${ bintoolsFor . strip . targetPrefix } strip"
490- export NIX_CFLAGS_COMPILE_FOR_BUILD+=" -I${ libffi . dev } /include -L${ libffi . out } /lib"
491- export NIX_CFLAGS_COMPILE_FOR_TARGET+=" -I${ targetLibffi . dev } /include -L${ targetLibffi . out } /lib"
490+ export NIX_CFLAGS_COMPILE_FOR_BUILD+=" -I${ lib . getDev libffi } /include -L${ lib . getLib libffi } /lib"
491+ export NIX_CFLAGS_COMPILE_FOR_TARGET+=" -I${ lib . getDev targetLibffi } /include -L${ lib . getLib targetLibffi } /lib"
492492 substituteInPlace compiler/GHC.hs --replace-fail "panic \"corrupted wasi-sdk installation\"" "pure \"${ targetPackages . wasilibc } \""
493493 ''
494494 # GHC is a bit confused on its cross terminology, as these would normally be
0 commit comments