Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #13514 from abbradar/samba-closure

samba: reduce closure size

+8 -12
+8 -11
pkgs/servers/samba/4.x.nix
··· 5 5 , gnutls, libgcrypt, libgpgerror 6 6 , ncurses, libunwind, libibverbs, librdmacm, systemd 7 7 8 - , enableKerberos ? false 9 8 , enableInfiniband ? false 10 9 , enableLDAP ? false 11 10 , enablePrinting ? false ··· 34 33 buildInputs = 35 34 [ python pkgconfig perl libxslt docbook_xsl docbook_xml_dtd_42 /* 36 35 docbook_xml_dtd_45 */ readline talloc ntdb tdb tevent ldb popt iniparser 37 - libbsd libarchive zlib acl fam libiconv gettext libunwind 36 + libbsd libarchive zlib acl fam libiconv gettext libunwind kerberos 38 37 ] 39 38 ++ optionals stdenv.isLinux [ libaio pam systemd ] 40 - ++ optional enableKerberos kerberos 41 39 ++ optionals (enableInfiniband && stdenv.isLinux) [ libibverbs librdmacm ] 42 40 ++ optional enableLDAP openldap 43 41 ++ optional (enablePrinting && stdenv.isLinux) cups ··· 58 56 configureFlags = 59 57 [ "--with-static-modules=NONE" 60 58 "--with-shared-modules=ALL" 59 + "--with-system-mitkrb5" 61 60 "--enable-fhs" 62 61 "--sysconfdir=/etc" 63 62 "--localstatedir=/var" 64 - "--bundled-libraries=${if enableKerberos && kerberos != null && 65 - kerberos.implementation == "heimdal" then "NONE" else "com_err"}" 63 + "--bundled-libraries=NONE" 66 64 "--private-libraries=NONE" 67 - "--builtin-libraries=replace" 65 + "--builtin-libraries=NONE" 68 66 ] 69 - ++ optional (enableKerberos && kerberos != null && 70 - kerberos.implementation == "krb5") "--with-system-mitkrb5" 71 67 ++ optional (!enableDomainController) "--without-ad-dc" 72 68 ++ optionals (!enableLDAP) [ "--without-ldap" "--without-ads" ]; 73 69 74 70 enableParallelBuilding = true; 75 71 76 - stripAllList = [ "bin" "sbin" ]; 77 - 72 + # Some libraries don't have /lib/samba in RPATH but need it. 73 + # Use find -type f -executable -exec echo {} \; -exec sh -c 'ldd {} | grep "not found"' \; 74 + # Looks like a bug in installer scripts. 78 75 postFixup = '' 79 76 export SAMBA_LIBS="$(find $out -type f -name \*.so -exec dirname {} \; | sort | uniq)" 80 77 read -r -d "" SCRIPT << EOF || true ··· 85 82 patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?; 86 83 patchelf --shrink-rpath "\$BIN"; 87 84 EOF 88 - find $out -type f -exec $SHELL -c "$SCRIPT" \; 85 + find $out -type f -name \*.so -exec $SHELL -c "$SCRIPT" \; 89 86 ''; 90 87 91 88 meta = with stdenv.lib; {
-1
pkgs/top-level/all-packages.nix
··· 9827 9827 9828 9828 samba4 = callPackage ../servers/samba/4.x.nix { 9829 9829 python = python2; 9830 - kerberos = null; # Bundle kerberos because samba uses internal, non-stable functions 9831 9830 # enableLDAP 9832 9831 }; 9833 9832