libcap: Fix static build setting LIBCSTATIC=yes

Fixes the build of pkgsStatic.libcap, as it was trying to link to the
dinamic libc. From libcap-2.69/progs/Makefile:

  ...
  ifeq ($(LIBCSTATIC),yes)
  LDFLAGS = --static
  DEPS = ../libcap/libcap.a
  else
  # For this build variant override the LDFLAGS to link statically from
  # libraries within the build tree. If you never want this, use make
  # DYNAMIC=yes . Note, we can't reliably link statically against glibc
  # becasuse of https://sourceware.org/bugzilla/show_bug.cgi?id=12491 .
  LDFLAGS = -Wl,-Bstatic
  LDFLAGS_SUFFIX = -Wl,-Bdynamic
  DEPS = ../libcap/libcap.a
  endif
  ...
This commit is contained in:
Rodrigo Arias Mallo 2023-11-20 17:47:55 +01:00
parent 5d08323dda
commit 8f82d69669

View file

@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
"BUILD_CC=$(CC_FOR_BUILD)"
"CC:=$(CC)"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
] ++ lib.optional isStatic "SHARED=no";
] ++ lib.optionals isStatic [ "SHARED=no" "LIBCSTATIC=yes" ];
postPatch = ''
patchShebangs ./progs/mkcapshdoc.sh