3
0
Fork 0
forked from mirrors/nixpkgs

openldap: Get rid of runtime dependency on gcc

The problem here was that the openldap binaries had /tmp/... in their
RPATH *before* $out/lib, so patchelf --shrink-rpath considered the
$out/lib entry unused.

As a workaround, use NIX_LDFLAGS_BEFORE to ensure a proper order.
This commit is contained in:
Eelco Dolstra 2016-09-01 11:31:39 +02:00
parent f1035132f3
commit c861feee18

View file

@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
# TODO: separate "out" and "bin"
outputs = [ "dev" "out" "man" "docdev" ];
enableParallelBuilding = true;
buildInputs = [ openssl cyrus_sasl db groff ];
configureFlags =
@ -20,13 +22,18 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl"
++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
dontPatchELF = 1; # !!!
# Workaround for the issue described in https://github.com/NixOS/patchelf/pull/98.
preConfigure = ''
export NIX_LDFLAGS_BEFORE+=" -rpath $out/lib"
'';
# Fixup broken libtool
preFixup = ''
sed -e 's,-lsasl2,-L${cyrus_sasl.out}/lib -lsasl2,' \
-e 's,-lssl,-L${openssl.out}/lib -lssl,' \
-i $out/lib/libldap.la -i $out/lib/libldap_r.la
rm -rf $out/var
'';
meta = with stdenv.lib; {