|
@@ -31,7 +31,7 @@ HOST_BUILD_PARALLEL:=1
|
31
|
31
|
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
|
32
|
32
|
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
|
33
|
33
|
|
34
|
|
-PKG_BUILD_DEPENDS:=python3/host
|
|
34
|
+PKG_BUILD_DEPENDS:=libffi/host python3/host
|
35
|
35
|
|
36
|
36
|
include $(INCLUDE_DIR)/host-build.mk
|
37
|
37
|
include $(INCLUDE_DIR)/package.mk
|
|
@@ -54,69 +54,62 @@ define Package/python3/Default/description
|
54
|
54
|
the development of higher quality, more maintainable code.
|
55
|
55
|
endef
|
56
|
56
|
|
57
|
|
-define Package/python3
|
|
57
|
+define Package/python3-base
|
58
|
58
|
$(call Package/python3/Default)
|
|
59
|
+ TITLE:=Python $(PYTHON_VERSION) interpreter
|
59
|
60
|
DEPENDS:=+libpthread +zlib +libffi
|
60
|
61
|
endef
|
61
|
62
|
|
|
63
|
+define Package/python3-base/description
|
|
64
|
+ This package contains only the interpreter and the bare minimum
|
|
65
|
+ for the interpreter to start.
|
|
66
|
+endef
|
|
67
|
+
|
|
68
|
+define Package/python3
|
|
69
|
+$(call Package/python3/Default)
|
|
70
|
+ DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47 +libopenssl
|
|
71
|
+endef
|
|
72
|
+
|
62
|
73
|
define Package/python3/description
|
63
|
|
-$(call Package/python3/Default/description)
|
64
|
|
- .
|
65
|
|
- This package contains only the interpreter and the bare minimum for the interpreter to start.
|
|
74
|
+ This package contains the (almost) full Python install.
|
66
|
75
|
endef
|
67
|
76
|
|
68
|
|
-MAKE_FLAGS:=\
|
69
|
|
- $(TARGET_CONFIGURE_OPTS) \
|
70
|
|
- DESTDIR="$(PKG_INSTALL_DIR)" \
|
|
77
|
+MAKE_FLAGS+=\
|
71
|
78
|
CROSS_COMPILE=yes \
|
72
|
|
- CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
|
73
|
|
- LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \
|
74
|
|
- LD="$(TARGET_CC)"
|
|
79
|
+ LD="$(TARGET_CC)" \
|
|
80
|
+ PGEN=pgen3
|
|
81
|
+
|
|
82
|
+EXTRA_CFLAGS+= \
|
|
83
|
+ -DNDEBUG -fno-inline
|
|
84
|
+EXTRA_LDFLAGS+= \
|
|
85
|
+ -L$(PKG_BUILD_DIR)
|
75
|
86
|
|
76
|
87
|
ENABLE_IPV6:=
|
77
|
88
|
ifeq ($(CONFIG_IPV6),y)
|
78
|
89
|
ENABLE_IPV6 += --enable-ipv6
|
79
|
90
|
endif
|
80
|
91
|
|
81
|
|
-#=======================================================================
|
82
|
|
-# Notes: adding these so that I don't forget, and can track why stuff
|
83
|
|
-# was did as was did
|
84
|
|
-# - Arguments below were moved to ./files/config.site file, and disabled
|
85
|
|
-# ac_cv_have_chflags=no \
|
86
|
|
-# ac_cv_have_lchflags=no \
|
87
|
|
-# ac_cv_py_format_size_t=no \
|
88
|
|
-# ac_cv_have_long_long_format=yes \
|
89
|
|
-# ac_cv_buggy_getaddrinfo=no \
|
90
|
|
-# - --without-ensurepip added, because the build wants to ensure that
|
91
|
|
-# it works; that's a good idea, but for now, it requires special
|
92
|
|
-# setup, and we can do that later
|
93
|
|
-# - --without-pymalloc added, becase in Python 3, modules are suffixed
|
94
|
|
-# with m; e.g. so some paths are python3.4m instead of python3.4
|
95
|
|
-# all this is detailed here:
|
96
|
|
-# http://legacy.python.org/dev/peps/pep-3149/
|
97
|
|
-#=======================================================================
|
98
|
|
-
|
99
|
|
-define Build/Configure
|
100
|
|
- -$(MAKE) -C $(PKG_BUILD_DIR) distclean
|
101
|
|
- (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
|
102
|
|
- $(CP) ./files/config.site $(PKG_BUILD_DIR)
|
103
|
|
- $(call Build/Configure/Default, \
|
104
|
|
- --sysconfdir=/etc \
|
105
|
|
- --enable-shared \
|
106
|
|
- --without-cxx-main \
|
107
|
|
- --with-threads \
|
108
|
|
- --with-system-ffi="$(STAGING_DIR)/usr" \
|
109
|
|
- --without-ensurepip \
|
110
|
|
- --without-pymalloc \
|
111
|
|
- $(ENABLE_IPV6) \
|
112
|
|
- CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
|
113
|
|
- OPT="$(TARGET_CFLAGS)" \
|
114
|
|
- )
|
|
92
|
+CONFIGURE_ARGS+= \
|
|
93
|
+ --sysconfdir=/etc \
|
|
94
|
+ --enable-shared \
|
|
95
|
+ --without-cxx-main \
|
|
96
|
+ --with-threads \
|
|
97
|
+ --with-system-ffi="$(STAGING_DIR)/usr" \
|
|
98
|
+ --without-pymalloc \
|
|
99
|
+ --without-ensurepip \
|
|
100
|
+ $(ENABLE_IPV6) \
|
|
101
|
+ CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
|
|
102
|
+ OPT="$(TARGET_CFLAGS)"
|
|
103
|
+
|
|
104
|
+define Build/Prepare
|
|
105
|
+ $(call Build/Prepare/Default)
|
|
106
|
+ $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
|
115
|
107
|
endef
|
116
|
108
|
|
117
|
109
|
define Build/InstallDev
|
118
|
|
- $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
|
119
|
110
|
$(INSTALL_DIR) $(STAGING_DIR)/mk/
|
|
111
|
+ $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
|
|
112
|
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
|
120
|
113
|
$(INSTALL_DATA) ./files/python3-package.mk $(STAGING_DIR)/mk/
|
121
|
114
|
$(CP) \
|
122
|
115
|
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
|
|
@@ -128,14 +121,9 @@ define Build/InstallDev
|
128
|
121
|
$(CP) \
|
129
|
122
|
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
|
130
|
123
|
$(1)/usr/lib/python$(PYTHON_VERSION)/
|
131
|
|
-
|
132
|
|
- $(CP) \
|
133
|
|
- $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \
|
134
|
|
- $(2)/bin/
|
135
|
|
- $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
|
136
|
124
|
endef
|
137
|
125
|
|
138
|
|
-define Py3Package/python3/filespec
|
|
126
|
+define Py3Package/python3-base/filespec
|
139
|
127
|
+|/usr/bin/python$(PYTHON_VERSION)
|
140
|
128
|
+|/usr/lib/python$(PYTHON_VERSION)/encodings
|
141
|
129
|
+|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
|
|
@@ -153,7 +141,25 @@ define Py3Package/python3/filespec
|
153
|
141
|
+|/usr/lib/python$(PYTHON_VERSION)/stat.py
|
154
|
142
|
endef
|
155
|
143
|
|
156
|
|
-define Py3Package/python3/install
|
|
144
|
+define Py3Package/python3/filespec
|
|
145
|
++|/usr/lib/python$(PYTHON_VERSION)
|
|
146
|
+-|/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)
|
|
147
|
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
|
|
148
|
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
|
|
149
|
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
|
|
150
|
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
|
|
151
|
+-|/usr/lib/python$(PYTHON_VERSION)/tkinter
|
|
152
|
+-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
|
|
153
|
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
|
|
154
|
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.so
|
|
155
|
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
|
|
156
|
+-|/usr/lib/python$(PYTHON_VERSION)/test
|
|
157
|
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
|
|
158
|
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
|
|
159
|
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
|
|
160
|
+endef
|
|
161
|
+
|
|
162
|
+define Py3Package/python3-base/install
|
157
|
163
|
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
|
158
|
164
|
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
|
159
|
165
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
@@ -161,39 +167,30 @@ define Py3Package/python3/install
|
161
|
167
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
|
162
|
168
|
endef
|
163
|
169
|
|
164
|
|
-define Host/Configure
|
165
|
|
- -$(MAKE) -C $(HOST_BUILD_DIR) distclean
|
166
|
|
- (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
|
167
|
|
- (cd $(HOST_BUILD_DIR); \
|
168
|
|
- rm -rf config.cache; \
|
169
|
|
- CONFIG_SITE= \
|
170
|
|
- OPT="$(HOST_CFLAGS)" \
|
171
|
|
- ./configure \
|
172
|
|
- --without-cxx-main \
|
173
|
|
- --without-ensurepip \
|
174
|
|
- --without-pymalloc \
|
175
|
|
- --with-threads \
|
176
|
|
- --prefix=$(STAGING_DIR_HOST); \
|
177
|
|
- )
|
178
|
|
-endef
|
|
170
|
+HOST_CONFIGURE_ARGS+= \
|
|
171
|
+ --without-cxx-main \
|
|
172
|
+ --without-pymalloc \
|
|
173
|
+ --without-ensurepip \
|
|
174
|
+ --with-threads \
|
|
175
|
+ --prefix=$(STAGING_DIR_HOST) \
|
|
176
|
+ CONFIG_SITE= \
|
|
177
|
+ OPT="$(HOST_CFLAGS)"
|
179
|
178
|
|
180
|
179
|
define Host/Compile
|
181
|
|
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
182
|
|
- python Parser/pgen
|
183
|
|
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
|
184
|
|
- sharedmods
|
|
180
|
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
|
|
181
|
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
|
185
|
182
|
endef
|
186
|
183
|
|
187
|
184
|
define Host/Install
|
188
|
185
|
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
|
189
|
|
- $(MAKE) -C $(HOST_BUILD_DIR) \
|
190
|
|
- install
|
191
|
|
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/
|
|
186
|
+ $(MAKE) -C $(HOST_BUILD_DIR) install
|
|
187
|
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen3
|
192
|
188
|
endef
|
193
|
189
|
|
194
|
|
-
|
195
|
190
|
$(eval $(call HostBuild))
|
196
|
191
|
|
|
192
|
+$(eval $(call Py3Package,python3-base))
|
197
|
193
|
$(eval $(call Py3Package,python3))
|
198
|
194
|
|
|
195
|
+$(eval $(call BuildPackage,python3-base))
|
199
|
196
|
$(eval $(call BuildPackage,python3))
|