Skip to content
This repository
Browse code

depends: python: fix urllib on darwin

  • Loading branch information...
commit df33686f13d9d2496d61a01a04377677a598835c 1 parent 4150e93
authored March 14, 2013 Cory Fields committed March 14, 2013
12  tools/depends/target/python26/Makefile
@@ -15,10 +15,6 @@ CONFIGURE=OPT="$(CFLAGS)" \
15 15
   ./configure --prefix=$(PREFIX) \
16 16
   --disable-toolbox-glue --disable-framework --with-system-ffi \
17 17
 
18  
-ifeq ($(OS),ios)
19  
-CONFIGURE+=LDFLAGS="$(LDFLAGS) -miphoneos-version-min=3.0"
20  
-endif
21  
-
22 18
 LIBDYLIB=$(PLATFORM)/libpython2.6.a
23 19
 
24 20
 all: .installed-$(PLATFORM)
@@ -37,16 +33,14 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
37 33
 	cd $(PLATFORM); patch -p1 < ../python-osx-environ-fix.patch
38 34
 	cd $(PLATFORM); patch -p0 < ../Python-2.6.5-ffi-static.patch
39 35
 ifeq ($(OS),ios)
40  
-	cd $(PLATFORM); patch -p0 < ../Python-2.6.5-scproxy.patch
  36
+	cd $(PLATFORM); patch -p0 < ../Python-2.6.5-urllib.diff
41 37
 endif
42 38
 	cp modules.setup $(PLATFORM)/Modules/Setup.dist
43 39
 
44 40
 #Add -liconv as needed, and add the _scproxy module for darwin
45  
-	cd $(PLATFORM); sed -ie 's|_locale _localemodule.c   -lintl|_locale _localemodule.c   -lintl $(LINK_ICONV) |' Modules/Setup.dist
46  
-ifeq (darwin, $(findstring darwin, $(HOST)))
  41
+	cd $(PLATFORM); sed -ie 's|_locale _localemodule.c   -lintl|_locale _localemodule.c   -lintl $(LINK_ICONV) -framework SystemConfiguration -framework CoreFoundation |' Modules/Setup.dist
  42
+ifeq ($(OS),osx)
47 43
 	echo "_scproxy \$$(srcdir)/Mac/Modules/_scproxy.c -framework SystemConfiguration -framework CoreFoundation" >> $(PLATFORM)/Modules/Setup.dist
48  
-else
49  
-	cd $(PLATFORM); sed -ie 's|-framework CoreFoundation||' configure.in
50 44
 endif
51 45
 
52 46
 	cd $(PLATFORM); $(AUTORECONF)
51  tools/depends/target/python26/Python-2.6.5-scproxy.patch
... ...
@@ -1,51 +0,0 @@
1  
---- Mac/Modules/_scproxy.c	2009-09-20 15:21:24.000000000 -0400
2  
-+++ Mac/Modules/_scproxy.c	2013-01-22 19:40:41.000000000 -0500
3  
-@@ -4,7 +4,6 @@
4  
-  */
5  
- #include <Python.h>
6  
- #include <SystemConfiguration/SystemConfiguration.h>
7  
--
8  
- static int32_t 
9  
- cfnum_to_int32(CFNumberRef num)
10  
- {
11  
-@@ -48,6 +47,7 @@
12  
- static PyObject*
13  
- get_proxy_settings(PyObject* mod __attribute__((__unused__)))
14  
- {
15  
-+/*
16  
- 	CFDictionaryRef proxyDict = NULL;
17  
- 	CFNumberRef aNum = NULL;
18  
- 	CFArrayRef anArray = NULL;
19  
-@@ -55,7 +55,7 @@
20  
- 	PyObject* v;
21  
- 	int r;
22  
- 
23  
--	proxyDict = SCDynamicStoreCopyProxies(NULL);
24  
-+	proxyDict =  CFNetworkCopyProxiesForURL(NULL);
25  
- 	if (!proxyDict) {
26  
- 		Py_INCREF(Py_None);
27  
- 		return Py_None;
28  
-@@ -114,6 +114,7 @@
29  
- error:
30  
- 	if (proxyDict)  CFRelease(proxyDict);
31  
- 	Py_XDECREF(result);
32  
-+*/
33  
- 	return NULL;
34  
- }
35  
- 
36  
-@@ -163,6 +164,7 @@
37  
- static PyObject*
38  
- get_proxies(PyObject* mod __attribute__((__unused__)))
39  
- {
40  
-+/*
41  
- 	PyObject* result = NULL;
42  
- 	int r;
43  
- 	CFDictionaryRef proxyDict = NULL;
44  
-@@ -201,6 +203,7 @@
45  
- error:
46  
- 	if (proxyDict)  CFRelease(proxyDict);
47  
- 	Py_XDECREF(result);
48  
-+*/
49  
- 	return NULL;
50  
- }
51  
- 
15  tools/depends/target/python26/Python-2.6.5-urllib.diff
... ...
@@ -0,0 +1,15 @@
  1
+--- Lib/urllib.py	2010-02-20 17:13:01.000000000 -0500
  2
++++ Lib/urllib.py	2013-03-14 01:11:49.000000000 -0400
  3
+@@ -1401,10 +1401,10 @@
  4
+         if getproxies_environment():
  5
+             return proxy_bypass_environment(host)
  6
+         else:
  7
+-            return proxy_bypass_macosx_sysconf(host)
  8
++            return false
  9
+ 
  10
+     def getproxies():
  11
+-        return getproxies_environment() or getproxies_macosx_sysconf()
  12
++        return getproxies_environment()
  13
+ 
  14
+ elif os.name == 'nt':
  15
+     def getproxies_registry():

0 notes on commit df33686

Please sign in to comment.
Something went wrong with that request. Please try again.