Merge pull request #144948 from helsinki-systems/feat/samba-patch-all-libs

samba4: Fix all libraries
This commit is contained in:
Janne Heß 2021-11-09 12:33:38 +01:00 committed by GitHub
commit ce5f4a0dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 \