samba4: Fix all libraries

This also fixes versioned so files that don't match *.so
This commit is contained in:
Janne Heß 2021-11-07 00:18:07 +01:00
parent 2606cb0fc2
commit 9d8e24e854
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -159,7 +159,7 @@ stdenv.mkDerivation rec {
# Use find -type f -executable -exec echo {} \; -exec sh -c 'ldd {} | grep "not found"' \;
# Looks like a bug in installer scripts.
postFixup = ''
export SAMBA_LIBS="$(find $out -type f -name \*.so -exec dirname {} \; | sort | uniq)"
export SAMBA_LIBS="$(find $out -type f -regex '.*\.so\(\..*\)?' -exec dirname {} \; | sort | uniq)"
read -r -d "" SCRIPT << EOF || true
[ -z "\$SAMBA_LIBS" ] && exit 1;
BIN='{}';
@ -168,7 +168,7 @@ stdenv.mkDerivation rec {
patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?;
patchelf --shrink-rpath "\$BIN";
EOF
find $out -type f -name \*.so -exec $SHELL -c "$SCRIPT" \;
find $out -type f -regex '.*\.so\(\..*\)?' -exec $SHELL -c "$SCRIPT" \;
# Samba does its own shebang patching, but uses build Python
find "$out/bin" -type f -executable -exec \