summary refs log tree commit diff
path: root/pkgs/servers/samba
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-01 15:28:05 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-01 15:35:59 +0200
commit0645f5eab7b98e57cbbf51cab7fc77b4762b44b7 (patch)
tree3aab77d878900ab16376378cff5dfd689e082def /pkgs/servers/samba
parent789f20eba860b769d7153afab42a70fe50688185 (diff)
downloadnixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar.gz
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar.bz2
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar.lz
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar.xz
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.tar.zst
nixpkgs-0645f5eab7b98e57cbbf51cab7fc77b4762b44b7.zip
samba: Revert style changes and get rid of some dependencies
Packages like glusterfs are now optional dependencies. A bunch of
dependencies like subunit are gone: as far as I can tell, these are
only used by Samba's test suite, which we're not even running, so
they're pointless.

Fixes #8067.
Diffstat (limited to 'pkgs/servers/samba')
-rw-r--r--pkgs/servers/samba/4.x.nix170
1 files changed, 50 insertions, 120 deletions
diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix
index 877850f532b..6a6e2469e78 100644
--- a/pkgs/servers/samba/4.x.nix
+++ b/pkgs/servers/samba/4.x.nix
@@ -1,48 +1,23 @@
-{ stdenv, fetchurl, python, pkgconfig, perl, libxslt, docbook_xsl
+{ lib, stdenv, fetchurl, python, pkgconfig, perl, libxslt, docbook_xsl
 , docbook_xml_dtd_42, docbook_xml_dtd_45, readline, talloc, ntdb, tdb, tevent
-, ldb, popt, iniparser, subunit, libbsd, nss_wrapper, socket_wrapper
-, uid_wrapper, libarchive
-
-# source3/wscript optionals
-, kerberos ? null
-, zlib ? null
-, openldap ? null
-, cups ? null
-, pam ? null
-, avahi ? null
-, acl ? null
-, libaio ? null
-, fam ? null
-, libceph ? null
-, glusterfs ? null
-
-# buildtools/wafsamba/wscript optionals
-, libiconv ? null
-, gettext ? null
-
-# source4/lib/tls/wscript optionals
-, gnutls ? null
-, libgcrypt ? null
-, libgpgerror ? null
-
-# other optionals
-, ncurses ? null
-, libunwind ? null
-, dbus ? null
-, libibverbs ? null
-, librdmacm ? null
-, systemd ? null
+, ldb, popt, iniparser, libbsd, libarchive, libiconv, gettext
+, kerberos, zlib, openldap, cups, pam, avahi, acl, libaio, fam, libceph, glusterfs
+, gnutls, libgcrypt, libgpgerror
+, ncurses, libunwind, libibverbs, librdmacm, systemd
+
+, enableKerberos ? false
+, enableInfiniband ? false
+, enableLDAP ? false
+, enablePrinting ? false
+, enableMDNS ? false
+, enableDomainController ? false
+, enableRegedit ? true
+, enableCephFS ? false
+, enableGlusterFS ? false
 }:
 
-assert kerberos != null -> zlib != null;
+with lib;
 
-let
-  bundledLibs = if kerberos != null && kerberos.implementation == "heimdal" then "NONE" else "com_err";
-  hasGnutls = gnutls != null && libgcrypt != null && libgpgerror != null;
-  isKrb5OrNull = if kerberos != null && kerberos.implementation == "krb5" then true else null;
-  hasInfinibandOrNull = if libibverbs != null && librdmacm != null then true else null;
-in
-with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "samba-4.2.1";
 
@@ -51,25 +26,26 @@ stdenv.mkDerivation rec {
     sha256 = "1hsakc8h6rs48xr6i55m90pd53hpxcqjjnlwq8i2rp0nq4ws5sip";
   };
 
-  patches = [
-    ./4.x-no-persistent-install.patch
-    ./4.x-fix-ctdb-deps.patch
-  ] ++ optional (kerberos != null) ./4.x-heimdal-compat.patch;
-
-  buildInputs = [
-    python pkgconfig perl libxslt docbook_xsl docbook_xml_dtd_42
-    docbook_xml_dtd_45 readline talloc ntdb tdb tevent ldb popt iniparser
-    subunit libbsd nss_wrapper socket_wrapper uid_wrapper
-    libarchive
-
-    kerberos zlib openldap cups pam avahi acl libaio fam libceph glusterfs
-
-    libiconv gettext
-
-    gnutls libgcrypt libgpgerror
-
-    ncurses libunwind dbus libibverbs librdmacm systemd
-  ];
+  patches =
+    [ ./4.x-no-persistent-install.patch
+      ./4.x-fix-ctdb-deps.patch
+    ] ++ stdenv.lib.optional enableKerberos ./4.x-heimdal-compat.patch;
+
+  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
+    ]
+    ++ optionals stdenv.isLinux [ libaio pam systemd ]
+    ++ optional enableKerberos kerberos
+    ++ optionals (enableInfiniband && stdenv.isLinux) [ libibverbs librdmacm ]
+    ++ optional enableLDAP openldap
+    ++ optional (enablePrinting && stdenv.isLinux) cups
+    ++ optional enableMDNS avahi
+    ++ optional enableDomainController gnutls
+    ++ optional enableRegedit ncurses
+    ++ optional (enableCephFS && stdenv.isLinux) libceph
+    ++ optional (enableGlusterFS && stdenv.isLinux) glusterfs;
 
   postPatch = ''
     # Removes absolute paths in scripts
