1 |
tetromino 11/11/24 03:49:04 |
2 |
|
3 |
Added: yelp-2.30.2-port-to-xulrunner-2-r2.patch |
4 |
Removed: yelp-2.30.2-port-to-xulrunner-2-r1.patch |
5 |
Log: |
6 |
Trivially modify port-to-xulrunner-2 patch for backwards compatibility with xulrunner-1.9, requested by robbat2. |
7 |
|
8 |
(Portage version: 2.2.0_alpha77/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 gnome-extra/yelp/files/yelp-2.30.2-port-to-xulrunner-2-r2.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-extra/yelp/files/yelp-2.30.2-port-to-xulrunner-2-r2.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/gnome-extra/yelp/files/yelp-2.30.2-port-to-xulrunner-2-r2.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: yelp-2.30.2-port-to-xulrunner-2-r2.patch |
17 |
=================================================================== |
18 |
https://bugs.gentoo.org/show_bug.cgi?id=330847 |
19 |
|
20 |
Patch by the OpenSUSE folks, found by pacho. |
21 |
Updated with https://build.opensuse.org/request/show/69983 |
22 |
Updated to extend lower bound of greVersion in yelp_gecko_init() down to 1.9a |
23 |
|
24 |
Index: yelp-2.30.2/m4/gecko.m4 |
25 |
=================================================================== |
26 |
--- yelp-2.30.2.orig/m4/gecko.m4 |
27 |
+++ yelp-2.30.2/m4/gecko.m4 |
28 |
@@ -212,25 +212,6 @@ AC_LANG_PUSH([C++]) |
29 |
_SAVE_CPPFLAGS="$CPPFLAGS" |
30 |
CPPFLAGS="$CPPFLAGS $_GECKO_EXTRA_CPPFLAGS $_GECKO_CFLAGS" |
31 |
|
32 |
-AC_MSG_CHECKING([[whether we have a gtk 2 gecko build]]) |
33 |
-AC_RUN_IFELSE( |
34 |
- [AC_LANG_SOURCE( |
35 |
- [[#include <mozilla-config.h> |
36 |
- #include <string.h> |
37 |
- #include <stdlib.h> |
38 |
- int main(void) { |
39 |
- if (strcmp (MOZ_DEFAULT_TOOLKIT, "gtk2") == 0 || |
40 |
- strcmp (MOZ_DEFAULT_TOOLKIT, "cairo-gtk2") == 0) |
41 |
- return EXIT_SUCCESS; |
42 |
- |
43 |
- return EXIT_FAILURE; |
44 |
- } ]] |
45 |
- )], |
46 |
- [result=yes], |
47 |
- [AC_MSG_ERROR([[This program needs a gtk 2 gecko build]])], |
48 |
- [result=maybe]) |
49 |
-AC_MSG_RESULT([$result]) |
50 |
- |
51 |
AC_MSG_CHECKING([[whether we have a gecko debug build]]) |
52 |
AC_COMPILE_IFELSE( |
53 |
[AC_LANG_SOURCE( |
54 |
@@ -304,7 +285,9 @@ if (!stream) return 126; |
55 |
#ifdef MOZILLA_1_8_BRANCH |
56 |
version = "1.8.1"; |
57 |
#else |
58 |
-if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) { |
59 |
+if (strncmp (MOZILLA_VERSION, "2.0", strlen ("2.0")) == 0) { |
60 |
+ version = "2.0"; |
61 |
+} else if (strncmp (MOZILLA_VERSION, "1.9", strlen ("1.9")) == 0) { |
62 |
version = "1.9"; |
63 |
} else if (strncmp (MOZILLA_VERSION, "1.8", strlen ("1.8")) == 0) { |
64 |
version = "1.8"; |
65 |
@@ -328,7 +311,7 @@ AC_LANG_POP([C++]) |
66 |
|
67 |
gecko_cv_gecko_version_int="$(echo "$gecko_cv_gecko_version" | $AWK -F . '{print [$]1 * 1000000 + [$]2 * 1000 + [$]3}')" |
68 |
|
69 |
-if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "1009000"; then |
70 |
+if test "$gecko_cv_gecko_version_int" -lt "1007000" -o "$gecko_cv_gecko_version_int" -gt "2000000"; then |
71 |
AC_MSG_ERROR([Gecko version $gecko_cv_gecko_version is not supported!]) |
72 |
fi |
73 |
|
74 |
@@ -350,7 +333,10 @@ if test "$gecko_cv_gecko_version_int" -g |
75 |
fi |
76 |
|
77 |
if test "${gecko_cv_gecko}" = "libxul-embedding" -o "${gecko_cv_gecko}" = "libxul"; then |
78 |
- 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]) |
79 |
+ PKG_CHECK_EXISTS([${gecko_cv_gecko} >= 1.9.1], |
80 |
+ [ gecko_cv_have_gecko_1_9_1=yes |
81 |
+ if test "$gecko_cv_gecko_version_int" -lt "2000000"; then gecko_cv_gecko_version="1.9.1" gecko_cv_gecko_version_int=1009001; fi |
82 |
+ ],[gecko_cv_have_gecko_1_9_1=no]) |
83 |
else |
84 |
gecko_cv_have_gecko_1_9_1=no |
85 |
fi |
86 |
@@ -359,6 +345,11 @@ if test "$gecko_cv_have_gecko_1_9_1" = " |
87 |
AC_DEFINE([HAVE_GECKO_1_9_1],[1],[Define if we have gecko 1.9.1]) |
88 |
fi |
89 |
|
90 |
+if test "$gecko_cv_gecko_version_int" -ge "2000000"; then |
91 |
+ AC_DEFINE([HAVE_GECKO_2_0],[1],[Define if we have gecko 2.0]) |
92 |
+ gecko_cv_have_gecko_2_0=yes |
93 |
+fi |
94 |
+ |
95 |
fi # if gecko_cv_have_gecko |
96 |
|
97 |
$1[]_VERSION=$gecko_cv_gecko_version |
98 |
@@ -407,6 +398,7 @@ AM_CONDITIONAL([HAVE_GECKO_1_8],[test "$ |
99 |
AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1008001"]) |
100 |
AM_CONDITIONAL([HAVE_GECKO_1_9],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_gecko_version_int" -ge "1009000"]) |
101 |
AM_CONDITIONAL([HAVE_GECKO_1_9_1],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_1_9_1" = "yes"]) |
102 |
+AM_CONDITIONAL([HAVE_GECKO_2_0],[test "$gecko_cv_have_gecko" = "yes" -a "$gecko_cv_have_gecko_2_0" = "yes"]) |
103 |
AM_CONDITIONAL([HAVE_GECKO_HOME],[test "x$_GECKO_HOME" != "x"]) |
104 |
AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test "$gecko_cv_have_debug" = "yes"]) |
105 |
AM_CONDITIONAL([HAVE_GECKO_XPCOM_GLUE],[test "$gecko_cv_have_xpcom_glue" = "yes"]) |
106 |
Index: yelp-2.30.2/src/yelp-gecko-services.cpp |
107 |
=================================================================== |
108 |
--- yelp-2.30.2.orig/src/yelp-gecko-services.cpp |
109 |
+++ yelp-2.30.2/src/yelp-gecko-services.cpp |
110 |
@@ -32,7 +32,11 @@ |
111 |
#include <nsIComponentManager.h> |
112 |
#include <nsComponentManagerUtils.h> |
113 |
#include <nsIComponentRegistrar.h> |
114 |
+#ifndef HAVE_GECKO_2_0 |
115 |
#include <nsIGenericFactory.h> |
116 |
+#else |
117 |
+#include <nsIFactory.h> |
118 |
+#endif |
119 |
#include <nsILocalFile.h> |
120 |
#include <nsIPrintSettings.h> |
121 |
#include <nsServiceManagerUtils.h> |
122 |
@@ -418,6 +422,8 @@ PrintListener::SetPrintSettings (YelpPri |
123 |
|
124 |
/* component registration */ |
125 |
|
126 |
+#ifndef HAVE_GECKO_2_0 |
127 |
+ |
128 |
NS_GENERIC_FACTORY_CONSTRUCTOR(GPrintingPromptService) |
129 |
|
130 |
static const nsModuleComponentInfo sAppComps[] = { |
131 |
@@ -462,3 +468,115 @@ yelp_register_printing () |
132 |
} |
133 |
|
134 |
} |
135 |
+ |
136 |
+#else |
137 |
+ |
138 |
+/* |
139 |
+ * Adapted from code from ./embedding/browser/activex/src/control/PromptService.cpp in Firefox |
140 |
+ */ |
141 |
+ |
142 |
+//***************************************************************************** |
143 |
+// GPrintingPromptServiceFactory |
144 |
+//***************************************************************************** |
145 |
+ |
146 |
+class GPrintingPromptServiceFactory : public nsIFactory |
147 |
+{ |
148 |
+public: |
149 |
+ NS_DECL_ISUPPORTS |
150 |
+ NS_DECL_NSIFACTORY |
151 |
+ |
152 |
+ GPrintingPromptServiceFactory(); |
153 |
+ virtual ~GPrintingPromptServiceFactory(); |
154 |
+}; |
155 |
+ |
156 |
+//***************************************************************************** |
157 |
+ |
158 |
+NS_IMPL_ISUPPORTS1(GPrintingPromptServiceFactory, nsIFactory) |
159 |
+ |
160 |
+GPrintingPromptServiceFactory::GPrintingPromptServiceFactory() |
161 |
+{ |
162 |
+} |
163 |
+ |
164 |
+GPrintingPromptServiceFactory::~GPrintingPromptServiceFactory() |
165 |
+{ |
166 |
+} |
167 |
+ |
168 |
+NS_IMETHODIMP GPrintingPromptServiceFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) |
169 |
+{ |
170 |
+ NS_ENSURE_ARG_POINTER(aResult); |
171 |
+ |
172 |
+ *aResult = NULL; |
173 |
+ GPrintingPromptService *inst = new GPrintingPromptService; |
174 |
+ if (!inst) |
175 |
+ return NS_ERROR_OUT_OF_MEMORY; |
176 |
+ |
177 |
+ nsresult rv = inst->QueryInterface(aIID, aResult); |
178 |
+ if (rv != NS_OK) { |
179 |
+ // We didn't get the right interface, so clean up |
180 |
+ delete inst; |
181 |
+ } |
182 |
+ |
183 |
+ return rv; |
184 |
+} |
185 |
+ |
186 |
+NS_IMETHODIMP GPrintingPromptServiceFactory::LockFactory(PRBool lock) |
187 |
+{ |
188 |
+ return NS_OK; |
189 |
+} |
190 |
+ |
191 |
+//***************************************************************************** |
192 |
+ |
193 |
+nsresult NS_NewPrintingPromptServiceFactory(nsIFactory** aFactory) |
194 |
+{ |
195 |
+ NS_ENSURE_ARG_POINTER(aFactory); |
196 |
+ *aFactory = nsnull; |
197 |
+ |
198 |
+ GPrintingPromptServiceFactory *result = new GPrintingPromptServiceFactory; |
199 |
+ if (!result) |
200 |
+ return NS_ERROR_OUT_OF_MEMORY; |
201 |
+ |
202 |
+ NS_ADDREF(result); |
203 |
+ *aFactory = result; |
204 |
+ |
205 |
+ return NS_OK; |
206 |
+} |
207 |
+ |
208 |
+/* |
209 |
+ * End of adapted code. |
210 |
+ */ |
211 |
+ |
212 |
+static NS_DEFINE_CID(kGPrintingPromptServiceCID, G_PRINTINGPROMPTSERVICE_CID); |
213 |
+ |
214 |
+void |
215 |
+yelp_register_printing () |
216 |
+{ |
217 |
+ nsresult rv; |
218 |
+ nsCOMPtr<nsIComponentRegistrar> cr; |
219 |
+ rv = NS_GetComponentRegistrar(getter_AddRefs(cr)); |
220 |
+ NS_ENSURE_SUCCESS (rv, ); |
221 |
+ |
222 |
+ nsCOMPtr<nsIComponentManager> cm; |
223 |
+ rv = NS_GetComponentManager (getter_AddRefs (cm)); |
224 |
+ NS_ENSURE_SUCCESS (rv, ); |
225 |
+ |
226 |
+ nsCOMPtr<nsIFactory> componentFactory; |
227 |
+ rv = NS_NewPrintingPromptServiceFactory(getter_AddRefs(componentFactory)); |
228 |
+ |
229 |
+ if (NS_FAILED(rv) || !componentFactory) |
230 |
+ { |
231 |
+ g_warning ("Failed to make a factory for %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME); |
232 |
+ return; |
233 |
+ } |
234 |
+ |
235 |
+ rv = cr->RegisterFactory(kGPrintingPromptServiceCID, |
236 |
+ G_PRINTINGPROMPTSERVICE_CLASSNAME, |
237 |
+ G_PRINTINGPROMPTSERVICE_CONTRACTID, |
238 |
+ componentFactory); |
239 |
+ if (NS_FAILED(rv)) |
240 |
+ { |
241 |
+ g_warning ("Failed to register %s\n", G_PRINTINGPROMPTSERVICE_CLASSNAME); |
242 |
+ } |
243 |
+ |
244 |
+} |
245 |
+ |
246 |
+#endif |
247 |
Index: yelp-2.30.2/src/yelp-gecko-utils.cpp |
248 |
=================================================================== |
249 |
--- yelp-2.30.2.orig/src/yelp-gecko-utils.cpp |
250 |
+++ yelp-2.30.2/src/yelp-gecko-utils.cpp |
251 |
@@ -214,7 +214,7 @@ yelp_gecko_init (void) |
252 |
#ifdef XPCOM_GLUE |
253 |
static const GREVersionRange greVersion = { |
254 |
"1.9a", PR_TRUE, |
255 |
- "2", PR_TRUE |
256 |
+ "2.0.*", PR_TRUE |
257 |
}; |
258 |
char xpcomLocation[PATH_MAX]; |
259 |
rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, sizeof (xpcomLocation)); |