changeset 21125:23d046a20aa0

Improved cyrus sasl support on win32: - Actually install the cyrus sasl libraries and plugins - Add INSTDIR/sasl2 to sasl plugin path at runtime so cyrus can find the mechanisms - Remove cyrus sasl bits during uninstallation (installation is still conditional on CYRUS_SASL=1 being defined)
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 03 Nov 2007 20:13:51 +0000
parents 47f0b5c02ea7
children 68fc9d5c43f7
files Makefile.mingw libpurple/protocols/jabber/Makefile.mingw libpurple/protocols/jabber/libxmpp.c pidgin/win32/nsis/pidgin-installer.nsi
diffstat 4 files changed, 50 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.mingw	Sat Nov 03 19:57:01 2007 +0000
+++ b/Makefile.mingw	Sat Nov 03 20:13:51 2007 +0000
@@ -42,19 +42,30 @@
 # Any *.dll or *.exe files included in win32-install-dir that we don't compile
 # should be included in this list so they don't get stripped
 EXTERNAL_DLLS = \
+	comerr32.dll \
 	freebl3.dll \
+	gssapi32.dll \
+	k5sprt32.dll \
+	krb5_32.dll \
 	libgtkspell.dll \
 	libmeanwhile-1.dll \
+	libsasl.dll \
 	libxml2.dll \
 	nspr4.dll \
 	nss3.dll \
 	nssckbi.dll \
 	plc4.dll \
 	plds4.dll \
+	saslANONYMOUS.dll \
+	saslCRAMMD5.dll \
+	saslDIGESTMD5.dll \
+	saslGSSAPI.dll \
+	saslLOGIN.dll \
+	saslPLAIN.dll \
 	silc.dll \
 	silcclient.dll \
+	smime3.dll \
 	softokn3.dll \
-	smime3.dll \
 	ssl3.dll
 
 #build an expression for `find` to use to ignore the above files
--- a/libpurple/protocols/jabber/Makefile.mingw	Sat Nov 03 19:57:01 2007 +0000
+++ b/libpurple/protocols/jabber/Makefile.mingw	Sat Nov 03 20:13:51 2007 +0000
@@ -88,6 +88,21 @@
 INCLUDE_PATHS += -I$(CYRUS_SASL_TOP)/include
 LIB_PATHS += -L$(CYRUS_SASL_TOP)/lib
 LIBS += -llibsasl
+CYRUS_SASL_DLLS = \
+			$(CYRUS_SASL_TOP)/bin/comerr32.dll \
+			$(CYRUS_SASL_TOP)/bin/gssapi32.dll \
+			$(CYRUS_SASL_TOP)/bin/k5sprt32.dll \
+			$(CYRUS_SASL_TOP)/bin/krb5_32.dll \
+			$(CYRUS_SASL_TOP)/bin/libsasl.dll
+
+CYRUS_SASL_PLUGINS = \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslANONYMOUS.dll \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslCRAMMD5.dll \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslDIGESTMD5.dll \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslGSSAPI.dll \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslLOGIN.dll \
+			$(CYRUS_SASL_TOP)/bin/sasl2/saslPLAIN.dll
+
 endif
 
 include $(PIDGIN_COMMON_RULES)
@@ -102,6 +117,11 @@
 install: all $(DLL_INSTALL_DIR)
 	cp $(XMPP_TARGET).dll $(DLL_INSTALL_DIR)
 	cp $(TARGET).dll $(PURPLE_INSTALL_DIR)
+ifeq ($(CYRUS_SASL), 1)
+	mkdir -p $(PURPLE_INSTALL_DIR)/sasl2
+	cp $(CYRUS_SASL_DLLS) $(PURPLE_INSTALL_DIR)
+	cp $(CYRUS_SASL_PLUGINS) $(PURPLE_INSTALL_DIR)/sasl2
+endif
 
 $(OBJECTS): $(PURPLE_CONFIG_H)
 
--- a/libpurple/protocols/jabber/libxmpp.c	Sat Nov 03 19:57:01 2007 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Sat Nov 03 20:13:51 2007 +0000
@@ -193,6 +193,9 @@
 init_plugin(PurplePlugin *plugin)
 {
 #ifdef HAVE_CYRUS_SASL
+#ifdef _WIN32
+	gchar *sasldir;
+#endif
 	int ret;
 #endif
 	PurpleAccountUserSplit *split;
@@ -237,6 +240,11 @@
 	
 	/* XXX - If any other plugin wants SASL this won't be good ... */
 #ifdef HAVE_CYRUS_SASL
+#ifdef _WIN32
+	sasldir = g_build_filename(wpurple_install_dir(), "sasl2", NULL);
+	sasl_set_path(SASL_PATH_TYPE_PLUGIN, sasldir);
+	g_free(sasldir);
+#endif
 	if ((ret = sasl_client_init(NULL)) != SASL_OK) {
 		purple_debug_error("xmpp", "Error (%d) initializing SASL.\n", ret);
 	}
--- a/pidgin/win32/nsis/pidgin-installer.nsi	Sat Nov 03 19:57:01 2007 +0000
+++ b/pidgin/win32/nsis/pidgin-installer.nsi	Sat Nov 03 20:13:51 2007 +0000
@@ -751,6 +751,7 @@
     Delete "$INSTDIR\plugins\win2ktrans.dll"
     Delete "$INSTDIR\plugins\winprefs.dll"
     RMDir "$INSTDIR\plugins"
+    RMDir /r "$INSTDIR\sasl2"
     Delete "$INSTDIR\sounds\purple\alert.wav"
     Delete "$INSTDIR\sounds\purple\login.wav"
     Delete "$INSTDIR\sounds\purple\logout.wav"
@@ -758,23 +759,28 @@
     Delete "$INSTDIR\sounds\purple\send.wav"
     RMDir "$INSTDIR\sounds\purple"
     RMDir "$INSTDIR\sounds"
+    Delete "$INSTDIR\comerr32.dll"
     Delete "$INSTDIR\freebl3.dll"
+    Delete "$INSTDIR\gssapi32.dll"
     Delete "$INSTDIR\idletrack.dll"
+    Delete "$INSTDIR\k5sprt32.dll"
+    Delete "$INSTDIR\krb5_32.dll"
     Delete "$INSTDIR\libgtkspell.dll"
     Delete "$INSTDIR\libjabber.dll"
+    Delete "$INSTDIR\libmeanwhile-1.dll"
     Delete "$INSTDIR\liboscar.dll"
     Delete "$INSTDIR\libpurple.dll"
-    Delete "$INSTDIR\libmeanwhile-1.dll"
+    Delete "$INSTDIR\libsasl.dll"
+    Delete "$INSTDIR\libsilc-1-1-2.dll"
+    Delete "$INSTDIR\libsilcclient-1-1-2.dll"
     Delete "$INSTDIR\libxml2.dll"
     Delete "$INSTDIR\nspr4.dll"
     Delete "$INSTDIR\nss3.dll"
     Delete "$INSTDIR\nssckbi.dll"
+    Delete "$INSTDIR\pidgin.dll"
     Delete "$INSTDIR\pidgin.exe"
-    Delete "$INSTDIR\pidgin.dll"
     Delete "$INSTDIR\plc4.dll"
     Delete "$INSTDIR\plds4.dll"
-    Delete "$INSTDIR\libsilc-1-1-2.dll"
-    Delete "$INSTDIR\libsilcclient-1-1-2.dll"
     Delete "$INSTDIR\smime3.dll"
     Delete "$INSTDIR\softokn3.dll"
     Delete "$INSTDIR\ssl3.dll"