diff options
Diffstat (limited to 'libraries/libproxy')
-rw-r--r-- | libraries/libproxy/libproxy-mozjs2.patch | 104 | ||||
-rw-r--r-- | libraries/libproxy/libproxy.SlackBuild | 13 | ||||
-rw-r--r-- | libraries/libproxy/libproxy.info | 6 | ||||
-rw-r--r-- | libraries/libproxy/mozjs-link_directory.patch | 30 |
4 files changed, 146 insertions, 7 deletions
diff --git a/libraries/libproxy/libproxy-mozjs2.patch b/libraries/libproxy/libproxy-mozjs2.patch new file mode 100644 index 0000000000..2297f69342 --- /dev/null +++ b/libraries/libproxy/libproxy-mozjs2.patch @@ -0,0 +1,104 @@ +Index: libproxy/cmake/modules/pacrunner_mozjs.cmk +=================================================================== +--- libproxy/cmake/modules/pacrunner_mozjs.cmk (revision 779) ++++ libproxy/cmake/modules/pacrunner_mozjs.cmk (working copy) +@@ -14,6 +14,10 @@ + if(MOZJS_FOUND) + include_directories(${MOZJS_INCLUDE_DIRS}) + link_directories(${MOZJS_LIBRARY_DIRS}) ++ pkg_search_module(MOZJS2 mozilla-js>=2.0b10) ++ if(MOZJS2_FOUND) ++ add_definitions(-DHAVE_MOZJS_2) ++ endif(MOZJS2_FOUND) + else() + set(MOZJS_FOUND 0) + endif() +Index: libproxy/modules/pacrunner_mozjs.cpp +=================================================================== +--- libproxy/modules/pacrunner_mozjs.cpp (revision 779) ++++ libproxy/modules/pacrunner_mozjs.cpp (working copy) +@@ -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; + } + +@@ -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/libraries/libproxy/libproxy.SlackBuild b/libraries/libproxy/libproxy.SlackBuild index 1120d90bc3..5892efaaff 100644 --- a/libraries/libproxy/libproxy.SlackBuild +++ b/libraries/libproxy/libproxy.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for libproxy -# Copyright 2009,2010 Robby Workman Northport, AL, USA +# Copyright 2009-2011 Robby Workman Northport, AL, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=libproxy -VERSION=${VERSION:-0.4.2} +VERSION=${VERSION:-0.4.6} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -71,12 +71,17 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; +# http://code.google.com/p/libproxy/source/detail?r=786 +patch -p0 < $CWD/libproxy-mozjs2.patch +# http://code.google.com/p/libproxy/source/detail?r=774 +patch -p1 < $CWD/mozjs-link_directory.patch + cmake . \ -DCMAKE_C_FLAGS="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \ -DCMAKE_INSTALL_PREFIX=/usr \ - -Dlibdir=/usr/lib${LIBDIRSUFFIX} \ - -Dmoduledir=/usr/lib${LIBDIRSUFFIX}/libproxy/${VERSION}/modules \ + -DLIB_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX} \ + -DMODULE_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX}/libproxy/${VERSION}/modules \ -DPERL_VENDORINSTALL=yes make diff --git a/libraries/libproxy/libproxy.info b/libraries/libproxy/libproxy.info index 95b78ef6cd..3e00d1b4db 100644 --- a/libraries/libproxy/libproxy.info +++ b/libraries/libproxy/libproxy.info @@ -1,8 +1,8 @@ PRGNAM="libproxy" -VERSION="0.4.2" +VERSION="0.4.6" HOMEPAGE="http://code.google.com/p/libproxy/" -DOWNLOAD="http://libproxy.googlecode.com/files/libproxy-0.4.2.tar.gz" -MD5SUM="e8c584ba761373b038b756851cdd3fa1" +DOWNLOAD="http://libproxy.googlecode.com/files/libproxy-0.4.6.tar.gz" +MD5SUM="199c6b120baf1f7258a55f38d5ec74f5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Robby Workman" diff --git a/libraries/libproxy/mozjs-link_directory.patch b/libraries/libproxy/mozjs-link_directory.patch new file mode 100644 index 0000000000..cab138e2ea --- /dev/null +++ b/libraries/libproxy/mozjs-link_directory.patch @@ -0,0 +1,30 @@ +From 18fbf794ffc2cab9f4b8df3c4132b094fc4ef281 Mon Sep 17 00:00:00 2001 +From: nicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56> +Date: Tue, 12 Oct 2010 17:39:18 +0000 +Subject: [PATCH 1/2] Disable transient linking + +As explained at +http://www.cmake.org/Wiki/CMake_FAQ#Why_do_I_have_unwanted_semicolons_.3B_in_my_compiler_flags.3F +if CMake links A to B and B to C, all the flags from A will be appended when +C is linked. This behaviour is wrong, but CMake provides a workaround which +is implemented in this patch. + +git-svn-id: https://libproxy.googlecode.com/svn/trunk@774 c587cffe-e639-0410-9787-d7902ae8ed56 +--- + libproxy/cmake/libproxy.cmk | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/libproxy/cmake/libproxy.cmk b/libproxy/cmake/libproxy.cmk +index 5625d4e..dc9fa0f 100644 +--- a/libproxy/cmake/libproxy.cmk ++++ b/libproxy/cmake/libproxy.cmk +@@ -18,5 +18,6 @@ endif() + set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/proxy.cpp + PROPERTY COMPILE_DEFINITIONS MODULEDIR="${MODULEDIR}";BUILTIN_MODULES=${BUILTIN_MODULES}) + set_target_properties(libproxy PROPERTIES PREFIX "" VERSION 1.0.0 SOVERSION 1) ++set_target_properties(libproxy PROPERTIES LINK_INTERFACE_LIBRARIES "") + install(TARGETS libproxy DESTINATION ${LIB_INSTALL_DIR}) + install(FILES proxy.h DESTINATION ${INCLUDE_INSTALL_DIR}) +-- +1.7.2.3 + |