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
# compatibility links from the the "normal" libraries to the
# 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
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")"
@ -95,12 +97,12 @@ stdenv.mkDerivation rec {
for dylibtype in so dll dylib; do
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.${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" ]
then
# make libtinfo symlinks
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
done