ncurses: Fix shared library extension on darwin

This fixes #36898
This commit is contained in:
Josef Kemetmüller 2018-05-02 21:53:45 +02:00
parent 0c17b75210
commit b4d9113fbf

View file

@ -72,7 +72,9 @@ stdenv.mkDerivation rec {
# When building a wide-character (Unicode) build, create backward # When building a wide-character (Unicode) build, create backward
# compatibility links from the the "normal" libraries to the # compatibility links from the the "normal" libraries to the
# wide-character libraries (e.g. libncurses.so to libncursesw.so). # wide-character libraries (e.g. libncurses.so to libncursesw.so).
postFixup = '' postFixup = let
abiVersion-extension = if stdenv.isDarwin then "${abiVersion}.$dylibtype" else "$dylibtype.${abiVersion}"; in
''
# Determine what suffixes our libraries have # Determine what suffixes our libraries have
suffix="$(awk -F': ' 'f{print $3; f=0} /default library suffix/{f=1}' config.log)" suffix="$(awk -F': ' 'f{print $3; f=0} /default library suffix/{f=1}' config.log)"
libs="$(ls $dev/lib/pkgconfig | tr ' ' '\n' | sed "s,\(.*\)$suffix\.pc,\1,g")" libs="$(ls $dev/lib/pkgconfig | tr ' ' '\n' | sed "s,\(.*\)$suffix\.pc,\1,g")"
@ -95,12 +97,12 @@ stdenv.mkDerivation rec {
for dylibtype in so dll dylib; do for dylibtype in so dll dylib; do
if [ -e "$out/lib/lib''${library}$suffix.$dylibtype" ]; then if [ -e "$out/lib/lib''${library}$suffix.$dylibtype" ]; then
ln -svf lib''${library}$suffix.$dylibtype $out/lib/lib$library$newsuffix.$dylibtype ln -svf lib''${library}$suffix.$dylibtype $out/lib/lib$library$newsuffix.$dylibtype
ln -svf lib''${library}$suffix.$dylibtype.${abiVersion} $out/lib/lib$library$newsuffix.$dylibtype.${abiVersion} ln -svf lib''${library}$suffix.${abiVersion-extension} $out/lib/lib$library$newsuffix.${abiVersion-extension}
if [ "ncurses" = "$library" ] if [ "ncurses" = "$library" ]
then then
# make libtinfo symlinks # make libtinfo symlinks
ln -svf lib''${library}$suffix.$dylibtype $out/lib/libtinfo$newsuffix.$dylibtype ln -svf lib''${library}$suffix.$dylibtype $out/lib/libtinfo$newsuffix.$dylibtype
ln -svf lib''${library}$suffix.$dylibtype.${abiVersion} $out/lib/libtinfo$newsuffix.$dylibtype.${abiVersion} ln -svf lib''${library}$suffix.${abiVersion-extension} $out/lib/libtinfo$newsuffix.${abiVersion-extension}
fi fi
fi fi
done done