@@ -1,9 +1,9 @@
11{ stdenv, fetchurl, python, pkgconfig, perl, libxslt, docbook_xsl_ns
22, docbook_xml_dtd_42, readline, talloc, ntdb, tdb, tevent, ldb, popt, iniparser
3−, pythonPackages, libbsd
3+, pythonPackages, libbsd, nss_wrapper, socket_wrapper, uid_wrapper, libarchive
44
55# source3/wscript optionals
6−, heimdal ? null # Samba only supports heimdal for kerberos although mit-krb5 is being worked on
6+, kerberos ? null
77, openldap ? null
88, cups ? null
99, pam ? null
@@ -11,7 +11,6 @@
1111, acl ? null
1212, libaio ? null
1313, fam ? null
14−, ctdb ? null
1514, ceph ? null
1615, glusterfs ? null
1716
@@ -31,21 +30,24 @@
3130}:
3231
3332stdenv.mkDerivation rec {
34− name = "samba-4.1.17";
33+ name = "samba-4.2.0";
3534
3635 src = fetchurl {
3736 url = "mirror://samba/pub/samba/stable/${name}.tar.gz";
38− sha256 = "07fban97xmf4r5y48jp6ajfdki6vx4239lwq9gmvwjy8x44mvsvs";
37+ sha256 = "03s9pjdgq6nlv2lcnlmxlhhj8m5drgv6z4xy9zkgwwd92mw0b9k6";
3938 };
4039
41− patches = [ ./4.x-no-persistent-install.patch ];
40+ patches = [
41+ ./4.x-no-persistent-install.patch
42+ ./4.x-heimdal-compat.patch
43+ ];
4244
4345 buildInputs = [
4446 python pkgconfig perl libxslt docbook_xsl_ns docbook_xml_dtd_42
4547 readline talloc ntdb tdb tevent ldb popt iniparser pythonPackages.subunit
46− libbsd
48+ libbsd nss_wrapper socket_wrapper uid_wrapper libarchive
4749
48− heimdal openldap cups pam avahi acl libaio fam ctdb ceph glusterfs
50+ kerberos openldap cups pam avahi acl libaio fam ceph glusterfs
4951
5052 libiconv gettext
5153
@@ -61,7 +63,7 @@ stdenv.mkDerivation rec {
6163 "--with-static-modules=NONE"
6264 "--with-shared-modules=ALL"
6365 "--with-winbind"
64− ] ++ (if heimdal != null then [ "--with-ads" ] else [ "--without-ads" ])
66+ ] ++ (if kerberos != null then [ "--with-ads" ] else [ "--without-ads" ])
6567 ++ (if openldap != null then [ "--with-ldap" ] else [ "--without-ldap" ])
6668 ++ (if cups != null then [ "--enable-cups" ] else [ "--disable-cups" ])
6769 ++ (if pam != null then [ "--with-pam" "--with-pam_smbpass" ]
@@ -77,27 +79,35 @@ stdenv.mkDerivation rec {
7779 "--with-syslog"
7880 "--with-automount"
7981 ] ++ (if libaio != null then [ "--with-aio-support" ] else [ "--without-aio-support" ])
80− ++ (if fam != null then [ "--with-fam" ] else [ "--without-fam" ])
81− ++ (if ctdb != null then [ "--with-cluster-support" "--with-ctdb-dir=${ctdb}" ]
82− else [ "--without-cluster-support" ])
83− ++ (if ceph != null then [ "--with-libcephfs=${ceph}" ] else [ ])
82+ ++ (if fam != null then [ "--with-fam" ] else [ "--without-fam" ]) ++ [
83+ "--with-cluster-support"
84+ ] ++ (if ceph != null then [ "--with-libcephfs=${ceph}" ] else [ ])
8485 ++ (if glusterfs != null then [ "--enable-glusterfs" ] else [ "--disable-glusterfs" ]) ++ [
86+
8587 # dynconfig/wscript options
8688 "--enable-fhs"
8789 "--sysconfdir=/etc"
8890 "--localstatedir=/var"
8991
9092 # buildtools/wafsamba/wscript options
91− "--bundled-libraries=${if heimdal != null then "NONE" else "com_err"}"
93+ "--bundled-libraries=${if kerberos.implementation == "heimdal" then "NONE" else "com_err"}"
9294 "--private-libraries=NONE"
9395 "--builtin-libraries=replace"
9496 ] ++ (if libiconv != null then [ "--with-libiconv=${libiconv}" ] else [ ])
9597 ++ (if gettext != null then [ "--with-gettext=${gettext}" ] else [ "--without-gettext" ]) ++ [
98+
9699 # source4/lib/tls/wscript options
97100 ] ++ (if gnutls != null && libgcrypt != null && libgpgerror != null
98101 then [ "--enable-gnutls" ] else [ "--disable-gnutls" ]) ++ [
102+
99103 # wscript options
100− ] ++ stdenv.lib.optional (heimdal == null) "--without-ad-dc";
104+ ] ++ stdenv.lib.optional (kerberos.implementation == "krb5") "--with-system-mitkrb5"
105+ ++ stdenv.lib.optional (kerberos == null) "--without-ad-dc" ++ [
106+
107+ # ctdb/wscript
108+ "--enable-infiniband"
109+ "--enable-pmda"
110+ ];
101111
102112 stripAllList = [ "bin" "sbin" ];
103113