1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

ncurses: fix includedir setting

${out} in configureFlags isn't expanded, so ncursesw5-config ends up
expanding ${out} at *runtime*. Here is the relevant ncursesw5-config
snippet showing how includedir gets its value at runtime.

  bindir="${exec_prefix}/bin"
  includedir="${out}/include"
  libdir="${exec_prefix}/lib"
  datadir="${prefix}/share"
  mandir="${prefix}/man"

When running in a plain shell you get this:
  $ ncursesw5-config --cflags
  -I/include/ncursesw -I/include

And when run in a nix-build shell for e.g. gpsd:
  $ ncursesw5-config --cflags
  -I/nix/store/HASH-gpsd-3.10/include/ncursesw -I/nix/store/HASH-gpsd-3.10/include

This is clearly wrong.

Q: How come this has gone undetected for years?
A: It seems few packages use ncursesw5-config to get the compiler
flags. For example, our python curses module builds its own compiler
flags.

Fix this by moving the --includedir setting to preConfigure where shell
variables are expanded.
This commit is contained in:
Bjørn Forsman 2013-12-08 20:11:40 +01:00
parent 486e7736df
commit 3227c1d215
2 changed files with 11 additions and 3 deletions

View file

@ -19,10 +19,14 @@ stdenv.mkDerivation (rec {
};
configureFlags = ''
--with-shared --includedir=''${out}/include --without-debug
--with-shared --without-debug
${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
'';
preConfigure = ''
export configureFlags="$configureFlags --includedir=$out/include"
'';
selfNativeBuildInput = true;
enableParallelBuilding = true;

View file

@ -18,12 +18,16 @@ stdenv.mkDerivation (rec {
sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
};
patches = [ ./patch-ac ];
configureFlags = ''
--with-shared --includedir=''${out}/include --without-debug
--with-shared --without-debug
${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
'';
patches = [ ./patch-ac ];
preConfigure = ''
export configureFlags="$configureFlags --includedir=$out/include"
'';
selfNativeBuildInput = true;