Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-servers/uwsgi/files: uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch uwsgi-0.9.5-respect_flags.patch
Date: Mon, 03 May 2010 19:24:32
Message-Id: 20100503192428.4E8C62C37C@corvid.gentoo.org
1 hollow 10/05/03 19:24:28
2
3 Added: uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch
4 uwsgi-0.9.5-respect_flags.patch
5 Log:
6 initial ebuild. thanks to Arfrever Frehtes Taifersar Arahesis for sane python ABI support. closes #314931
7 (Portage version: 2.2_rc67/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/uwsgi/files/uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch?rev=1.1&content-type=text/plain
14
15 Index: uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch
16 ===================================================================
17 --- uwsgiconfig.py
18 +++ uwsgiconfig.py
19 @@ -68,9 +68,9 @@
20 p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
21
22 if p.wait() == 0:
23 - return p.stdout.read().rstrip().decode()
24 + return p.stdout.read().rstrip().decode()
25 else:
26 - return None
27 + return None
28
29 def add_o(x):
30 if x == 'uwsgi':
31 @@ -149,11 +149,11 @@
32 kvm_list = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFly']
33
34 if uwsgi_os == 'SunOS':
35 - ldflags.append('-lsendfile')
36 + ldflags.append('-lsendfile')
37 ldflags.remove('-rdynamic')
38
39 if uwsgi_os in kvm_list:
40 - ldflags.append('-lkvm')
41 + ldflags.append('-lkvm')
42
43 if uwsgi_os == 'OpenBSD':
44 UGREEN = False
45 @@ -245,8 +245,8 @@
46 gcc_list.append('erlang')
47
48 if SCTP:
49 - ldflags.append("-lsctp")
50 - cflags.append("-DUWSGI_SCTP")
51 + ldflags.append("-lsctp")
52 + cflags.append("-DUWSGI_SCTP")
53
54 if SPOOLER:
55 depends_on("SPOOLER", ['EMBEDDED'])
56 @@ -294,9 +294,9 @@
57 sys.exit(1)
58
59 if cmd == '--cflags':
60 - print(' '.join(cflags))
61 + print(' '.join(cflags))
62 if cmd == '--ldflags':
63 - print(' '.join(ldflags))
64 + print(' '.join(ldflags))
65 elif cmd == '--build':
66 parse_vars()
67 build_uwsgi(UWSGI_BIN_NAME)
68
69
70
71 1.1 www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch
72
73 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch?rev=1.1&view=markup
74 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-servers/uwsgi/files/uwsgi-0.9.5-respect_flags.patch?rev=1.1&content-type=text/plain
75
76 Index: uwsgi-0.9.5-respect_flags.patch
77 ===================================================================
78 --- uwsgiconfig.py
79 +++ uwsgiconfig.py
80 @@ -20,7 +20,6 @@
81 PLUGINS = []
82 UNBIT=False
83 UWSGI_BIN_NAME = 'uwsgi'
84 -GCC='gcc'
85
86 # specific compilation flags
87 # libxml2 or expat
88 @@ -46,17 +45,22 @@
89
90 from distutils import sysconfig
91
92 +GCC = os.environ.get('CC', sysconfig.get_config_var('CC'))
93 +if not GCC:
94 + GCC = 'gcc'
95 +
96 gcc_list = ['utils', 'pyutils', 'protocol', 'socket', 'logging', 'wsgi_handlers', 'wsgi_headers', 'uwsgi_handlers', 'uwsgi']
97
98 # large file support
99 try:
100 - cflags = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + sysconfig.get_config_var('CFLAGS').split()
101 + cflags = ['-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64'] + os.environ.get("CFLAGS", "").split()
102 except:
103 print("You need python headers to build uWSGI.")
104 sys.exit(1)
105
106 cflags = cflags + ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True) ]
107 -ldflags = ['-lpthread', '-rdynamic'] + sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
108 +ldflags = os.environ.get("LDFLAGS", "").split()
109 +libs = ['-lpthread', '-rdynamic'] + sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
110
111 def depends_on(what, dep):
112 for d in dep:
113 @@ -97,7 +101,7 @@
114 print(plugin)
115
116 print("*** uWSGI linking ***")
117 - ldline = "%s -o %s %s %s" % (GCC, bin_name, ' '.join(map(add_o, gcc_list)), ' '.join(ldflags))
118 + ldline = "%s -o %s %s %s %s" % (GCC, bin_name, ' '.join(ldflags), ' '.join(map(add_o, gcc_list)), ' '.join(libs))
119 print(ldline)
120 ret = os.system(ldline)
121 if ret != 0:
122 @@ -141,19 +145,19 @@
123 version = sys.version_info
124 uver = "%d.%d" % (version[0], version[1])
125
126 - ldflags.append('-lpython' + uver)
127 + libs.append('-lpython' + uver)
128
129 if str(PYLIB_PATH) != '':
130 - ldflags.insert(0,'-L' + PYLIB_PATH)
131 + libs.insert(0,'-L' + PYLIB_PATH)
132
133 kvm_list = ['FreeBSD', 'OpenBSD', 'NetBSD', 'DragonFly']
134
135 if uwsgi_os == 'SunOS':
136 - ldflags.append('-lsendfile')
137 - ldflags.remove('-rdynamic')
138 + libs.append('-lsendfile')
139 + libs.remove('-rdynamic')
140
141 if uwsgi_os in kvm_list:
142 - ldflags.append('-lkvm')
143 + libs.append('-lkvm')
144
145 if uwsgi_os == 'OpenBSD':
146 UGREEN = False
147 @@ -221,7 +225,7 @@
148 print("*** libxml2 headers unavailable. uWSGI build is interrupted. You have to install libxml2 development package or use libexpat or disable XML")
149 sys.exit(1)
150 else:
151 - ldflags.append(xmlconf)
152 + libs.append(xmlconf)
153 xmlconf = spcall("xml2-config --cflags")
154 if xmlconf is None:
155 print("*** libxml2 headers unavailable. uWSGI build is interrupted. You have to install libxml2 development package or use libexpat or disable XML")
156 @@ -232,20 +236,20 @@
157 gcc_list.append('xmlconf')
158 elif XML_IMPLEMENTATION == 'expat':
159 cflags.append("-DUWSGI_XML -DUWSGI_XML_EXPAT")
160 - ldflags.append('-lexpat')
161 + libs.append('-lexpat')
162 gcc_list.append('xmlconf')
163
164
165 if ERLANG:
166 depends_on("ERLANG", ['EMBEDDED'])
167 cflags.append("-DUWSGI_ERLANG")
168 - ldflags.append(ERLANG_LDFLAGS)
169 + libs.append(ERLANG_LDFLAGS)
170 if str(ERLANG_CFLAGS) != '':
171 cflags.append(ERLANG_CFLAGS)
172 gcc_list.append('erlang')
173
174 if SCTP:
175 - ldflags.append("-lsctp")
176 + libs.append("-lsctp")
177 cflags.append("-DUWSGI_SCTP")
178
179 if SPOOLER:
180 @@ -263,13 +267,13 @@
181 import uwsgiplugin as up
182
183 cflags.append(up.CFLAGS)
184 - ldflags.append(up.LDFLAGS)
185 + libs.append(up.LDFLAGS)
186
187 cflags.insert(0, '-I.')
188
189 plugin_base = path + '/' + up.NAME + '_plugin'
190
191 - gccline = "%s -fPIC -shared -o %s.so %s %s.c %s" % (GCC, plugin_base, ' '.join(cflags), plugin_base, ' '.join(ldflags))
192 + gccline = "%s -fPIC -shared -o %s.so %s %s %s.c %s" % (GCC, plugin_base, ' '.join(cflags), ' '.join(ldflags), plugin_base, ' '.join(libs))
193 print(gccline)
194
195 ret = os.system(gccline)
196 @@ -297,6 +301,8 @@
197 print(' '.join(cflags))
198 if cmd == '--ldflags':
199 print(' '.join(ldflags))
200 + if cmd == '--libs':
201 + print(' '.join(libs))
202 elif cmd == '--build':
203 parse_vars()
204 build_uwsgi(UWSGI_BIN_NAME)