]> git.ipfire.org Git - ipfire-3.x.git/blame - python-pycurl/patches/0002-Fixes-https-sourceforge.net-tracker-func-detail-aid-.patch
python-pycurl: Import fixes from upstream.
[ipfire-3.x.git] / python-pycurl / patches / 0002-Fixes-https-sourceforge.net-tracker-func-detail-aid-.patch
CommitLineData
883c26f3
MT
1From 009e170d2838346461ff0b31b0afa44f3d6278f3 Mon Sep 17 00:00:00 2001
2From: zanee <zanee>
3Date: Fri, 23 Apr 2010 16:06:41 +0000
4Subject: [PATCH 2/5] Fixes https://sourceforge.net/tracker/?func=detail&aid=2812016&group_id=28236&atid=392777 with applied patch from sourceforge user dbprice1.
5
6Signed-off-by: Kamil Dudka <kdudka@redhat.com>
7---
8 setup.py | 23 ++++++++++++++++++-----
9 1 files changed, 18 insertions(+), 5 deletions(-)
10
11diff --git a/setup.py b/setup.py
12index 0ffd9d2..76b9d58 100644
13--- a/setup.py
14+++ b/setup.py
15@@ -1,7 +1,7 @@
16 #! /usr/bin/env python
17 # -*- coding: iso-8859-1 -*-
18 # vi:ts=4:et
19-# $Id: setup.py,v 1.150 2008/09/09 17:40:34 kjetilja Exp $
20+# $Id: setup.py,v 1.151 2010/04/23 16:06:41 zanee Exp $
21
22 """Setup script for the PycURL module distribution."""
23
24@@ -9,7 +9,7 @@ PACKAGE = "pycurl"
25 PY_PACKAGE = "curl"
26 VERSION = "7.19.0"
27
28-import glob, os, re, sys, string
29+import glob, os, re, sys, string, subprocess
30 import distutils
31 from distutils.core import setup
32 from distutils.extension import Extension
33@@ -96,9 +96,22 @@ else:
34 include_dirs.append(e[2:])
35 else:
36 extra_compile_args.append(e)
37- libs = split_quoted(
38- os.popen("'%s' --libs" % CURL_CONFIG).read()+\
39- os.popen("'%s' --static-libs" % CURL_CONFIG).read())
40+
41+ # Run curl-config --libs and --static-libs. Some platforms may not
42+ # support one or the other of these curl-config options, so gracefully
43+ # tolerate failure of either, but not both.
44+ optbuf = ""
45+ for option in ["--libs", "--static-libs"]:
46+ p = subprocess.Popen("'%s' %s" % (CURL_CONFIG, option), shell=True,
47+ stdout=subprocess.PIPE)
48+ (stdout, stderr) = p.communicate()
49+ if p.wait() == 0:
50+ optbuf += stdout
51+ if optbuf == "":
52+ raise Exception, ("Neither of curl-config --libs or --static-libs" +
53+ "produced output")
54+ libs = split_quoted(optbuf)
55+
56 for e in libs:
57 if e[:2] == "-l":
58 libraries.append(e[2:])
59--
601.7.1
61