Browse Source

python: add old python 2 package back

According to PEP394 (http://legacy.python.org/dev/peps/pep-0394/)
the 'python' command should refer to 'python2'.

In our case, this means we should reboot the old python package.

We could rename the package name to python2, but that would
just complicate things a bit with other packages, and
since we're doing this reboot, such a complication would be
unnecessary.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Alexandru Ardelean 10 years ago
parent
commit
d5bd7dd36e

+ 511
- 0
lang/python/Makefile View File

@@ -0,0 +1,511 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=python
11
+PKG_VERSION:=2.7.3
12
+PKG_RELEASE:=2
13
+
14
+PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
16
+PKG_MD5SUM:=62c4c1699170078c469f79ddfed21bc0
17
+
18
+PKG_LICENSE:=PSF
19
+PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
20
+
21
+PKG_INSTALL:=1
22
+PKG_BUILD_PARALLEL:=1
23
+HOST_BUILD_PARALLEL:=1
24
+
25
+PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
26
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
27
+
28
+PKG_BUILD_DEPENDS:=python/host
29
+
30
+include $(INCLUDE_DIR)/host-build.mk
31
+include $(INCLUDE_DIR)/package.mk
32
+-include $(if $(DUMP),,./files/python-package.mk)
33
+
34
+define Package/python/Default
35
+  SUBMENU:=Python
36
+  SECTION:=lang
37
+  CATEGORY:=Languages
38
+  TITLE:=Python $(PYTHON_VERSION) programming language
39
+  URL:=http://www.python.org/
40
+  MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
41
+endef
42
+
43
+define Package/python/Default/description
44
+ Python is a dynamic object-oriented programming language that can be used
45
+ for many kinds of software development. It offers strong support for
46
+ integration with other languages and tools, comes with extensive standard
47
+ libraries, and can be learned in a few days. Many Python programmers
48
+ report substantial productivity gains and feel the language encourages
49
+ the development of higher quality, more maintainable code.
50
+endef
51
+
52
+define Package/python
53
+$(call Package/python/Default)
54
+  DEPENDS:=+libpthread +zlib +libffi
55
+endef
56
+
57
+define Package/python/description
58
+$(call Package/python/Default/description)
59
+  .
60
+  This package contains only a minimal Python install.
61
+endef
62
+
63
+define Package/python-full
64
+$(call Package/python/Default)
65
+  TITLE+= (full)
66
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python
67
+endef
68
+
69
+define Package/python-full/description
70
+$(call Package/python/Default/description)
71
+ .
72
+ This package contains the full Python install.
73
+endef
74
+
75
+define Package/python-doc
76
+$(call Package/python/Default)
77
+  TITLE:=Python interactive documentation
78
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python
79
+endef
80
+
81
+define Package/python-bzip2
82
+$(call Package/python/Default)
83
+  TITLE:=Python support for Bzip2
84
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libbz2
85
+endef
86
+
87
+define Package/python-expat
88
+$(call Package/python/Default)
89
+  TITLE:=Python support for expat
90
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libexpat
91
+endef
92
+
93
+define Package/python-gzip
94
+$(call Package/python/Default)
95
+  TITLE:=Python support for gzip
96
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python
97
+endef
98
+
99
+define Package/python-openssl
100
+$(call Package/python/Default)
101
+ TITLE:=Python support for OpenSSL
102
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libopenssl
103
+endef
104
+
105
+define Package/python-shutil
106
+$(call Package/python/Default)
107
+  TITLE:=Python support for shutil
108
+  DEPENDS:=@PACKAGE_python +PACKAGE_python:python
109
+endef
110
+
111
+# Needs datetime
112
+define Package/python-sqlite3
113
+$(call Package/python/Default)
114
+ TITLE:=Python support for sqlite3
115
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libsqlite3
116
+endef
117
+
118
+define Package/python-gdbm
119
+$(call Package/python/Default)
120
+ TITLE:=Python support for gdbm
121
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libgdbm
122
+endef
123
+
124
+define Package/python-readline
125
+$(call Package/python/Default)
126
+ TITLE:=Python support for readline
127
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncurses @BROKEN
128
+endef
129
+
130
+define Package/python-ncurses
131
+$(call Package/python/Default)
132
+ TITLE:=Python support for readline
133
+ DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncurses
134
+endef
135
+
136
+MAKE_FLAGS:=\
137
+	$(TARGET_CONFIGURE_OPTS) \
138
+	DESTDIR="$(PKG_INSTALL_DIR)" \
139
+	CROSS_COMPILE=yes \
140
+	CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
141
+	LDFLAGS="$(TARGET_LDFLAGS)" \
142
+	LD="$(TARGET_CC)" \
143
+	HOSTPYTHON=./hostpython \
144
+	HOSTPGEN=./hostpgen
145
+
146
+ENABLE_IPV6:=
147
+ifeq ($(CONFIG_IPV6),y)
148
+	ENABLE_IPV6 += --enable-ipv6
149
+endif
150
+
151
+define Build/Configure
152
+	-$(MAKE) -C $(PKG_BUILD_DIR) distclean
153
+	(cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
154
+	# The python executable needs to stay in the rootdir since its location will
155
+	# be used to compute the path of the config files.
156
+	$(CP) $(STAGING_DIR_HOST)/bin/pgen $(PKG_BUILD_DIR)/hostpgen
157
+	$(CP) $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) $(PKG_BUILD_DIR)/hostpython
158
+	$(call Build/Configure/Default, \
159
+		--sysconfdir=/etc \
160
+		--disable-shared \
161
+		--without-cxx-main \
162
+		--with-threads \
163
+		--with-system-ffi="$(STAGING_DIR)/usr" \
164
+		$(ENABLE_IPV6) \
165
+		ac_cv_have_chflags=no \
166
+		ac_cv_have_lchflags=no \
167
+		ac_cv_py_format_size_t=no \
168
+		ac_cv_have_long_long_format=yes \
169
+		ac_cv_buggy_getaddrinfo=no \
170
+		OPT="$(TARGET_CFLAGS)" \
171
+	)
172
+endef
173
+
174
+define Build/InstallDev
175
+	$(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
176
+	$(INSTALL_DIR) $(STAGING_DIR)/mk/
177
+	$(INSTALL_DATA) ./files/python-package.mk $(STAGING_DIR)/mk/
178
+	$(CP) \
179
+		$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
180
+		$(1)/usr/include/
181
+	$(CP) \
182
+		$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \
183
+		$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
184
+		$(1)/usr/lib/
185
+	$(CP) \
186
+		$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
187
+		$(1)/usr/lib/python$(PYTHON_VERSION)/
188
+
189
+	$(CP) \
190
+		$(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) \
191
+		$(1)/usr/bin/hostpython
192
+	(cd $(2)/bin; \
193
+	ln -sf ../../usr/bin/hostpython python$(PYTHON_VERSION); \
194
+	ln -sf python$(PYTHON_VERSION) python)
195
+
196
+	$(CP) \
197
+		$(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \
198
+		$(2)/bin/
199
+	$(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
200
+
201
+	(cd $(2)/bin; \
202
+	ln -sf python$(PYTHON_VERSION)-config python-config;)
203
+endef
204
+
205
+define PyPackage/python-full/filespec
206
++|/usr/lib/python$(PYTHON_VERSION)
207
+-|/usr/lib/python$(PYTHON_VERSION)/bsddb/test
208
+-|/usr/lib/python$(PYTHON_VERSION)/config
209
+-|/usr/lib/python$(PYTHON_VERSION)/ctypes/test
210
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst-*.exe
211
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/tests
212
+-|/usr/lib/python$(PYTHON_VERSION)/email/test
213
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
214
+-|/usr/lib/python$(PYTHON_VERSION)/json/tests
215
+-|/usr/lib/python$(PYTHON_VERSION)/lib-tk
216
+-|/usr/lib/python$(PYTHON_VERSION)/sqlite3
217
+-|/usr/lib/python$(PYTHON_VERSION)/test
218
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
219
+-|/usr/lib/python$(PYTHON_VERSION)/lib-old
220
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so
221
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so
222
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so
223
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so
224
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so
225
+-|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
226
+-|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
227
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so
228
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
229
+-|/usr/lib/python$(PYTHON_VERSION)/__future__.py
230
+-|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py
231
+-|/usr/lib/python$(PYTHON_VERSION)/abc.py
232
+-|/usr/lib/python$(PYTHON_VERSION)/codecs.py
233
+-|/usr/lib/python$(PYTHON_VERSION)/compileall.py
234
+-|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py
235
+-|/usr/lib/python$(PYTHON_VERSION)/copy.py
236
+-|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py
237
+-|/usr/lib/python$(PYTHON_VERSION)/dis.py
238
+-|/usr/lib/python$(PYTHON_VERSION)/encodings
239
+-|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py
240
+-|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
241
+-|/usr/lib/python$(PYTHON_VERSION)/getopt.py
242
+-|/usr/lib/python$(PYTHON_VERSION)/glob.py
243
+-|/usr/lib/python$(PYTHON_VERSION)/hashlib.py
244
+-|/usr/lib/python$(PYTHON_VERSION)/inspect.py
245
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so
246
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so
247
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so
248
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so
249
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so
250
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so
251
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so
252
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so
253
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so
254
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so
255
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so
256
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so
257
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so
258
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so
259
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
260
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so
261
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so
262
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so
263
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so
264
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so
265
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so
266
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so
267
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
268
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
269
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
270
+-|/usr/lib/python$(PYTHON_VERSION)/linecache.py
271
+-|/usr/lib/python$(PYTHON_VERSION)/md5.py
272
+-|/usr/lib/python$(PYTHON_VERSION)/new.py
273
+-|/usr/lib/python$(PYTHON_VERSION)/opcode.py
274
+-|/usr/lib/python$(PYTHON_VERSION)/optparse.py
275
+-|/usr/lib/python$(PYTHON_VERSION)/os.py
276
+-|/usr/lib/python$(PYTHON_VERSION)/pickle.py
277
+-|/usr/lib/python$(PYTHON_VERSION)/pickle.py
278
+-|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py
279
+-|/usr/lib/python$(PYTHON_VERSION)/popen2.py
280
+-|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
281
+-|/usr/lib/python$(PYTHON_VERSION)/py_compile.py
282
+-|/usr/lib/python$(PYTHON_VERSION)/random.py
283
+-|/usr/lib/python$(PYTHON_VERSION)/repr.py
284
+-|/usr/lib/python$(PYTHON_VERSION)/re.py
285
+-|/usr/lib/python$(PYTHON_VERSION)/sha.py
286
+-|/usr/lib/python$(PYTHON_VERSION)/site.py
287
+-|/usr/lib/python$(PYTHON_VERSION)/socket.py
288
+-|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py
289
+-|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py
290
+-|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py
291
+-|/usr/lib/python$(PYTHON_VERSION)/sre.py
292
+-|/usr/lib/python$(PYTHON_VERSION)/stat.py
293
+-|/usr/lib/python$(PYTHON_VERSION)/StringIO.py
294
+-|/usr/lib/python$(PYTHON_VERSION)/stringprep.py
295
+-|/usr/lib/python$(PYTHON_VERSION)/string.py
296
+-|/usr/lib/python$(PYTHON_VERSION)/struct.py
297
+-|/usr/lib/python$(PYTHON_VERSION)/subprocess.py
298
+-|/usr/lib/python$(PYTHON_VERSION)/tempfile.py
299
+-|/usr/lib/python$(PYTHON_VERSION)/textwrap.py
300
+-|/usr/lib/python$(PYTHON_VERSION)/tokenize.py
301
+-|/usr/lib/python$(PYTHON_VERSION)/token.py
302
+-|/usr/lib/python$(PYTHON_VERSION)/traceback.py
303
+-|/usr/lib/python$(PYTHON_VERSION)/types.py
304
+-|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
305
+-|/usr/lib/python$(PYTHON_VERSION)/warnings.py
306
+-|/usr/lib/python$(PYTHON_VERSION)/weakref.py
307
+-|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
308
+-|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
309
+-|/usr/lib/python$(PYTHON_VERSION)/functools.py
310
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
311
+-|/usr/lib/python$(PYTHON_VERSION)/collections.py
312
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
313
+-|/usr/lib/python$(PYTHON_VERSION)/keyword.py
314
+-|/usr/lib/python$(PYTHON_VERSION)/heapq.py
315
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
316
+-|/usr/lib/python$(PYTHON_VERSION)/bisect.py
317
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
318
+endef
319
+
320
+define PyPackage/python/filespec
321
++|/usr/bin/python$(PYTHON_VERSION)
322
++|/usr/lib/python$(PYTHON_VERSION)/__future__.py
323
++|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py
324
++|/usr/lib/python$(PYTHON_VERSION)/abc.py
325
++|/usr/lib/python$(PYTHON_VERSION)/codecs.py
326
++|/usr/lib/python$(PYTHON_VERSION)/compileall.py
327
++|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py
328
++|/usr/lib/python$(PYTHON_VERSION)/copy.py
329
++|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py
330
++|/usr/lib/python$(PYTHON_VERSION)/dis.py
331
++|/usr/lib/python$(PYTHON_VERSION)/encodings
332
++|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py
333
++|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
334
++|/usr/lib/python$(PYTHON_VERSION)/getopt.py
335
++|/usr/lib/python$(PYTHON_VERSION)/glob.py
336
++|/usr/lib/python$(PYTHON_VERSION)/hashlib.py
337
++|/usr/lib/python$(PYTHON_VERSION)/inspect.py
338
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so
339
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so
340
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so
341
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so
342
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so
343
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so
344
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so
345
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so
346
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so
347
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so
348
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so
349
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so
350
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so
351
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so
352
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so
353
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so
354
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so
355
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
356
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
357
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
358
++|/usr/lib/python$(PYTHON_VERSION)/linecache.py
359
++|/usr/lib/python$(PYTHON_VERSION)/md5.py
360
++|/usr/lib/python$(PYTHON_VERSION)/new.py
361
++|/usr/lib/python$(PYTHON_VERSION)/opcode.py
362
++|/usr/lib/python$(PYTHON_VERSION)/optparse.py
363
++|/usr/lib/python$(PYTHON_VERSION)/os.py
364
++|/usr/lib/python$(PYTHON_VERSION)/pickle.py
365
++|/usr/lib/python$(PYTHON_VERSION)/pickle.py
366
++|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py
367
++|/usr/lib/python$(PYTHON_VERSION)/popen2.py
368
++|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
369
++|/usr/lib/python$(PYTHON_VERSION)/py_compile.py
370
++|/usr/lib/python$(PYTHON_VERSION)/random.py
371
++|/usr/lib/python$(PYTHON_VERSION)/repr.py
372
++|/usr/lib/python$(PYTHON_VERSION)/re.py
373
++|/usr/lib/python$(PYTHON_VERSION)/sha.py
374
++|/usr/lib/python$(PYTHON_VERSION)/site.py
375
++|/usr/lib/python$(PYTHON_VERSION)/socket.py
376
++|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py
377
++|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py
378
++|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py
379
++|/usr/lib/python$(PYTHON_VERSION)/sre.py
380
++|/usr/lib/python$(PYTHON_VERSION)/stat.py
381
++|/usr/lib/python$(PYTHON_VERSION)/StringIO.py
382
++|/usr/lib/python$(PYTHON_VERSION)/stringprep.py
383
++|/usr/lib/python$(PYTHON_VERSION)/string.py
384
++|/usr/lib/python$(PYTHON_VERSION)/struct.py
385
++|/usr/lib/python$(PYTHON_VERSION)/subprocess.py
386
++|/usr/lib/python$(PYTHON_VERSION)/tempfile.py
387
++|/usr/lib/python$(PYTHON_VERSION)/textwrap.py
388
++|/usr/lib/python$(PYTHON_VERSION)/tokenize.py
389
++|/usr/lib/python$(PYTHON_VERSION)/token.py
390
++|/usr/lib/python$(PYTHON_VERSION)/traceback.py
391
++|/usr/lib/python$(PYTHON_VERSION)/types.py
392
++|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
393
++|/usr/lib/python$(PYTHON_VERSION)/warnings.py
394
++|/usr/lib/python$(PYTHON_VERSION)/weakref.py
395
++|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
396
++|/usr/lib/python$(PYTHON_VERSION)/config/Makefile
397
++|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
398
++|/usr/lib/python$(PYTHON_VERSION)/functools.py
399
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
400
++|/usr/lib/python$(PYTHON_VERSION)/collections.py
401
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
402
++|/usr/lib/python$(PYTHON_VERSION)/keyword.py
403
++|/usr/lib/python$(PYTHON_VERSION)/heapq.py
404
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
405
++|/usr/lib/python$(PYTHON_VERSION)/bisect.py
406
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
407
++|/usr/include/python$(PYTHON_VERSION)/pyconfig.h
408
+endef
409
+
410
+define PyPackage/python/install
411
+	ln -sf python$(PYTHON_VERSION) $(1)/usr/bin/python
412
+endef
413
+
414
+define PyPackage/python-doc/filespec
415
++|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
416
++|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
417
+endef
418
+
419
+define PyPackage/python-bzip2/filespec
420
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so
421
+endef
422
+
423
+define PyPackage/python-expat/filespec
424
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so
425
+endef
426
+
427
+define PyPackage/python-gzip/filespec
428
++|/usr/lib/python$(PYTHON_VERSION)/gzip.py
429
+endef
430
+
431
+define PyPackage/python-openssl/filespec
432
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so
433
+endef
434
+
435
+define PyPackage/python-shutil/filespec
436
++|/usr/lib/python$(PYTHON_VERSION)/shutil.py
437
+endef
438
+
439
+define PyPackage/python-sqlite3/filespec
440
++|/usr/lib/python$(PYTHON_VERSION)/sqlite3
441
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so
442
+endef
443
+
444
+define PyPackage/python-gdbm/filespec
445
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so
446
+endef
447
+
448
+define PyPackage/python-readline/filespec
449
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
450
+endef
451
+
452
+define PyPackage/python-ncurses/filespec
453
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so
454
++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so
455
+endef
456
+
457
+define Host/Configure
458
+	-$(MAKE) -C $(HOST_BUILD_DIR) distclean
459
+	(cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
460
+	(cd $(HOST_BUILD_DIR); \
461
+		rm -rf config.cache; \
462
+		CONFIG_SITE= \
463
+		OPT="$(HOST_CFLAGS)" \
464
+		./configure --without-cxx-main --with-threads --prefix=$(STAGING_DIR_HOST); \
465
+	)
466
+endef
467
+
468
+define Host/Compile
469
+	+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
470
+		python Parser/pgen
471
+	+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
472
+		HOSTPYTHON=$(HOST_BUILD_DIR)/python \
473
+		sharedmods
474
+endef
475
+
476
+define Host/Install
477
+	$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
478
+	$(MAKE) -C $(HOST_BUILD_DIR) \
479
+		HOSTPYTHON=$(HOST_BUILD_DIR)/python \
480
+		install
481
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/
482
+endef
483
+
484
+
485
+$(eval $(call HostBuild))
486
+
487
+$(eval $(call PyPackage,python))
488
+$(eval $(call PyPackage,python-full))
489
+$(eval $(call PyPackage,python-doc))
490
+$(eval $(call PyPackage,python-bzip2))
491
+$(eval $(call PyPackage,python-expat))
492
+$(eval $(call PyPackage,python-gzip))
493
+$(eval $(call PyPackage,python-openssl))
494
+$(eval $(call PyPackage,python-shutil))
495
+$(eval $(call PyPackage,python-sqlite3))
496
+$(eval $(call PyPackage,python-gdbm))
497
+$(eval $(call PyPackage,python-readline))
498
+$(eval $(call PyPackage,python-ncurses))
499
+
500
+$(eval $(call BuildPackage,python))
501
+$(eval $(call BuildPackage,python-full))
502
+$(eval $(call BuildPackage,python-doc))
503
+$(eval $(call BuildPackage,python-bzip2))
504
+$(eval $(call BuildPackage,python-expat))
505
+$(eval $(call BuildPackage,python-gzip))
506
+$(eval $(call BuildPackage,python-openssl))
507
+$(eval $(call BuildPackage,python-shutil))
508
+$(eval $(call BuildPackage,python-sqlite3))
509
+$(eval $(call BuildPackage,python-gdbm))
510
+$(eval $(call BuildPackage,python-readline))
511
+$(eval $(call BuildPackage,python-ncurses))

+ 77
- 0
lang/python/files/python-package.mk View File

@@ -0,0 +1,77 @@
1
+#
2
+# Copyright (C) 2007-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+PYTHON_VERSION=2.7
9
+
10
+PYTHON_DIR:=$(STAGING_DIR)/usr
11
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
12
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
13
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
14
+
15
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
16
+
17
+PYTHON:=python$(PYTHON_VERSION)
18
+
19
+HOST_PYTHON_BIN:=$(STAGING_DIR)/usr/bin/hostpython
20
+
21
+define HostPython
22
+	(	export PYTHONPATH="$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \
23
+		export PYTHONOPTIMIZE=""; \
24
+		export PYTHONDONTWRITEBYTECODE=1; \
25
+		$(1) \
26
+		$(HOST_PYTHON_BIN) $(2); \
27
+	)
28
+endef
29
+
30
+define PyPackage
31
+  $(call shexport,PyPackage/$(1)/filespec)
32
+
33
+  define Package/$(1)/install
34
+	@$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
35
+		IFS='|'; \
36
+		while read fop fspec fperm; do \
37
+		  if [ "$$$$$$$$fop" = "+" ]; then \
38
+			dpath=`dirname "$$$$$$$$fspec"`; \
39
+			if [ -n "$$$$$$$$fperm" ]; then \
40
+			  dperm="-m$$$$$$$$fperm"; \
41
+			else \
42
+			  dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
43
+			fi; \
44
+			mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
45
+			echo "copying: '$$$$$$$$fspec'"; \
46
+			cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
47
+			if [ -n "$$$$$$$$fperm" ]; then \
48
+			  chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
49
+			fi; \
50
+		  elif [ "$$$$$$$$fop" = "-" ]; then \
51
+			echo "removing: '$$$$$$$$fspec'"; \
52
+			rm -fR $$(1)$$$$$$$$fspec; \
53
+		  elif [ "$$$$$$$$fop" = "=" ]; then \
54
+			echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
55
+			chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
56
+		  fi; \
57
+		done; \
58
+	)
59
+	$(call PyPackage/$(1)/install,$$(1))
60
+  endef
61
+endef
62
+
63
+# $(1) => build subdir
64
+# $(2) => additional arguments to setup.py
65
+# $(3) => additional variables
66
+define Build/Compile/PyMod
67
+	$(call HostPython, \
68
+		cd $(PKG_BUILD_DIR)/$(strip $(1)); \
69
+		CFLAGS="$(TARGET_CFLAGS)" \
70
+		CPPFLAGS="$(TARGET_CPPFLAGS)" \
71
+		LDFLAGS="$(TARGET_LDFLAGS)" \
72
+		$(3) \
73
+		, \
74
+		./setup.py $(2) \
75
+	)
76
+	find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
77
+endef

+ 112
- 0
lang/python/patches/000-cross-compile.patch View File

@@ -0,0 +1,112 @@
1
+---
2
+ Makefile.pre.in |   25 +++++++++++++------------
3
+ 1 file changed, 13 insertions(+), 12 deletions(-)
4
+
5
+--- a/Makefile.pre.in
6
++++ b/Makefile.pre.in
7
+@@ -182,6 +182,7 @@ UNICODE_OBJS=   @UNICODE_OBJS@
8
+ 
9
+ PYTHON=		python$(EXE)
10
+ BUILDPYTHON=	python$(BUILDEXE)
11
++HOSTPYTHON=	$(BUILDPYTHON)
12
+ 
13
+ # The task to run while instrument when building the profile-opt target
14
+ PROFILE_TASK=	$(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
15
+@@ -214,6 +215,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
16
+ ##########################################################################
17
+ # Parser
18
+ PGEN=		Parser/pgen$(EXE)
19
++HOSTPGEN=	$(PGEN)$(EXE)
20
+ 
21
+ POBJS=		\
22
+ 		Parser/acceler.o \
23
+@@ -384,7 +386,7 @@ build_all_generate_profile:
24
+ 	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
25
+ 
26
+ run_profile_task:
27
+-	./$(BUILDPYTHON) $(PROFILE_TASK)
28
++	$(HOSTPYTHON) $(PROFILE_TASK)
29
+ 
30
+ build_all_use_profile:
31
+ 	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
32
+@@ -402,14 +404,14 @@ $(BUILDPYTHON):	Modules/python.o $(LIBRA
33
+ 			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
34
+ 
35
+ platform: $(BUILDPYTHON)
36
+-	$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
37
++	$(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
38
+ 
39
+ 
40
+ # Build the shared modules
41
+ sharedmods: $(BUILDPYTHON)
42
+ 	@case $$MAKEFLAGS in \
43
+-	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
44
+-	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
45
++	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
46
++	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
47
+ 	esac
48
+ 
49
+ # Build static library
50
+@@ -543,7 +545,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
51
+ $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
52
+ Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
53
+ 		-@$(INSTALL) -d Include
54
+-		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
55
++		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
56
+ 		-touch Parser/pgen.stamp
57
+ 
58
+ $(PGEN):	$(PGENOBJS)
59
+@@ -708,7 +710,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
60
+ 
61
+ TESTOPTS=	-l $(EXTRATESTOPTS)
62
+ TESTPROG=	$(srcdir)/Lib/test/regrtest.py
63
+-TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
64
++TESTPYTHON=	$(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
65
+ test:		all platform
66
+ 		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
67
+ 		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
68
+@@ -1062,7 +1064,7 @@ libainstall:	all python-config
69
+ # Install the dynamically loadable modules
70
+ # This goes into $(exec_prefix)
71
+ sharedinstall: sharedmods
72
+-	$(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
73
++	$(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
74
+ 	   	--prefix=$(prefix) \
75
+ 		--install-scripts=$(BINDIR) \
76
+ 		--install-platlib=$(DESTSHARED) \
77
+@@ -1100,7 +1102,7 @@ frameworkinstallstructure:	$(LDLIBRARY)
78
+ 		fi; \
79
+ 	done
80
+ 	$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
81
+-	sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
82
++	sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
83
+ 	$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
84
+ 	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
85
+ 	$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
86
+@@ -1135,7 +1137,7 @@ frameworkinstallextras:
87
+ # This installs a few of the useful scripts in Tools/scripts
88
+ scriptsinstall:
89
+ 	SRCDIR=$(srcdir) $(RUNSHARED) \
90
+-	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
91
++	$(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
92
+ 	--prefix=$(prefix) \
93
+ 	--install-scripts=$(BINDIR) \
94
+ 	--root=$(DESTDIR)/
95
+@@ -1157,7 +1159,7 @@ config.status:	$(srcdir)/configure
96
+ 
97
+ # Run reindent on the library
98
+ reindent:
99
+-	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
100
++	$(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
101
+ 
102
+ # Rerun configure with the same options as it was run last time,
103
+ # provided the config.status script exists
104
+@@ -1260,7 +1262,7 @@ funny:
105
+ 
106
+ # Perform some verification checks on any modified files.
107
+ patchcheck:
108
+-	$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
109
++	$(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
110
+ 
111
+ # Dependencies
112
+ 

+ 33
- 0
lang/python/patches/020-dont-compile-python-files.patch View File

@@ -0,0 +1,33 @@
1
+---
2
+ Makefile.pre.in |   16 ----------------
3
+ 1 file changed, 16 deletions(-)
4
+
5
+--- a/Makefile.pre.in
6
++++ b/Makefile.pre.in
7
+@@ -940,26 +940,6 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
8
+ 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
9
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
10
+ 	fi
11
+-	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
12
+-		./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
13
+-		-d $(LIBDEST) -f \
14
+-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
15
+-		$(DESTDIR)$(LIBDEST)
16
+-	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
17
+-		./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
18
+-		-d $(LIBDEST) -f \
19
+-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
20
+-		$(DESTDIR)$(LIBDEST)
21
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
22
+-		./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
23
+-		-d $(LIBDEST)/site-packages -f \
24
+-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
25
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
26
+-		./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
27
+-		-d $(LIBDEST)/site-packages -f \
28
+-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
29
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
30
+-		./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
31
+ 
32
+ # Create the PLATDIR source directory, if one wasn't distributed..
33
+ $(srcdir)/Lib/$(PLATDIR):

+ 50
- 0
lang/python/patches/030-fixup-include-dirs.patch View File

@@ -0,0 +1,50 @@
1
+---
2
+ setup.py |   15 ++-------------
3
+ 1 file changed, 2 insertions(+), 13 deletions(-)
4
+
5
+--- a/setup.py
6
++++ b/setup.py
7
+@@ -368,11 +368,6 @@ class PyBuildExt(build_ext):
8
+             os.unlink(tmpfile)
9
+ 
10
+     def detect_modules(self):
11
+-        # Ensure that /usr/local is always used
12
+-        add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
13
+-        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
14
+-        self.add_multiarch_paths()
15
+-
16
+         # Add paths specified in the environment variables LDFLAGS and
17
+         # CPPFLAGS for header and library files.
18
+         # We must get the values from the Makefile and not the environment
19
+@@ -407,17 +402,6 @@ class PyBuildExt(build_ext):
20
+                     for directory in reversed(options.dirs):
21
+                         add_dir_to_list(dir_list, directory)
22
+ 
23
+-        if os.path.normpath(sys.prefix) != '/usr' \
24
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
25
+-            # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
26
+-            # (PYTHONFRAMEWORK is set) to avoid # linking problems when
27
+-            # building a framework with different architectures than
28
+-            # the one that is currently installed (issue #7473)
29
+-            add_dir_to_list(self.compiler.library_dirs,
30
+-                            sysconfig.get_config_var("LIBDIR"))
31
+-            add_dir_to_list(self.compiler.include_dirs,
32
+-                            sysconfig.get_config_var("INCLUDEDIR"))
33
+-
34
+         try:
35
+             have_unicode = unicode
36
+         except NameError:
37
+@@ -426,11 +410,8 @@ class PyBuildExt(build_ext):
38
+         # lib_dirs and inc_dirs are used to search for files;
39
+         # if a file is found in one of those directories, it can
40
+         # be assumed that no additional -I,-L directives are needed.
41
+-        lib_dirs = self.compiler.library_dirs + [
42
+-            '/lib64', '/usr/lib64',
43
+-            '/lib', '/usr/lib',
44
+-            ]
45
+-        inc_dirs = self.compiler.include_dirs + ['/usr/include']
46
++        lib_dirs = self.compiler.library_dirs
47
++        inc_dirs = self.compiler.include_dirs
48
+         exts = []
49
+         missing = []
50
+ 

+ 43
- 0
lang/python/patches/040-dont-import-cross-compiled-modules.patch View File

@@ -0,0 +1,43 @@
1
+---
2
+ setup.py |   30 ------------------------------
3
+ 1 file changed, 30 deletions(-)
4
+
5
+--- a/setup.py
6
++++ b/setup.py
7
+@@ -307,36 +307,6 @@ class PyBuildExt(build_ext):
8
+         ext_filename = os.path.join(
9
+             self.build_lib,
10
+             self.get_ext_filename(self.get_ext_fullname(ext.name)))
11
+-        try:
12
+-            imp.load_dynamic(ext.name, ext_filename)
13
+-        except ImportError, why:
14
+-            self.failed.append(ext.name)
15
+-            self.announce('*** WARNING: renaming "%s" since importing it'
16
+-                          ' failed: %s' % (ext.name, why), level=3)
17
+-            assert not self.inplace
18
+-            basename, tail = os.path.splitext(ext_filename)
19
+-            newname = basename + "_failed" + tail
20
+-            if os.path.exists(newname):
21
+-                os.remove(newname)
22
+-            os.rename(ext_filename, newname)
23
+-
24
+-            # XXX -- This relies on a Vile HACK in
25
+-            # distutils.command.build_ext.build_extension().  The
26
+-            # _built_objects attribute is stored there strictly for
27
+-            # use here.
28
+-            # If there is a failure, _built_objects may not be there,
29
+-            # so catch the AttributeError and move on.
30
+-            try:
31
+-                for filename in self._built_objects:
32
+-                    os.remove(filename)
33
+-            except AttributeError:
34
+-                self.announce('unable to remove files (ignored)')
35
+-        except:
36
+-            exc_type, why, tb = sys.exc_info()
37
+-            self.announce('*** WARNING: importing extension "%s" '
38
+-                          'failed with %s: %s' % (ext.name, exc_type, why),
39
+-                          level=3)
40
+-            self.failed.append(ext.name)
41
+ 
42
+     def get_platform(self):
43
+         # Get value of sys.platform

+ 23
- 0
lang/python/patches/070-dont-clean-ipkg-install.patch View File

@@ -0,0 +1,23 @@
1
+---
2
+ Makefile.pre.in |    6 +++---
3
+ 1 file changed, 3 insertions(+), 3 deletions(-)
4
+
5
+--- a/Makefile.pre.in
6
++++ b/Makefile.pre.in
7
+@@ -1169,12 +1169,12 @@ TAGS::
8
+ # Sanitation targets -- clean leaves libraries, executables and tags
9
+ # files, which clobber removes as well
10
+ pycremoval:
11
+-	find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
12
++	find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
13
+ 
14
+ clean: pycremoval
15
+-	find . -name '*.[oa]' -exec rm -f {} ';'
16
+-	find . -name '*.s[ol]' -exec rm -f {} ';'
17
+-	find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
18
++	find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
19
++	find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
20
++	find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
21
+ 	find build -name 'fficonfig.h' -exec rm -f {} ';' || true
22
+ 	find build -name 'fficonfig.py' -exec rm -f {} ';' || true
23
+ 	-rm -f Lib/lib2to3/*Grammar*.pickle

+ 63
- 0
lang/python/patches/080-distutils-dont_adjust_files.patch View File

@@ -0,0 +1,63 @@
1
+---
2
+ Lib/distutils/command/build_scripts.py |   43 +++------------------------------
3
+ 1 file changed, 4 insertions(+), 39 deletions(-)
4
+
5
+--- a/Lib/distutils/command/build_scripts.py
6
++++ b/Lib/distutils/command/build_scripts.py
7
+@@ -51,10 +51,7 @@ class build_scripts (Command):
8
+ 
9
+ 
10
+     def copy_scripts (self):
11
+-        """Copy each script listed in 'self.scripts'; if it's marked as a
12
+-        Python script in the Unix way (first line matches 'first_line_re',
13
+-        ie. starts with "\#!" and contains "python"), then adjust the first
14
+-        line to refer to the current Python interpreter as we copy.
15
++        """Copy each script listed in 'self.scripts'
16
+         """
17
+         _sysconfig = __import__('sysconfig')
18
+         self.mkpath(self.build_dir)
19
+@@ -78,41 +75,9 @@ class build_scripts (Command):
20
+                 if not self.dry_run:
21
+                     raise
22
+                 f = None
23
+-            else:
24
+-                first_line = f.readline()
25
+-                if not first_line:
26
+-                    self.warn("%s is an empty file (skipping)" % script)
27
+-                    continue
28
+-
29
+-                match = first_line_re.match(first_line)
30
+-                if match:
31
+-                    adjust = 1
32
+-                    post_interp = match.group(1) or ''
33
+-
34
+-            if adjust:
35
+-                log.info("copying and adjusting %s -> %s", script,
36
+-                         self.build_dir)
37
+-                if not self.dry_run:
38
+-                    outf = open(outfile, "w")
39
+-                    if not _sysconfig.is_python_build():
40
+-                        outf.write("#!%s%s\n" %
41
+-                                   (self.executable,
42
+-                                    post_interp))
43
+-                    else:
44
+-                        outf.write("#!%s%s\n" %
45
+-                                   (os.path.join(
46
+-                            _sysconfig.get_config_var("BINDIR"),
47
+-                           "python%s%s" % (_sysconfig.get_config_var("VERSION"),
48
+-                                           _sysconfig.get_config_var("EXE"))),
49
+-                                    post_interp))
50
+-                    outf.writelines(f.readlines())
51
+-                    outf.close()
52
+-                if f:
53
+-                    f.close()
54
+-            else:
55
+-                if f:
56
+-                    f.close()
57
+-                self.copy_file(script, outfile)
58
++            if f:
59
++                f.close()
60
++            self.copy_file(script, outfile)
61
+ 
62
+         if os.name == 'posix':
63
+             for file in outfiles:

+ 15
- 0
lang/python/patches/110-enable-zlib.patch View File

@@ -0,0 +1,15 @@
1
+---
2
+ Modules/Setup.dist |    2 +-
3
+ 1 file changed, 1 insertion(+), 1 deletion(-)
4
+
5
+--- a/Modules/Setup.dist
6
++++ b/Modules/Setup.dist
7
+@@ -460,7 +460,7 @@ GLHACK=-Dclear=__GLclear
8
+ # Andrew Kuchling's zlib module.
9
+ # This require zlib 1.1.3 (or later).
10
+ # See http://www.gzip.org/zlib/
11
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
12
++zlib zlibmodule.c -lz
13
+ 
14
+ # Interface to the Expat XML parser
15
+ #

+ 25
- 0
lang/python/patches/120-force-internal-modules-for-hashlib.patch View File

@@ -0,0 +1,25 @@
1
+---
2
+ setup.py |   10 ++++++----
3
+ 1 file changed, 6 insertions(+), 4 deletions(-)
4
+
5
+--- a/setup.py
6
++++ b/setup.py
7
+@@ -704,8 +704,7 @@ class PyBuildExt(build_ext):
8
+ 
9
+         min_openssl_ver = 0x00907000
10
+         have_any_openssl = ssl_incs is not None and ssl_libs is not None
11
+-        have_usable_openssl = (have_any_openssl and
12
+-                               openssl_ver >= min_openssl_ver)
13
++        have_usable_openssl = False
14
+ 
15
+         if have_any_openssl:
16
+             if have_usable_openssl:
17
+@@ -730,7 +729,7 @@ class PyBuildExt(build_ext):
18
+                             depends = ['md5.h']) )
19
+ 
20
+         min_sha2_openssl_ver = 0x00908000
21
+-        if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
22
++        if True:
23
+             # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
24
+             exts.append( Extension('_sha256', ['sha256module.c']) )
25
+             exts.append( Extension('_sha512', ['sha512module.c']) )

+ 36
- 0
lang/python/patches/130-readline-setup.patch View File

@@ -0,0 +1,36 @@
1
+--- a/setup.py
2
++++ b/setup.py
3
+@@ -573,32 +573,7 @@ class PyBuildExt(build_ext):
4
+         # readline
5
+         do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
6
+         readline_termcap_library = ""
7
+-        curses_library = ""
8
+-        # Determine if readline is already linked against curses or tinfo.
9
+-        if do_readline and find_executable('ldd'):
10
+-            fp = os.popen("ldd %s" % do_readline)
11
+-            ldd_output = fp.readlines()
12
+-            ret = fp.close()
13
+-            if ret is None or ret >> 8 == 0:
14
+-                for ln in ldd_output:
15
+-                    if 'curses' in ln:
16
+-                        readline_termcap_library = re.sub(
17
+-                            r'.*lib(n?cursesw?)\.so.*', r'\1', ln
18
+-                        ).rstrip()
19
+-                        break
20
+-                    if 'tinfo' in ln: # termcap interface split out from ncurses
21
+-                        readline_termcap_library = 'tinfo'
22
+-                        break
23
+-        # Issue 7384: If readline is already linked against curses,
24
+-        # use the same library for the readline and curses modules.
25
+-        if 'curses' in readline_termcap_library:
26
+-            curses_library = readline_termcap_library
27
+-        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
28
+-            curses_library = 'ncursesw'
29
+-        elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
30
+-            curses_library = 'ncurses'
31
+-        elif self.compiler.find_library_file(lib_dirs, 'curses'):
32
+-            curses_library = 'curses'
33
++        curses_library = "ncurses"
34
+ 
35
+         if platform == 'darwin':
36
+             os_release = int(os.uname()[2].split('.')[0])

+ 11
- 0
lang/python/patches/140-verbose-sharedmods.patch View File

@@ -0,0 +1,11 @@
1
+--- a/Makefile.pre.in
2
++++ b/Makefile.pre.in
3
+@@ -410,7 +410,7 @@ platform: $(BUILDPYTHON)
4
+ # Build the shared modules
5
+ sharedmods: $(BUILDPYTHON)
6
+ 	@case $$MAKEFLAGS in \
7
+-	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
8
++	*s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
9
+ 	*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
10
+ 	esac
11
+ 

+ 10
- 0
lang/python/patches/150-no-sqlite-rpath.patch View File

@@ -0,0 +1,10 @@
1
+--- a/setup.py
2
++++ b/setup.py
3
+@@ -1021,7 +1021,6 @@ class PyBuildExt(build_ext):
4
+                                   include_dirs=["Modules/_sqlite",
5
+                                                 sqlite_incdir],
6
+                                   library_dirs=sqlite_libdir,
7
+-                                  runtime_library_dirs=sqlite_libdir,
8
+                                   extra_link_args=sqlite_extra_link_args,
9
+                                   libraries=["sqlite3",]))
10
+         else: