diff options
author | 2011-03-22 21:48:30 +0000 | |
---|---|---|
committer | 2011-03-22 21:48:30 +0000 | |
commit | 57cf7a774e84b9ec31d12210d8c3baab9416384d (patch) | |
tree | 3d14562f645eb12be9e704f76ea5e705021cf4c0 /net-libs/libproxy | |
parent | Fix documentation handling making it really conditional (bug #359927 by M.B). (diff) | |
download | historical-57cf7a774e84b9ec31d12210d8c3baab9416384d.tar.gz historical-57cf7a774e84b9ec31d12210d8c3baab9416384d.tar.bz2 historical-57cf7a774e84b9ec31d12210d8c3baab9416384d.zip |
Fix compability with net-libs/xulrunner >= 2 wrt #359879 by Justin Lecher.
Package-Manager: portage-2.2.0_alpha28/cvs/Linux x86_64
Diffstat (limited to 'net-libs/libproxy')
-rw-r--r-- | net-libs/libproxy/ChangeLog | 6 | ||||
-rw-r--r-- | net-libs/libproxy/Manifest | 5 | ||||
-rw-r--r-- | net-libs/libproxy/files/libproxy-0.4.6-xulrunner-2.patch | 133 | ||||
-rw-r--r-- | net-libs/libproxy/libproxy-0.4.6-r1.ebuild | 7 |
4 files changed, 146 insertions, 5 deletions
diff --git a/net-libs/libproxy/ChangeLog b/net-libs/libproxy/ChangeLog index 1dca361d12a9..ab2fc93fad0d 100644 --- a/net-libs/libproxy/ChangeLog +++ b/net-libs/libproxy/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-libs/libproxy # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libproxy/ChangeLog,v 1.55 2011/03/21 23:18:54 nirbheek Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libproxy/ChangeLog,v 1.56 2011/03/22 21:48:30 ssuominen Exp $ + + 22 Mar 2011; Samuli Suominen <ssuominen@gentoo.org> libproxy-0.4.6-r1.ebuild, + +files/libproxy-0.4.6-xulrunner-2.patch: + Fix compability with net-libs/xulrunner >= 2 wrt #359879 by Justin Lecher. 21 Mar 2011; Nirbheek Chauhan <nirbheek@gentoo.org> libproxy-0.4.6.ebuild: Fix slot-deps on gnome libs diff --git a/net-libs/libproxy/Manifest b/net-libs/libproxy/Manifest index 5306836913c9..e814bae74358 100644 --- a/net-libs/libproxy/Manifest +++ b/net-libs/libproxy/Manifest @@ -1,6 +1,7 @@ AUX libproxy-0.4.6-mozjs-link_directory.patch 1365 RMD160 4ba7b7f923a8d48575db2f13c86482d78e54ae1c SHA1 0a083243f29571e5e971de6df6e4c81b9cf6444f SHA256 783bc34d685ddf3ba6e6c85003417412f2bb87e9fc87c4ca5c9c56bf5e99aea5 +AUX libproxy-0.4.6-xulrunner-2.patch 4763 RMD160 66210bdb6497b14358fd73037b6e9813ffd55de3 SHA1 a0ee71fc9b6cd15176b53601655ee6c0d760651b SHA256 e4bd9cb3c43249593015c1fe2b6630e999627e01ca1091455a70ec32d0233525 DIST libproxy-0.4.6.tar.gz 82483 RMD160 f5f03c84ad2d87fe728869fadc669628737c639e SHA1 6e9745c87b774f34bf53f07a54284c0d72020e94 SHA256 9ad912e63b1efca98fb442240a2bc7302e6021c1d0b1b9363327729f29462f30 -EBUILD libproxy-0.4.6-r1.ebuild 2218 RMD160 531286f3dad5df1c8befb723d224bb8e0a71e80a SHA1 de82f7a16f194435c9c5d46494ac3a726942eba4 SHA256 67b2d92f10db6ec14cdb9a19ef327cfcd6b15895e15bb5a96737243bf5271783 +EBUILD libproxy-0.4.6-r1.ebuild 2262 RMD160 08d24406ba7d83573d72b382dfe1b0e8a7b5f3e1 SHA1 eda18efca56e5382cf6271349175f04693c49faa SHA256 def7a7050192f9900cc263558bf0ba71bf8dc3a26aebf917ff46cf451bb585ed EBUILD libproxy-0.4.6.ebuild 2159 RMD160 d83d1d986e1c94d3f219517d09703eebe474e02f SHA1 1e4cbcd18059cf6b7edb2546369e6c6b20577472 SHA256 8da6f0e06cecefe40e2cef3be538ffef7983c488bac852f4ce7ba1f30eeafbb2 -MISC ChangeLog 8699 RMD160 86e0a15024010ffcaf41c74904ac88d4363e8fed SHA1 6c16350acfb06433b567b0d26a9ef4960e8fb06a SHA256 2525ff429bd9c2fdaeef486f3a88f2bdd8f43cd138fa4cc67567a5d7e7c501b2 +MISC ChangeLog 8901 RMD160 32d0bf7ebbe6f69be5d7907f8acc8457169f772c SHA1 3ebffe06e830f077170d9260fa448b2306bfb1e7 SHA256 9ddf671aa0ce8ec2e7905553749df446dae5073c6acc400271ac88cb5b066553 MISC metadata.xml 733 RMD160 877172f5073bdd58cf76bdb152503d6080027191 SHA1 1d5eb42d45cafddd1af934c3a7bcfea3bd4d9c1e SHA256 7c806aa9aee9a1b529b0353ed05898466be659ea3fde84007ff614e935742b34 diff --git a/net-libs/libproxy/files/libproxy-0.4.6-xulrunner-2.patch b/net-libs/libproxy/files/libproxy-0.4.6-xulrunner-2.patch new file mode 100644 index 000000000000..5f3de3ca5b10 --- /dev/null +++ b/net-libs/libproxy/files/libproxy-0.4.6-xulrunner-2.patch @@ -0,0 +1,133 @@ +http://bugs.gentoo.org/359879 +http://code.google.com/p/libproxy/issues/detail?id=158 + +--- libproxy/cmake/modules/pacrunner_mozjs.cmk ++++ libproxy/cmake/modules/pacrunner_mozjs.cmk +@@ -7,16 +7,23 @@ + include_directories("${MOZJS_INCLUDE_DIR}") + endif() + elseif(NOT APPLE) +- set(MOZJS_SEARCH_ORDER "xulrunner-js;firefox-js;mozilla-js;seamonkey-js" CACHE STRING "MozJS search order") ++ set(MOZJS_SEARCH_ORDER "mozilla-js;xulrunner-js;firefox-js;seamonkey-js" CACHE STRING "MozJS search order") + option(WITH_MOZJS "Search for MOZJS package" ON) + if (WITH_MOZJS) +- pkg_search_module(MOZJS ${MOZJS_SEARCH_ORDER}) +- if(MOZJS_FOUND) +- include_directories(${MOZJS_INCLUDE_DIRS}) +- link_directories(${MOZJS_LIBRARY_DIRS}) +- else() +- set(MOZJS_FOUND 0) +- endif() ++ foreach(MOZJSLIB ${MOZJS_SEARCH_ORDER}) ++ pkg_search_module(MOZJS ${MOZJSLIB}) ++ if(MOZJS_FOUND) ++ include_directories(${MOZJS_INCLUDE_DIRS}) ++ link_directories(${MOZJS_LIBRARY_DIRS}) ++ pkg_search_module(MOZJS2 ${MOZJSLIB}>=2.0b10) ++ if(MOZJS2_FOUND) ++ add_definitions(-DHAVE_MOZJS_2) ++ endif(MOZJS2_FOUND) ++ break() ++ else() ++ set(MOZJS_FOUND 0) ++ endif() ++ endforeach() + else() + set(MOZJS_FOUND 0) + endif() +--- libproxy/modules/pacrunner_mozjs.cpp ++++ libproxy/modules/pacrunner_mozjs.cpp +@@ -42,12 +42,12 @@ + #define INET6_ADDRSTRLEN 46 + #endif + +-static JSBool dnsResolve(JSContext *cx, JSObject * /*obj*/, uintN /*argc*/, jsval *argv, jsval *rval) { ++static JSBool dnsResolve_(JSContext *cx, jsval hostname, jsval *vp) { + // Get hostname argument +- char *tmp = JS_strdup(cx, JS_GetStringBytes(JS_ValueToString(cx, argv[0]))); ++ char *tmp = JS_EncodeString(cx, JS_ValueToString(cx, hostname)); + + // Set the default return value +- *rval = JSVAL_NULL; ++ JS_SET_RVAL(cx, vp, JSVAL_NULL); + + // Look it up + struct addrinfo *info = NULL; +@@ -66,7 +66,7 @@ + NI_NUMERICHOST)) goto out; + + // We succeeded +- *rval = STRING_TO_JSVAL(JS_NewString(cx, tmp, strlen(tmp))); ++ JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(JS_NewStringCopyN(cx, tmp, strlen(tmp)))); + tmp = NULL; + + out: +@@ -75,15 +75,20 @@ + return true; + } + +-static JSBool myIpAddress(JSContext *cx, JSObject *obj, uintN /*argc*/, jsval * /*argv*/, jsval *rval) { ++static JSBool dnsResolve(JSContext *cx, uintN /*argc*/, jsval *vp) { ++ jsval *argv = JS_ARGV(cx, vp); ++ return dnsResolve_(cx, argv[0], vp); ++} ++ ++static JSBool myIpAddress(JSContext *cx, uintN /*argc*/, jsval *vp) { + char *hostname = (char *) JS_malloc(cx, 1024); + if (!gethostname(hostname, 1023)) { +- JSString *myhost = JS_NewString(cx, hostname, strlen(hostname)); ++ JSString *myhost = JS_NewStringCopyN(cx, hostname, strlen(hostname)); + jsval arg = STRING_TO_JSVAL(myhost); +- return dnsResolve(cx, obj, 1, &arg, rval); ++ return dnsResolve_(cx, 1, &arg); + } + JS_free(cx, hostname); +- *rval = JSVAL_NULL; ++ JS_SET_RVAL(cx, vp, JSVAL_NULL); + return true; + } + +@@ -91,7 +96,7 @@ + // This MUST be a static global + static JSClass cls = { + "global", JSCLASS_GLOBAL_FLAGS, +- JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, ++ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL + }; +@@ -111,7 +116,11 @@ + //JS_SetOptions(this->jsctx, JSOPTION_VAROBJFIX); + //JS_SetVersion(this->jsctx, JSVERSION_LATEST); + //JS_SetErrorReporter(cx, reportError); ++ #ifdef HAVE_MOZJS_2 ++ if (!(this->jsglb = JS_NewCompartmentAndGlobalObject(this->jsctx, &cls, NULL))) goto error; ++ #else + if (!(this->jsglb = JS_NewObject(this->jsctx, &cls, NULL, NULL))) goto error; ++ #endif + if (!JS_InitStandardClasses(this->jsctx, this->jsglb)) goto error; + + // Define Javascript functions +@@ -147,15 +156,19 @@ + throw bad_alloc(); + } + jsval args[2] = { +- STRING_TO_JSVAL(JS_NewString(this->jsctx, tmpurl, strlen(tmpurl))), +- STRING_TO_JSVAL(JS_NewString(this->jsctx, tmphost, strlen(tmphost))) ++ STRING_TO_JSVAL(JS_NewStringCopyN(this->jsctx, tmpurl, strlen(tmpurl))), ++ STRING_TO_JSVAL(JS_NewStringCopyN(this->jsctx, tmphost, strlen(tmphost))) + }; + + // Find the proxy (call FindProxyForURL()) + jsval rval; + JSBool result = JS_CallFunctionName(this->jsctx, this->jsglb, "FindProxyForURL", 2, args, &rval); + if (!result) return ""; +- string answer = string(JS_GetStringBytes(JS_ValueToString(this->jsctx, rval))); ++ ++ char * tmpanswer = JS_EncodeString(this->jsctx, JS_ValueToString(this->jsctx, rval)); ++ string answer = string(tmpanswer); ++ JS_free(this->jsctx, tmpanswer); ++ + if (answer == "undefined") return ""; + return answer; + } diff --git a/net-libs/libproxy/libproxy-0.4.6-r1.ebuild b/net-libs/libproxy/libproxy-0.4.6-r1.ebuild index eb90b545d571..15ecf60753cd 100644 --- a/net-libs/libproxy/libproxy-0.4.6-r1.ebuild +++ b/net-libs/libproxy/libproxy-0.4.6-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libproxy/libproxy-0.4.6-r1.ebuild,v 1.3 2011/03/07 11:56:14 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libproxy/libproxy-0.4.6-r1.ebuild,v 1.4 2011/03/22 21:48:30 ssuominen Exp $ EAPI="2" PYTHON_DEPEND="python? 2:2.5" @@ -31,7 +31,10 @@ DEPEND="${RDEPEND} DOCS="AUTHORS NEWS README ChangeLog" -PATCHES=( "${FILESDIR}"/${P}-mozjs-link_directory.patch ) +PATCHES=( + "${FILESDIR}"/${P}-mozjs-link_directory.patch + "${FILESDIR}"/${P}-xulrunner-2.patch + ) pkg_setup() { if use python; then |