ncurses: install *.pc files (for pkg-config)

To make e.g. "pkg-config --cflags ncursesw" work.

The ncurses expression, when built in unicode/wide char mode, provides
backward compatibility symlinks from lib<name>.so to lib<name>w.so.
Provide similar symlinks for the *.pc files: <name>.pc -> <name>w.pc.
This commit is contained in:
Bjørn Forsman 2013-12-25 13:13:02 +01:00
parent 95f443fda4
commit 50253a3e84

View File

@ -21,12 +21,20 @@ stdenv.mkDerivation (rec {
patches = [ ./patch-ac ]; patches = [ ./patch-ac ];
configureFlags = '' configureFlags = ''
--with-shared --without-debug --with-shared --without-debug --enable-pc-files
${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"} ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
''; '';
# PKG_CONFIG_LIBDIR is where the *.pc files will be installed. If this
# directory doesn't exist, the configure script will disable installation of
# *.pc files. The configure script usually (on LSB distros) pick $(path of
# pkg-config)/../lib/pkgconfig. On NixOS that path doesn't exist and is not
# the place we want to put *.pc files from other packages anyway. So we must
# tell it explicitly where to install with PKG_CONFIG_LIBDIR.
preConfigure = '' preConfigure = ''
export configureFlags="$configureFlags --includedir=$out/include" export configureFlags="$configureFlags --includedir=$out/include"
export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
mkdir -p "$PKG_CONFIG_LIBDIR"
''; '';
selfNativeBuildInput = true; selfNativeBuildInput = true;
@ -50,6 +58,7 @@ stdenv.mkDerivation (rec {
echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so
ln -svf lib''${lib}w.a $out/lib/lib$lib.a ln -svf lib''${lib}w.a $out/lib/lib$lib.a
ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5 ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5
ln -svf ''${lib}w.pc $out/lib/pkgconfig/$lib.pc
fi fi
done; done;
ln -svf . $out/include/ncursesw ln -svf . $out/include/ncursesw