packages: yelp/yelp-libxul.patch - updated for xulrunner 2.0 (based on Open...

megabajt megabajt at pld-linux.org
Thu Mar 24 20:24:27 CET 2011


Author: megabajt                     Date: Thu Mar 24 19:24:27 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated for xulrunner 2.0 (based on OpenSUSE patch)

---- Files affected:
packages/yelp:
   yelp-libxul.patch (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/yelp/yelp-libxul.patch
diff -u packages/yelp/yelp-libxul.patch:1.3 packages/yelp/yelp-libxul.patch:1.4
--- packages/yelp/yelp-libxul.patch:1.3	Fri Jul  2 00:56:18 2010
+++ packages/yelp/yelp-libxul.patch	Thu Mar 24 20:24:22 2011
@@ -1,46 +1,266 @@
-diff -urN yelp-2.30.1/m4/gecko.m4 yelp-2.30.1.new//m4/gecko.m4
---- yelp-2.30.1/m4/gecko.m4	2010-03-19 15:11:01.000000000 +0100
-+++ yelp-2.30.1.new//m4/gecko.m4	2010-07-02 00:51:40.195866400 +0200
-@@ -119,7 +119,7 @@
+diff -urN yelp-2.30.2/m4/gecko.m4 yelp-2.30.2.new//m4/gecko.m4
+--- yelp-2.30.2/m4/gecko.m4	2010-08-03 21:41:59.000000000 +0200
++++ yelp-2.30.2.new//m4/gecko.m4	2011-03-24 20:18:42.866573902 +0100
+@@ -119,8 +119,8 @@
  	_GECKO_PREFIX="`$PKG_CONFIG --variable=prefix ${gecko_cv_gecko}-xpcom`"
  	_GECKO_NSPR=no # XXX asac: this is currently a blind guess and should be a AC test
  else
 -	_GECKO_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir ${gecko_cv_gecko}`/unstable"
+-	_GECKO_CFLAGS="`$PKG_CONFIG --cflags ${gecko_cv_gecko}` `$PKG_CONFIG --cflags ${gecko_cv_gecko}-unstable`"
 +	_GECKO_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir ${gecko_cv_gecko}`"
- 	_GECKO_CFLAGS="`$PKG_CONFIG --cflags ${gecko_cv_gecko}` `$PKG_CONFIG --cflags ${gecko_cv_gecko}-unstable`"
++	_GECKO_CFLAGS="`$PKG_CONFIG --cflags ${gecko_cv_gecko}` `$PKG_CONFIG --cflags ${gecko_cv_gecko}`"
  	_GECKO_LIBDIR="`$PKG_CONFIG --variable=sdkdir ${gecko_cv_gecko}`/bin"
  	_GECKO_HOME=$with_gecko_home
-diff -urN yelp-2.30.1/src/Makefile.am yelp-2.30.1.new//src/Makefile.am
---- yelp-2.30.1/src/Makefile.am	2010-03-19 15:11:01.000000000 +0100
-+++ yelp-2.30.1.new//src/Makefile.am	2010-07-02 00:52:09.092511415 +0200
-@@ -61,7 +61,8 @@
- 	uriloader	\
- 	webbrwsr	\
- 	webshell	\
--	widget
-+	widget		\
-+	xpcom
- 
- yelp_CPPFLAGS =									\
- 	-I$(top_srcdir)								\
-@@ -84,16 +85,16 @@
- 	$(AM_CXXFLAGS)
- 
- yelp_LDADD =				\
-+	$(MOZILLA_COMPONENT_LIBS)	\
-+	$(MOZILLA_EXTRA_LIBS)		\
-+	$(MOZILLA_GLUE_LIBS)		\
- 	$(YELP_LIBS)			\
- 	$(YELP_SEARCH_LIBS)		\
- 	$(POPT_LIBS)			\
- 	$(Z_LIBS)			\
- 	$(BZ_LIBS)			\
- 	$(LZMADEC_LIBS)			\
--	$(X_LIBS)			\
--	$(MOZILLA_COMPONENT_LIBS)	\
--	$(MOZILLA_EXTRA_LIBS)		\
--	$(MOZILLA_GLUE_LIBS)
-+	$(X_LIBS)
+ 	_GECKO_PREFIX="`$PKG_CONFIG --variable=prefix ${gecko_cv_gecko}`"
+@@ -212,25 +212,6 @@
+ _SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS"
  
- yelp_LDFLAGS = $(AM_LDFLAGS)
+-AC_MSG_CHECKING([[whether we have a gtk 2 gecko build]])
+-AC_RUN_IFELSE(
+-	[AC_LANG_SOURCE(
+-		[[#include <mozilla-config.h>
+-		  #include <string.h>
+-		  #include <stdlib.h>
+-                  int main(void) {
+-		    if (strcmp (MOZ_DEFAULT_TOOLKIT, "gtk2") == 0 ||
+-		        strcmp (MOZ_DEFAULT_TOOLKIT, "cairo-gtk2") == 0)
+-			    return EXIT_SUCCESS;
+-		
+-		    return EXIT_FAILURE;
+-		  } ]]
+-	)],
+-	[result=yes],
+-	[AC_MSG_ERROR([[This program needs a gtk 2 gecko build]])],
+-        [result=maybe])
+-AC_MSG_RESULT([$result])
+-
+ AC_MSG_CHECKING([[whether we have a gecko debug build]])
+ AC_COMPILE_IFELSE(
+ 	[AC_LANG_SOURCE(
+@@ -304,7 +285,9 @@
+ #ifdef MOZILLA_1_8_BRANCH
+ version = "1.8.1";
+ #else
+-if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) {
++if (strncmp (MOZILLA_VERSION, "2.0", strlen ("2.0")) == 0) {
++	version = "2.0";
++} else if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) {
+ 	version = "1.9";
+ } else if (strncmp (MOZILLA_VERSION, "1.8", strlen ("1.8")) == 0) {
+ 	version = "1.8";
+@@ -328,7 +311,7 @@
  
+ gecko_cv_gecko_version_int="$(echo "$gecko_cv_gecko_version" | $AWK -F . '{print [$]1 * 1000000 + [$]2 * 1000 + [$]3}')"
+ 
+-if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "1009000"; then
++if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "2000000"; then
+ 	AC_MSG_ERROR([Gecko version $gecko_cv_gecko_version is not supported!])
+ fi
+ 
+@@ -350,7 +333,10 @@
+ fi
+ 
+ if test "${gecko_cv_gecko}" = "libxul-embedding" -o "${gecko_cv_gecko}" = "libxul"; then
+-	PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1],[gecko_cv_have_gecko_1_9_1=yes gecko_cv_gecko_version="1.9.1" gecko_cv_gecko_version_int=1009001],[gecko_cv_have_gecko_1_9_1=no])
++	PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1],
++        [ gecko_cv_have_gecko_1_9_1=yes
++          if test "$gecko_cv_gecko_version_int" -lt "2000000"; then gecko_cv_gecko_version="1.9.1" gecko_cv_gecko_version_int=1009001; fi
++        ],[gecko_cv_have_gecko_1_9_1=no])
+ else
+ 	gecko_cv_have_gecko_1_9_1=no
+ fi
+@@ -359,6 +345,11 @@
+         AC_DEFINE([HAVE_GECKO_1_9_1],[1],[Define if we have gecko 1.9.1])
+ fi
+ 
++if test "$gecko_cv_gecko_version_int" -ge "2000000"; then
++	AC_DEFINE([HAVE_GECKO_2_0],[1],[Define if we have gecko 2.0])
++	gecko_cv_have_gecko_2_0=yes
++fi
++
+ fi # if gecko_cv_have_gecko
+ 
+ $1[]_VERSION=$gecko_cv_gecko_version
+@@ -376,7 +367,7 @@
+ 	if ! test "$gecko_cv_have_xpcom_glue" = "yes"; then
+ 		gecko_cv_extra_libs="-L$_GECKO_LIBDIR -lxul"
+ 	else
+-		gecko_cv_glue_libs="-L$_GECKO_LIBDIR -lxpcomglue"
++		gecko_cv_glue_libs="-L$_GECKO_LIBDIR -lxpcomglue -ldl"
+ 	fi
+ else
+ 	gecko_cv_extra_pkg_dependencies="${gecko_cv_gecko}-gtkmozembed"
+@@ -407,6 +398,7 @@
+ AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1008001"])
+ AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1009000"])
+ AM_CONDITIONAL([HAVE_GECKO_1_9_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_1_9_1" = "yes"])
++AM_CONDITIONAL([HAVE_GECKO_2_0],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_2_0" = "yes"])
+ AM_CONDITIONAL([HAVE_GECKO_HOME],[test "x$_GECKO_HOME" != "x"])
+ AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test "$gecko_cv_have_debug" = "yes"])
+ AM_CONDITIONAL([HAVE_GECKO_XPCOM_GLUE],[test "$gecko_cv_have_xpcom_glue" = "yes"])
+@@ -432,8 +424,8 @@
+ _SAVE_LDFLAGS="$LDFLAGS"
+ _SAVE_LIBS="$LIBS"
+ if test "${gecko_cv_gecko}" = "libxul-embedding" -o "${gecko_cv_gecko}" = "libxul"; then
+-	CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS $($PKG_CONFIG --cflags-only-I ${gecko_cv_gecko}-unstable)"
+-	CXXFLAGS="$CXXFLAGS $_GECKO_EXTRA_CXXFLAGS $_GECKO_CFLAGS $($PKG_CONFIG --cflags-only-other ${gecko_cv_gecko}-unstable)"
++	CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS $($PKG_CONFIG --cflags-only-I ${gecko_cv_gecko})"
++	CXXFLAGS="$CXXFLAGS $_GECKO_EXTRA_CXXFLAGS $_GECKO_CFLAGS $($PKG_CONFIG --cflags-only-other ${gecko_cv_gecko})"
+ 	LIBS="$LIBS $($PKG_CONFIG --libs ${gecko_cv_gecko}) -ldl"
+ else
+ 	CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS $($PKG_CONFIG --cflags-only-I ${gecko_cv_gecko}-xpcom)"
+diff -urN yelp-2.30.2/src/yelp-gecko-services.cpp yelp-2.30.2.new//src/yelp-gecko-services.cpp
+--- yelp-2.30.2/src/yelp-gecko-services.cpp	2010-08-03 21:41:59.000000000 +0200
++++ yelp-2.30.2.new//src/yelp-gecko-services.cpp	2011-03-24 20:12:54.059907235 +0100
+@@ -32,7 +32,11 @@
+ #include <nsIComponentManager.h>
+ #include <nsComponentManagerUtils.h>
+ #include <nsIComponentRegistrar.h>
++#ifndef HAVE_GECKO_2_0
+ #include <nsIGenericFactory.h>
++#else
++#include <nsIFactory.h>
++#endif
+ #include <nsILocalFile.h>
+ #include <nsIPrintSettings.h>
+ #include <nsServiceManagerUtils.h>
+@@ -418,6 +422,8 @@
+ 
+ /* component registration */
+ 
++#ifndef HAVE_GECKO_2_0
++
+ NS_GENERIC_FACTORY_CONSTRUCTOR(GPrintingPromptService)
+ 
+ static const nsModuleComponentInfo sAppComps[] = {
+@@ -462,3 +468,115 @@
+     }
+     
+ }
++
++#else
++
++/*
++ * Adapted from code from ./embedding/browser/activex/src/control/PromptService.cpp in Firefox
++ */
++
++//*****************************************************************************
++// GPrintingPromptServiceFactory
++//*****************************************************************************
++
++class GPrintingPromptServiceFactory : public nsIFactory
++{
++public:
++    NS_DECL_ISUPPORTS
++    NS_DECL_NSIFACTORY
++
++    GPrintingPromptServiceFactory();
++    virtual ~GPrintingPromptServiceFactory();
++};
++
++//*****************************************************************************
++
++NS_IMPL_ISUPPORTS1(GPrintingPromptServiceFactory, nsIFactory)
++
++GPrintingPromptServiceFactory::GPrintingPromptServiceFactory()
++{
++}
++
++GPrintingPromptServiceFactory::~GPrintingPromptServiceFactory()
++{
++}
++
++NS_IMETHODIMP GPrintingPromptServiceFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult)
++{
++    NS_ENSURE_ARG_POINTER(aResult);
++
++    *aResult = NULL;
++    GPrintingPromptService *inst = new GPrintingPromptService;
++    if (!inst)
++    return NS_ERROR_OUT_OF_MEMORY;
++
++    nsresult rv = inst->QueryInterface(aIID, aResult);
++    if (rv != NS_OK) {
++        // We didn't get the right interface, so clean up
++        delete inst;
++    }
++
++    return rv;
++}
++
++NS_IMETHODIMP GPrintingPromptServiceFactory::LockFactory(PRBool lock)
++{
++    return NS_OK;
++}
++
++//*****************************************************************************
++
++nsresult NS_NewPrintingPromptServiceFactory(nsIFactory** aFactory)
++{
++    NS_ENSURE_ARG_POINTER(aFactory);
++    *aFactory = nsnull;
++
++    GPrintingPromptServiceFactory *result = new GPrintingPromptServiceFactory;
++    if (!result)
++        return NS_ERROR_OUT_OF_MEMORY;
++
++    NS_ADDREF(result);
++    *aFactory = result;
++
++    return NS_OK;
++}
++
++/*
++ * End of adapted code.
++ */
++
++static NS_DEFINE_CID(kGPrintingPromptServiceCID, G_PRINTINGPROMPTSERVICE_CID);
++
++void
++yelp_register_printing ()
++{
++  nsresult rv;
++  nsCOMPtr<nsIComponentRegistrar> cr;
++  rv = NS_GetComponentRegistrar(getter_AddRefs(cr));
++  NS_ENSURE_SUCCESS (rv, );
++
++  nsCOMPtr<nsIComponentManager> cm;
++  rv = NS_GetComponentManager (getter_AddRefs (cm));
++  NS_ENSURE_SUCCESS (rv, );
++
++  nsCOMPtr<nsIFactory> componentFactory;
++  rv = NS_NewPrintingPromptServiceFactory(getter_AddRefs(componentFactory));
++
++  if (NS_FAILED(rv) || !componentFactory)
++    {
++      g_warning ("Failed to make a factory for %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME);
++      return;
++    }
++
++  rv = cr->RegisterFactory(kGPrintingPromptServiceCID,
++			   G_PRINTINGPROMPTSERVICE_CLASSNAME,
++			   G_PRINTINGPROMPTSERVICE_CONTRACTID,
++			   componentFactory);
++  if (NS_FAILED(rv))
++    {
++      g_warning ("Failed to register %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME);
++    }
++
++}
++
++#endif
+diff -urN yelp-2.30.2/src/yelp-gecko-utils.cpp yelp-2.30.2.new//src/yelp-gecko-utils.cpp
+--- yelp-2.30.2/src/yelp-gecko-utils.cpp	2010-08-03 21:41:59.000000000 +0200
++++ yelp-2.30.2.new//src/yelp-gecko-utils.cpp	2011-03-24 20:12:54.059907235 +0100
+@@ -213,8 +213,8 @@
+ 	nsresult rv;
+ #ifdef XPCOM_GLUE
+     static const GREVersionRange greVersion = {
+-    "1.9a", PR_TRUE,
+-    "2", PR_TRUE
++    "2.0a", PR_TRUE,
++    "2.0", PR_TRUE
+     };
+     char xpcomLocation[PATH_MAX];
+     rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, sizeof (xpcomLocation));
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/yelp/yelp-libxul.patch?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list