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