python: remove ncurses flag

It seems the additional linker flags were added in 9d3b0a2 (May 2008) as
a workaround for readline support. They were kept since then, but it
also means that `python3-config` outputs these flags

```console
$ python3-config --libs
 -lpthread -ldl -lcrypt -lncurses -lutil -lm -lm
```

while other GNU/Linux distros do not. For example, Debian 11:

```console
$ sudo apt install python3-dev
$ python3-config --libs
 -lcrypt -lpthread -ldl  -lutil -lm -lm
```

This change removes the `-lncurses` flag and aligns Nix/NixOS with other
distros.
main
Nicolas Benes 2 years ago committed by Frederik Rietdijk
parent 54aab5dbb7
commit 2f027dff0b
  1. 2
      pkgs/development/interpreters/python/cpython/default.nix

@ -282,7 +282,7 @@ in with passthru; stdenv.mkDerivation {
CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs);
LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs);
LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"} ${optionalString (ncurses != null) "-lncurses"}";
LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}";
NIX_LDFLAGS = lib.optionalString stdenv.cc.isGNU ({
"glibc" = "-lgcc_s";
"musl" = "-lgcc_eh";

Loading…
Cancel
Save