tags 480796 + patch
thanks

Hi,

Attached is the diff for my kazehakase 0.5.4-2.1 NMU.
diff -u kazehakase-0.5.4/debian/changelog kazehakase-0.5.4/debian/changelog
--- kazehakase-0.5.4/debian/changelog
+++ kazehakase-0.5.4/debian/changelog
@@ -1,3 +1,17 @@
+kazehakase (0.5.4-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/control:
+    + Build-depend on xulrunner-dev instead of libxul-dev (closes: #480796).
+    + Version the build dependency on xulrunner-dev, for nsIBadCertListener.
+    + Make kazehakase-gecko depend on xulrunner-1.9.
+  * debian/rules: build with --with-gecko-engine=libxul --disable-gtkmozembed
+    to build against standalone xpcom glue.
+  * debian/patches/90_xulrunner_1.9.dpatch: Better support for xulrunner-1.9.
+  * debian/patches/00list: Added 90_xulrunner_1.9.
+
+ -- Mike Hommey <[EMAIL PROTECTED]>  Sat, 21 Jun 2008 16:34:43 +0200
+
 kazehakase (0.5.4-2) unstable; urgency=low
 
   * Add a Replaces: kazehakase to kazehakase-gecko, as the older version of
diff -u kazehakase-0.5.4/debian/rules kazehakase-0.5.4/debian/rules
--- kazehakase-0.5.4/debian/rules
+++ kazehakase-0.5.4/debian/rules
@@ -45,7 +45,7 @@
 	dh_testdir
 	chmod +x ./configure
 	chmod +x ./mkinstalldirs
-	$(COMPILER_FLAGS) ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --enable-migemo --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --with-gecko-engine=xulrunner --with-ruby=/usr/bin/ruby1.8
+	$(COMPILER_FLAGS) ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --enable-migemo --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --sysconfdir=/etc --with-gecko-engine=libxul --disable-gtkmozembed --with-ruby=/usr/bin/ruby1.8
 
 build: build-stamp 
 build-stamp: patch config.status 
diff -u kazehakase-0.5.4/debian/control kazehakase-0.5.4/debian/control
--- kazehakase-0.5.4/debian/control
+++ kazehakase-0.5.4/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Hidetaka Iwai <[EMAIL PROTECTED]>
 Uploaders: Andres Salomon <[EMAIL PROTECTED]>
-Build-Depends: debhelper(>> 4.0.0), dpatch, libatk1.0-dev, libglib2.0-dev, libgtk2.0-dev (>= 2.12.0), libpango1.0-dev, libxul-dev, libgnutls-dev (>= 1.2.6), ruby1.8, ruby1.8-dev, libgtk2-ruby, libgettext-ruby1.8, libxml-parser-perl, libwebkit-dev
+Build-Depends: debhelper(>> 4.0.0), dpatch, libatk1.0-dev, libglib2.0-dev, libgtk2.0-dev (>= 2.12.0), libpango1.0-dev, xulrunner-dev (>= 1.9~rc2-3), libgnutls-dev (>= 1.2.6), ruby1.8, ruby1.8-dev, libgtk2-ruby, libgettext-ruby1.8, libxml-parser-perl, libwebkit-dev
 Standards-Version: 3.7.3
 
 Package: kazehakase
@@ -22,7 +22,7 @@
 
 Package: kazehakase-gecko
 Architecture: any
-Depends: ${gecko:Depends}
+Depends: ${gecko:Depends}, xulrunner-1.9 (>= 1.9~rc2-3)
 Replaces: kazehakase
 Description: Gecko rendering engine for kazehakase
  Kazehakase is a web browser that can use either Gecko or WebKit as
diff -u kazehakase-0.5.4/debian/patches/00list kazehakase-0.5.4/debian/patches/00list
--- kazehakase-0.5.4/debian/patches/00list
+++ kazehakase-0.5.4/debian/patches/00list
@@ -3,0 +4 @@
+90_xulrunner_1.9
only in patch2:
unchanged:
--- kazehakase-0.5.4.orig/debian/patches/90_xulrunner_1.9.dpatch
+++ kazehakase-0.5.4/debian/patches/90_xulrunner_1.9.dpatch
@@ -0,0 +1,402 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 90_xulrunner_1.9.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Better support for xulrunner 1.9
+
+diff -u kazehakase-0.5.4/debian/rules kazehakase-0.5.4/debian/rules
+--- kazehakase-0.5.4.orig/ext/ruby/Makefile.in
++++ kazehakase-0.5.4/ext/ruby/Makefile.in
+@@ -306,7 +306,6 @@
+ top_srcdir = @top_srcdir@
+ ext_LTLIBRARIES = ruby.la
+ INCLUDES = \
+-	$(MOZILLA_COMPONENT_CFLAGS)			\
+ 	$(GTK_CFLAGS)					\
+ 	$(LIBGNUTLS_CFLAGS)				\
+ 	$(RUBY_CFLAGS)					\
+@@ -354,7 +353,6 @@
+ 	$(GTK_LIBS)				\
+ 	$(LIBGNUTLS_LIBS)			\
+ 	$(RUBY_LIBS)				\
+-	$(MOZILLA_COMPONENT_LIBS)		\
+ 	$(top_builddir)/src/libkazehakase.la
+ 
+ all: all-am
+--- kazehakase-0.5.4.orig/ext/ruby/Makefile.am
++++ kazehakase-0.5.4/ext/ruby/Makefile.am
+@@ -8,7 +8,6 @@
+ 	-DG_DISABLE_DEPRECATED=1
+ 
+ INCLUDES =						\
+-	$(MOZILLA_COMPONENT_CFLAGS)			\
+ 	$(GTK_CFLAGS)					\
+ 	$(LIBGNUTLS_CFLAGS)				\
+ 	$(RUBY_CFLAGS)					\
+@@ -63,5 +62,4 @@
+ 	$(GTK_LIBS)				\
+ 	$(LIBGNUTLS_LIBS)			\
+ 	$(RUBY_LIBS)				\
+-	$(MOZILLA_COMPONENT_LIBS)		\
+ 	$(top_builddir)/src/libkazehakase.la
+--- kazehakase-0.5.4.orig/module/embed/gecko/mozilla.cpp
++++ kazehakase-0.5.4/module/embed/gecko/mozilla.cpp
+@@ -25,6 +25,7 @@
+ 
+ #define MOZILLA_CLIENT
+ 
++#include <mozilla-config.h>
+ #include <gtkmozembed.h>
+ #include <nsXPCOM.h>
+ #include <nsIGenericFactory.h>
+@@ -50,6 +51,10 @@
+ #include <gtkmozembed_glue.cpp>
+ #include <nsGenericFactory.h>
+ #endif
++#ifdef HAVE_GECKO_1_9
++#include <nsComponentManagerUtils.h>
++#endif
++
+ 
+ NS_GENERIC_FACTORY_CONSTRUCTOR(KzFilePicker)
+ NS_GENERIC_FACTORY_CONSTRUCTOR(KzContentHandler)
+--- kazehakase-0.5.4.orig/module/embed/gecko/kz-mozlauncher.cpp
++++ kazehakase-0.5.4/module/embed/gecko/kz-mozlauncher.cpp
+@@ -76,6 +76,9 @@
+ 				    nsISupports *aWindowContext,
+ 				    const PRUnichar *aDefaultFile,
+ 				    const PRUnichar *aSuggestedFileExtension,
++#ifdef HAVE_GECKO_1_9
++				    PRBool aForcePrompt,
++#endif
+ 				    nsILocalFile **_retval)
+ {
+ 	nsresult rv;
+--- kazehakase-0.5.4.orig/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp
++++ kazehakase-0.5.4/module/embed/gecko/gtkmozembed/nsProfileDirServiceProvider2.cpp
+@@ -306,26 +306,6 @@
+         rv = EnsureProfileFileExists(localFile, domainDir);
+     }
+   }
+-  else if (strcmp(prop, NS_APP_MAIL_50_DIR) == 0) {
+-    rv = domainDir->Clone(getter_AddRefs(localFile));
+-    if (NS_SUCCEEDED(rv))
+-      rv = localFile->AppendNative(MAIL_DIR_50_NAME);
+-  }
+-  else if (strcmp(prop, NS_APP_IMAP_MAIL_50_DIR) == 0) {
+-    rv = domainDir->Clone(getter_AddRefs(localFile));
+-    if (NS_SUCCEEDED(rv))
+-      rv = localFile->AppendNative(IMAP_MAIL_DIR_50_NAME);
+-  }
+-  else if (strcmp(prop, NS_APP_NEWS_50_DIR) == 0) {
+-    rv = domainDir->Clone(getter_AddRefs(localFile));
+-    if (NS_SUCCEEDED(rv))
+-      rv = localFile->AppendNative(NEWS_DIR_50_NAME);
+-  }
+-  else if (strcmp(prop, NS_APP_MESSENGER_FOLDER_CACHE_50_DIR) == 0) {
+-    rv = domainDir->Clone(getter_AddRefs(localFile));
+-    if (NS_SUCCEEDED(rv))
+-      rv = localFile->AppendNative(MSG_FOLDER_CACHE_DIR_50_NAME);
+-  }
+   else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
+     rv = domainDir->Clone(getter_AddRefs(localFile));
+     if (NS_SUCCEEDED(rv))
+@@ -518,10 +498,6 @@
+   (void) directoryService->Undefine(NS_APP_BOOKMARKS_50_FILE);
+   (void) directoryService->Undefine(NS_APP_DOWNLOADS_50_FILE);
+   (void) directoryService->Undefine(NS_APP_SEARCH_50_FILE);
+-  (void) directoryService->Undefine(NS_APP_MAIL_50_DIR);
+-  (void) directoryService->Undefine(NS_APP_IMAP_MAIL_50_DIR);
+-  (void) directoryService->Undefine(NS_APP_NEWS_50_DIR);
+-  (void) directoryService->Undefine(NS_APP_MESSENGER_FOLDER_CACHE_50_DIR);
+ 
+   return NS_OK;
+ }
+--- kazehakase-0.5.4.orig/module/embed/gecko/GtkNSSDialogs.cpp	2008-06-15 15:15:10.000000000 +0200
++++ kazehakase-0.5.4/module/embed/gecko/GtkNSSDialogs.cpp	2008-06-15 10:28:47.885635130 +0200
+@@ -53,6 +53,7 @@
+ #include <nsEmbedString.h>
+ #undef MOZILLA_STRICT_API
+ #include <nsIDOMWindow.h>
++#include <nsIMutableArray.h>
+ 
+ #include <gtk/gtk.h>
+ #include <time.h>
+--- kazehakase-0.5.4.orig/module/embed/gecko/GtkPromptService.cpp	2008-03-29 09:20:40.000000000 +0100
++++ kazehakase-0.5.4/module/embed/gecko/GtkPromptService.cpp	2008-06-15 15:13:19.385610265 +0200
+@@ -36,6 +36,7 @@
+  *
+  * ***** END LICENSE BLOCK ***** */
+ 
++#include "config.h"
+ #include "GtkPromptService.h"
+ #include <nsIWindowWatcher.h>
+ #include <nsIWebBrowserChrome.h>
+@@ -49,6 +50,23 @@
+ #include <nsIDOMCharacterData.h>
+ #include <nsIDOMText.h>
+ #include <nsMemory.h>
++#ifdef HAVE_GECKO_1_9
++#include <nsIAuthInformation.h>
++#include <nsIStringBundle.h>
++#include <nsServiceManagerUtils.h>
++/* That is ugly but I didn't find another way, except including
++ * NS_GetAuthHostPort */
++#define kNotFound -1
++NS_COM void AppendUTF16toUTF8( const nsAString& aSource, nsACString& aDest );
++#include <nsStringAPI.h>
++#include <nsIProxiedChannel.h>
++#include <nsIProxyInfo.h>
++#include <nsIIDNService.h>
++#include <nsNetCID.h>
++#include <nsIURI.h>
++#include <nsNetUtil.h>
++#include <nsPromptUtils.h>
++#endif
+ 
+ #include <glib/gi18n.h>
+ #include "kz-prompt-dialog.h"
+@@ -89,8 +107,11 @@
+ {
+ }
+ 
+-
++#ifdef HAVE_GECKO_1_9
++NS_IMPL_ISUPPORTS2(GtkPromptService, nsIPromptService, nsIPromptService2)
++#else
+ NS_IMPL_ISUPPORTS1(GtkPromptService, nsIPromptService)
++#endif
+ 
+ NS_IMETHODIMP
+ GtkPromptService::Alert(nsIDOMWindow* aParent, const PRUnichar* aDialogTitle, 
+@@ -338,10 +359,12 @@
+ 	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
+ 	    						(TYPE_PROMPT_USER_PASS,
+ 	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
++#ifndef HAVE_GECKO_1_9
+ 	gchar *host = GetURIForDOMWindow(aParent);
+ 	kz_prompt_dialog_set_host (prompt, host);
+ 	if (host)
+ 		g_free(host);
++#endif
+ 	kz_prompt_dialog_set_title(prompt,
+ 	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
+ 	kz_prompt_dialog_set_message_text(prompt, cText.get());
+@@ -391,10 +414,12 @@
+ 	KzPromptDialog *prompt = KZ_PROMPT_DIALOG(kz_prompt_dialog_new_with_parent
+ 	    						(TYPE_PROMPT_PASS,
+ 	    					         GTK_WINDOW(GetGtkWindowForDOMWindow(aParent))));
++#ifndef HAVE_GECKO_1_9
+ 	gchar *host = GetURIForDOMWindow(aParent);
+ 	kz_prompt_dialog_set_host (prompt, host);
+ 	if (host)
+ 		g_free(host);
++#endif
+ 	kz_prompt_dialog_set_title(prompt,
+ 	    			   aDialogTitle ? cTitle.get() : _("Prompt"));
+ 	kz_prompt_dialog_set_message_text(prompt, cText.get());
+@@ -510,3 +535,147 @@
+ 	NS_UTF16ToCString(uri, NS_CSTRING_ENCODING_UTF8, c_uri);
+ 	return g_strdup(c_uri.get());
+ }
++
++#ifdef HAVE_GECKO_1_9
++static nsresult
++MakeDialogText(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo,
++               nsString& message)
++{
++  nsresult rv;
++  nsCOMPtr<nsIStringBundleService> bundleSvc =
++    do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
++  NS_ENSURE_SUCCESS(rv, rv);
++
++  nsCOMPtr<nsIStringBundle> bundle;
++  rv = bundleSvc->CreateBundle("chrome://global/locale/prompts.properties",
++                               getter_AddRefs(bundle));
++  NS_ENSURE_SUCCESS(rv, rv);
++
++  // figure out what message to display...
++  nsCAutoString host;
++  PRInt32 port;
++  NS_GetAuthHostPort(aChannel, aAuthInfo, PR_FALSE, host, &port);
++
++  nsAutoString displayHost;
++  CopyUTF8toUTF16(host, displayHost);
++
++  nsCOMPtr<nsIURI> uri;
++  aChannel->GetURI(getter_AddRefs(uri));
++
++  nsCAutoString scheme;
++  uri->GetScheme(scheme);
++
++  nsAutoString username;
++  aAuthInfo->GetUsername(username);
++
++  PRUint32 flags;
++  aAuthInfo->GetFlags(&flags);
++  PRBool proxyAuth = (flags & nsIAuthInformation::AUTH_PROXY) != 0;
++
++  nsAutoString realm;
++  aAuthInfo->GetRealm(realm);
++
++  // Append the port if it was specified
++  if (port != -1) {
++    displayHost.Append(PRUnichar(':'));
++    displayHost.AppendInt(port);
++  }
++
++  NS_NAMED_LITERAL_STRING(proxyText, "EnterLoginForProxy");
++  NS_NAMED_LITERAL_STRING(originText, "EnterLoginForRealm");
++  NS_NAMED_LITERAL_STRING(noRealmText, "EnterUserPasswordFor");
++  NS_NAMED_LITERAL_STRING(passwordText, "EnterPasswordFor");
++
++  const PRUnichar *text;
++  if (proxyAuth) {
++    text = proxyText.get();
++  } else {
++    text = originText.get();
++
++    // prepend "scheme://"
++    nsAutoString schemeU;
++    CopyASCIItoUTF16(scheme, schemeU);
++    schemeU.AppendLiteral("://");
++    displayHost.Insert(schemeU, 0);
++  }
++
++  const PRUnichar *strings[] = { realm.get(), displayHost.get() };
++  PRUint32 count = NS_ARRAY_LENGTH(strings);
++
++  if (flags & nsIAuthInformation::ONLY_PASSWORD) {
++    text = passwordText.get();
++    strings[0] = username.get();
++  } else if (!proxyAuth && realm.IsEmpty()) {
++    text = noRealmText.get();
++    count--;
++    strings[0] = strings[1];
++  }
++
++  rv = bundle->FormatStringFromName(text, strings, count, getter_Copies(message));
++  return rv;
++}
++
++NS_METHOD
++GtkPromptService::PromptAuth(nsIDOMWindow *aParent,
++                              nsIChannel *aChannel,
++                              PRUint32 level,
++                              nsIAuthInformation *authInfo,
++                              const PRUnichar *checkboxLabel,
++                              PRBool *checkValue,
++                              PRBool *retval)
++{
++	NS_ENSURE_ARG_POINTER (retval);
++	NS_ENSURE_ARG_POINTER (authInfo);
++
++  nsString message;
++  MakeDialogText(aChannel, authInfo, message);
++
++  nsAutoString defaultUser, defaultDomain, defaultPass;
++  authInfo->GetUsername(defaultUser);
++  authInfo->GetDomain(defaultDomain);
++  authInfo->GetPassword(defaultPass);
++
++  PRUint32 flags;
++  authInfo->GetFlags(&flags);
++
++  if ((flags & nsIAuthInformation::NEED_DOMAIN) && !defaultDomain.IsEmpty()) {
++    defaultDomain.Append(PRUnichar('\\'));
++    defaultUser.Insert(defaultDomain, 0);
++  }
++
++  // NOTE: Allocation failure is not fatal here (just default to empty string
++  // if allocation fails)
++  PRUnichar *user = ToNewUnicode(defaultUser),
++    *pass = ToNewUnicode(defaultPass);
++  nsresult rv;
++  if (flags & nsIAuthInformation::ONLY_PASSWORD)
++    rv = PromptPassword(aParent, nsnull, message.get(),
++                                  &pass, checkboxLabel,
++                                  checkValue, retval);
++  else
++    rv = PromptUsernameAndPassword(aParent, nsnull, message.get(),
++                                             &user, &pass, checkboxLabel,
++                                             checkValue, retval);
++
++  nsString userStr(user);
++  nsString passStr(pass);
++  authInfo->SetUsername(userStr);
++  authInfo->SetPassword(passStr);
++
++  return rv;
++}
++
++NS_METHOD GtkPromptService::AsyncPromptAuth(nsIDOMWindow *aParent,
++                                            nsIChannel *aChannel,
++                                            nsIAuthPromptCallback *aCallback,
++                                            nsISupports *aContext,
++                                            PRUint32 level,
++                                            nsIAuthInformation *authInfo,
++                                            const PRUnichar *checkboxLabel,
++                                            PRBool *checkValue,
++                                            nsICancelable **retval)
++{
++  return NS_ERROR_NOT_IMPLEMENTED;
++}
++
++#endif
+--- kazehakase-0.5.4/module/embed/gecko/GtkPromptService.h	2008-03-29 09:20:40.000000000 +0100
++++ kazehakase-0.5.4.new/module/embed/gecko/GtkPromptService.h	2008-06-15 13:42:32.787114122 +0200
+@@ -37,7 +37,11 @@
+  *
+  * ***** END LICENSE BLOCK ***** */
+ 
++#ifdef HAVE_GECKO_1_9
++#include <nsIPromptService2.h>
++#else
+ #include <nsIPromptService.h>
++#endif
+ #include <gtk/gtk.h>
+ 
+ #define NS_PROMPTSERVICE_CID \
+@@ -45,7 +49,12 @@
+ 
+ class nsIDOMWindow;
+ 
+-class GtkPromptService : public nsIPromptService
++class GtkPromptService :
++#ifdef HAVE_GECKO_1_9
++	public nsIPromptService2
++#else
++	public nsIPromptService
++#endif
+ {
+ public:
+ 	GtkPromptService();
+@@ -53,6 +62,9 @@
+ 
+ 	NS_DECL_ISUPPORTS
+ 	NS_DECL_NSIPROMPTSERVICE
++#ifdef HAVE_GECKO_1_9
++	NS_DECL_NSIPROMPTSERVICE2
++#endif
+ 
+ private:
+ 	const char *GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
+--- kazehakase-0.5.4.orig/module/embed/gecko/kz-mozutils.h	2008-03-29 09:20:40.000000000 +0100
++++ kazehakase-0.5.4/module/embed/gecko/kz-mozutils.h	2008-06-15 14:58:46.665612336 +0200
+@@ -49,6 +49,8 @@
+  * The following functions is taken from include/necko/nsNetUtils.h in mozilla
+  */
+ 
++#ifndef nsNetUtil_h__
++
+ inline nsresult
+ GetIOService (nsIIOService **ioService)
+ {
+@@ -245,6 +247,6 @@
+ 
+   return resultBuffer;
+ }
+-
++#endif
+ 
+ #endif /* __KZ_MOZ_UTILS_H__ */

Reply via email to