@@ -79,70 +55,24 @@ stdenv.mkDerivation rec {
     sed -i "s,\(XML_CATALOG_FILES=\"\),\1$XML_CATALOG_FILES ,g" buildtools/wafsamba/wafsamba.py
   '';
 
-  enableParallelBuilding = true;
-
-  configureFlags = [
-    # source3/wscript options
-    (mkWith   true                 "static-modules"    "NONE")
-    (mkWith   true                 "shared-modules"    "ALL")
-    (mkWith   true                 "winbind"           null)
-    (mkWith   (openldap != null)   "ads"               null)
-    (mkWith   (openldap != null)   "ldap"              null)
-    (mkEnable (cups != null)       "cups"              null)
-    (mkEnable (cups != null)       "iprint"            null)
-    (mkWith   (pam != null)        "pam"               null)
-    (mkWith   (pam != null)        "pam_smbpass"       null)
-    (mkWith   true                 "quotas"            null)
-    (mkWith   true                 "sendfile-support"  null)
-    (mkWith   true                 "utmp"              null)
-    (mkWith   true                 "utmp"              null)
-    (mkEnable true                 "pthreadpool"       null)
-    (mkEnable (avahi != null)      "avahi"             null)
-    (mkWith   true                 "iconv"             null)
-    (mkWith   (acl != null)        "acl-support"       null)
-    (mkWith   true                 "dnsupdate"         null)
-    (mkWith   true                 "syslog"            null)
-    (mkWith   true                 "automount"         null)
-    (mkWith   (libaio != null)     "aio-support"       null)
-    (mkWith   (fam != null)        "fam"               null)
-    (mkWith   (libarchive != null) "libarchive"        null)
-    (mkWith   true                 "cluster-support"   null)
-    (mkWith   (ncurses != null)    "regedit"           null)
-    (mkWith   libceph              "libcephfs"         libceph)
-    (mkEnable (glusterfs != null)  "glusterfs"         null)
-
-    # dynconfig/wscript options
-    (mkEnable true                 "fhs"               null)
-    (mkOther                       "sysconfdir"        "/etc")
-    (mkOther                       "localstatedir"     "/var")
-
-    # buildtools/wafsamba/wscript options
-    (mkOther                       "bundled-libraries" bundledLibs)
-    (mkOther                       "private-libraries" "NONE")
-    (mkOther                       "builtin-libraries" "replace")
-    (mkWith   libiconv             "libiconv"          libiconv)
-    (mkWith   (gettext != null)    "gettext"           gettext)
-
-    # source4/lib/tls/wscript options
-    (mkEnable hasGnutls            "gnutls" null)
+  configureFlags =
+    [ "--with-static-modules=NONE"
+      "--with-shared-modules=ALL"
+      "--enable-fhs"
+      "--sysconfdir=/etc"
+      "--localstatedir=/var"
+      "--bundled-libraries=${if enableKerberos && kerberos.implementation == "heimdal" then "NONE" else "com_err"}"
+      "--private-libraries=NONE"
+      "--builtin-libraries=replace"
+    ]
+    ++ optional (enableKerberos != null && kerberos.implementation == "krb5") "--with-system-mitkrb5"
+    ++ optional (!enableDomainController) "--without-ad-dc"
+    ++ optionals (!enableLDAP) [ "--without-ldap" "--without-ads" ];
 
-    # wscript options
-    (mkWith   isKrb5OrNull         "system-mitkrb5"    null)
-    (if hasGnutls then null else "--without-ad-dc")
-
-    # ctdb/wscript
-    (mkEnable hasInfinibandOrNull  "infiniband"        null)
-    (mkEnable null                 "pmda"              null)
-  ];
+  enableParallelBuilding = true;
 
   stripAllList = [ "bin" "sbin" ];
 
-  postInstall = ''
-    # Remove unecessary components
-    rm -r $out/{lib,share}/ctdb-tests
-    rm $out/bin/ctdb_run{_cluster,}_tests
-  '';
-
   postFixup = ''
     export SAMBA_LIBS="$(find $out -type f -name \*.so -exec dirname {} \; | sort | uniq)"
     read -r -d "" SCRIPT << EOF