|
@@ -1,5 +1,5 @@
|
1
|
1
|
#
|
2
|
|
-# Copyright (C) 2006-2014 OpenWrt.org
|
|
2
|
+# Copyright (C) 2006-2015 OpenWrt.org
|
3
|
3
|
#
|
4
|
4
|
# This is free software, licensed under the GNU General Public License v2.
|
5
|
5
|
# See /LICENSE for more information.
|
|
@@ -57,7 +57,7 @@ endef
|
57
|
57
|
define Package/python3-base
|
58
|
58
|
$(call Package/python3/Default)
|
59
|
59
|
TITLE:=Python $(PYTHON_VERSION) interpreter
|
60
|
|
- DEPENDS:=+libpthread +zlib +libffi +libopenssl
|
|
60
|
+ DEPENDS:=+libpthread +zlib
|
61
|
61
|
endef
|
62
|
62
|
|
63
|
63
|
define Package/python3-base/description
|
|
@@ -65,13 +65,45 @@ define Package/python3-base/description
|
65
|
65
|
for the interpreter to start.
|
66
|
66
|
endef
|
67
|
67
|
|
|
68
|
+define Package/python3-light
|
|
69
|
+$(call Package/python3/Default)
|
|
70
|
+ TITLE:=Python $(PYTHON_VERSION) light installation
|
|
71
|
+ DEPENDS:=+python3-base +libffi +libbz2
|
|
72
|
+endef
|
|
73
|
+
|
|
74
|
+define Package/python3-light/description
|
|
75
|
+ This package is essentially the python3-base package plus
|
|
76
|
+ a few of the rarely used (and big) libraries stripped out
|
|
77
|
+ into separate packages.
|
|
78
|
+endef
|
|
79
|
+
|
|
80
|
+# Define newline here, since it's not defined in OpenWRT
|
|
81
|
+define newline
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+endef
|
|
85
|
+
|
|
86
|
+PYTHON3_LIB_FILES_DEL:=
|
|
87
|
+PYTHON3_PACKAGES:=
|
|
88
|
+PYTHON3_SO_SUFFIX:=cpython-34.so
|
|
89
|
+define Py3BasePackage
|
|
90
|
+ PYTHON3_PACKAGES+=$(1)
|
|
91
|
+ PYTHON3_LIB_FILES_DEL+=$(2)
|
|
92
|
+ define Py3Package/$(1)/filespec
|
|
93
|
+ $(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
|
|
94
|
+ endef
|
|
95
|
+endef
|
|
96
|
+
|
|
97
|
+include ./files/python3-package-*.mk
|
|
98
|
+
|
68
|
99
|
define Package/python3
|
69
|
100
|
$(call Package/python3/Default)
|
70
|
|
- DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47
|
|
101
|
+ DEPENDS:=+python3-light $(foreach package,$(PYTHON3_PACKAGES),+$(package))
|
71
|
102
|
endef
|
72
|
103
|
|
73
|
104
|
define Package/python3/description
|
74
|
105
|
This package contains the (almost) full Python install.
|
|
106
|
+ It's python3-light + all other packages.
|
75
|
107
|
endef
|
76
|
108
|
|
77
|
109
|
MAKE_FLAGS+=\
|
|
@@ -123,29 +155,34 @@ define Build/InstallDev
|
123
|
155
|
$(1)/usr/lib/python$(PYTHON_VERSION)/
|
124
|
156
|
endef
|
125
|
157
|
|
|
158
|
+PYTHON3_BASE_LIB_FILES:= \
|
|
159
|
+ /usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
|
|
160
|
+ /usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py \
|
|
161
|
+ /usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
|
|
162
|
+ /usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \
|
|
163
|
+ /usr/lib/python$(PYTHON_VERSION)/abc.py \
|
|
164
|
+ /usr/lib/python$(PYTHON_VERSION)/codecs.py \
|
|
165
|
+ /usr/lib/python$(PYTHON_VERSION)/genericpath.py \
|
|
166
|
+ /usr/lib/python$(PYTHON_VERSION)/io.py \
|
|
167
|
+ /usr/lib/python$(PYTHON_VERSION)/os.py \
|
|
168
|
+ /usr/lib/python$(PYTHON_VERSION)/posixpath.py \
|
|
169
|
+ /usr/lib/python$(PYTHON_VERSION)/site.py \
|
|
170
|
+ /usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
|
|
171
|
+ /usr/lib/python$(PYTHON_VERSION)/stat.py
|
|
172
|
+
|
|
173
|
+PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
|
|
174
|
+
|
126
|
175
|
define Py3Package/python3-base/filespec
|
127
|
176
|
+|/usr/bin/python$(PYTHON_VERSION)
|
128
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/encodings
|
129
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
|
130
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py
|
131
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py
|
132
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
|
133
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/abc.py
|
134
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/codecs.py
|
135
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
|
136
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/io.py
|
137
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/os.py
|
138
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
|
139
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/site.py
|
140
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
|
141
|
|
-+|/usr/lib/python$(PYTHON_VERSION)/stat.py
|
|
177
|
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
|
142
|
178
|
endef
|
143
|
179
|
|
144
|
|
-define Py3Package/python3/filespec
|
|
180
|
+define Py3Package/python3-light/filespec
|
145
|
181
|
+|/usr/lib/python$(PYTHON_VERSION)
|
146
|
182
|
-|/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)
|
147
|
183
|
-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
|
148
|
184
|
-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
|
|
185
|
+-|/usr/lib/python$(PYTHON_VERSION)/ensurepip
|
149
|
186
|
-|/usr/lib/python$(PYTHON_VERSION)/idlelib
|
150
|
187
|
-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
|
151
|
188
|
-|/usr/lib/python$(PYTHON_VERSION)/tkinter
|
|
@@ -157,6 +194,8 @@ define Py3Package/python3/filespec
|
157
|
194
|
-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
|
158
|
195
|
-|/usr/lib/python$(PYTHON_VERSION)/*/test
|
159
|
196
|
-|/usr/lib/python$(PYTHON_VERSION)/*/tests
|
|
197
|
+-|/usr/lib/python$(PYTHON_VERSION)/_osx_support.py
|
|
198
|
+$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
|
160
|
199
|
endef
|
161
|
200
|
|
162
|
201
|
define Py3Package/python3-base/install
|
|
@@ -167,6 +206,14 @@ define Py3Package/python3-base/install
|
167
|
206
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
|
168
|
207
|
endef
|
169
|
208
|
|
|
209
|
+define Py3Package/python3/filespec
|
|
210
|
+-|$(PYTHON3_PKG_DIR)
|
|
211
|
+endef
|
|
212
|
+
|
|
213
|
+HOST_CFLAGS+= \
|
|
214
|
+ -I/usr/include/ncursesw \
|
|
215
|
+ -I/usr/include/ncurses
|
|
216
|
+
|
170
|
217
|
HOST_CONFIGURE_ARGS+= \
|
171
|
218
|
--without-cxx-main \
|
172
|
219
|
--without-pymalloc \
|
|
@@ -174,7 +221,7 @@ HOST_CONFIGURE_ARGS+= \
|
174
|
221
|
--prefix=$(STAGING_DIR_HOST) \
|
175
|
222
|
--with-ensurepip=upgrade \
|
176
|
223
|
CONFIG_SITE= \
|
177
|
|
- OPT="$(HOST_CFLAGS)"
|
|
224
|
+ CFLAGS="$(HOST_CFLAGS)"
|
178
|
225
|
|
179
|
226
|
define Host/Compile
|
180
|
227
|
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
|
|
@@ -189,8 +236,15 @@ endef
|
189
|
236
|
|
190
|
237
|
$(eval $(call HostBuild))
|
191
|
238
|
|
|
239
|
+$(foreach package, $(PYTHON3_PACKAGES), \
|
|
240
|
+ $(eval $(call Py3Package,$(package))) \
|
|
241
|
+ $(eval $(call BuildPackage,$(package))) \
|
|
242
|
+)
|
|
243
|
+
|
192
|
244
|
$(eval $(call Py3Package,python3-base))
|
|
245
|
+$(eval $(call Py3Package,python3-light))
|
193
|
246
|
$(eval $(call Py3Package,python3))
|
194
|
247
|
|
195
|
248
|
$(eval $(call BuildPackage,python3-base))
|
|
249
|
+$(eval $(call BuildPackage,python3-light))
|
196
|
250
|
$(eval $(call BuildPackage,python3))
|