about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-02-28 22:30:13 +0300
committerNikolay Amiantov <ab@fmap.me>2016-02-28 22:30:13 +0300
commita693d5cc99cefd950e98ece5713ea9be0dc35b41 (patch)
tree56cf45886174d390c7cfa300c15ea7b82465e4d1 /pkgs/servers
parentfe09260465f74ac9d8143b2773f66a89e9e1c9cb (diff)
parent82560aefd705e0a382f0daac7227404a8f58a457 (diff)
downloadnixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar.gz
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar.bz2
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar.lz
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar.xz
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.tar.zst
nixlib-a693d5cc99cefd950e98ece5713ea9be0dc35b41.zip
Merge pull request #13514 from abbradar/samba-closure
samba: reduce closure size
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/samba/4.x.nix19
1 files changed, 8 insertions, 11 deletions
diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix
index 8fcc1a4a9731..4ef47122c289 100644
--- a/pkgs/servers/samba/4.x.nix
+++ b/pkgs/servers/samba/4.x.nix
@@ -5,7 +5,6 @@
 , gnutls, libgcrypt, libgpgerror
 , ncurses, libunwind, libibverbs, librdmacm, systemd
 
-, enableKerberos ? false
 , enableInfiniband ? false
 , enableLDAP ? false
 , enablePrinting ? false
@@ -34,10 +33,9 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ python pkgconfig perl libxslt docbook_xsl docbook_xml_dtd_42 /*
       docbook_xml_dtd_45 */ readline talloc ntdb tdb tevent ldb popt iniparser
-      libbsd libarchive zlib acl fam libiconv gettext libunwind
+      libbsd libarchive zlib acl fam libiconv gettext libunwind kerberos
     ]
     ++ optionals stdenv.isLinux [ libaio pam systemd ]
-    ++ optional enableKerberos kerberos
     ++ optionals (enableInfiniband && stdenv.isLinux) [ libibverbs librdmacm ]
     ++ optional enableLDAP openldap
     ++ optional (enablePrinting && stdenv.isLinux) cups
@@ -58,23 +56,22 @@ stdenv.mkDerivation rec {
   configureFlags =
     [ "--with-static-modules=NONE"
       "--with-shared-modules=ALL"
+      "--with-system-mitkrb5"
       "--enable-fhs"
       "--sysconfdir=/etc"
       "--localstatedir=/var"
-      "--bundled-libraries=${if enableKerberos && kerberos != null &&
-        kerberos.implementation == "heimdal" then "NONE" else "com_err"}"
+      "--bundled-libraries=NONE"
       "--private-libraries=NONE"
-      "--builtin-libraries=replace"
+      "--builtin-libraries=NONE"
     ]
-    ++ optional (enableKerberos && kerberos != null &&
-      kerberos.implementation == "krb5") "--with-system-mitkrb5"
     ++ optional (!enableDomainController) "--without-ad-dc"
     ++ optionals (!enableLDAP) [ "--without-ldap" "--without-ads" ];
 
   enableParallelBuilding = true;
 
-  stripAllList = [ "bin" "sbin" ];
-
+  # Some libraries don't have /lib/samba in RPATH but need it.
+  # 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)"
     read -r -d "" SCRIPT << EOF || true
@@ -85,7 +82,7 @@ stdenv.mkDerivation rec {
     patchelf --set-rpath "\$ALL_LIBS" "\$BIN" 2>/dev/null || exit $?;
     patchelf --shrink-rpath "\$BIN";
     EOF
-    find $out -type f -exec $SHELL -c "$SCRIPT" \;
+    find $out -type f -name \*.so -exec $SHELL -c "$SCRIPT" \;
   '';
 
   meta = with stdenv.lib; {