diff --git a/pkgs/servers/samba/default.nix b/pkgs/servers/samba/default.nix index 42d577c55fa..037fa14491c 100644 --- a/pkgs/servers/samba/default.nix +++ b/pkgs/servers/samba/default.nix @@ -28,6 +28,9 @@ stdenv.mkDerivation rec { patches = [ # Fix for https://bugzilla.samba.org/show_bug.cgi?id=8541. ./readlink.patch + + # Allow cross-builds for GNU/Hurd. + ./libnss-wins-pthread.patch ]; buildInputs = [ readline pam openldap popt iniparser libunwind fam acl cups ] @@ -39,7 +42,7 @@ stdenv.mkDerivation rec { # XXX: Awful hack to allow cross-compilation. '' sed -i source3/configure \ -e 's/^as_fn_error \("cannot run test program while cross compiling\)/$as_echo \1/g' - ''; + ''; # " preConfigure = '' cd source3 diff --git a/pkgs/servers/samba/libnss-wins-pthread.patch b/pkgs/servers/samba/libnss-wins-pthread.patch new file mode 100644 index 00000000000..63e1485c20d --- /dev/null +++ b/pkgs/servers/samba/libnss-wins-pthread.patch @@ -0,0 +1,15 @@ +`libnss_wins' uses pthreads but is built without `-pthread'. This is +not a problem when building natively on GNU/Linux, but causes troubles +when cross-building for GNU/Hurd (undefined references to libpthread +functions.) + +--- samba-3.6.1/source3/Makefile.in 2012-02-22 15:25:15.000000000 +0100 ++++ samba-3.6.1/source3/Makefile.in 2012-02-22 15:25:47.000000000 +0100 +@@ -2760,6 +2760,7 @@ bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP + @echo "Linking $@" + @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_OBJ) \ + $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(ZLIB_LIBS) \ ++ $(PTHREAD_LDFLAGS) \ + @SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@ + + bin/winbind_krb5_locator.@SHLIBEXT@: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ) $(LIBWBCLIENT) diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 3e3cb3e3229..34ea73a78bc 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -205,6 +205,7 @@ in { nixUnstable.hostDrv = nativePlatforms; openssl.hostDrv = nativePlatforms; # dependency of Nix patch.hostDrv = nativePlatforms; + samba_light.hostDrv = nativePlatforms; # needed for `runInGenericVM' zile.hostDrv = nativePlatforms; }; }) // (