From 50253a3e84a9a21a6fd29173d04928a31f53c691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Wed, 25 Dec 2013 13:13:02 +0100 Subject: [PATCH] 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.so to libw.so. Provide similar symlinks for the *.pc files: .pc -> w.pc. --- pkgs/development/libraries/ncurses/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 9ba21e99a78..553aa95d834 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -21,12 +21,20 @@ stdenv.mkDerivation (rec { patches = [ ./patch-ac ]; 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"} ''; + # 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 = '' export configureFlags="$configureFlags --includedir=$out/include" + export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" + mkdir -p "$PKG_CONFIG_LIBDIR" ''; selfNativeBuildInput = true; @@ -50,6 +58,7 @@ stdenv.mkDerivation (rec { 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.so.5 $out/lib/lib$lib.so.5 + ln -svf ''${lib}w.pc $out/lib/pkgconfig/$lib.pc fi done; ln -svf . $out/include/ncursesw