@@ -133,10 +133,23 @@ build/python/ios-simulator/Python: src/Python-$(PYTHON_VERSION)/build
133
133
cd src/Python-$(PYTHON_VERSION ) && patch -p1 -R < ../../patch/Python/$(PYTHON_VERSION ) /ctypes_duplicate.patch
134
134
# cd src/Python-$(PYTHON_VERSION) && patch -p1 -R < ../../patch/Python/$(PYTHON_VERSION)/pyconfig.patch
135
135
# Clean up build directory
136
+ cd build/python/ios-simulator/lib/python2.7 && rm config/libpython2.7.a config/python.o config/config.c.in config/makesetup
136
137
cd build/python/ios-simulator/lib/python2.7 && rm -rf * test* lib* wsgiref bsddb curses idlelib hotshot
137
138
cd build/python/ios-simulator/lib/python2.7 && find . -iname ' *.pyc' | xargs rm
138
139
cd build/python/ios-simulator/lib/python2.7 && find . -iname ' *.py' | xargs rm
139
140
cd build/python/ios-simulator/lib && rm -rf pkgconfig
141
+ # Pack libraries into .zip file
142
+ cd build/python/ios-simulator/lib/python2.7 && mv config ..
143
+ cd build/python/ios-simulator/lib/python2.7 && mv site-packages ..
144
+ cd build/python/ios-simulator/lib/python2.7 && zip -r ../python27.zip *
145
+ cd build/python/ios-simulator/lib/python2.7 && rm -rf *
146
+ cd build/python/ios-simulator/lib/python2.7 && mv ../config .
147
+ cd build/python/ios-simulator/lib/python2.7 && mv ../site-packages .
148
+ # Move all headers except for pyconfig.h into a Headers directory
149
+ mkdir -p build/python/ios-simulator/Headers
150
+ cd build/python/ios-simulator/Headers && mv ../include/python2.7/* .
151
+ cd build/python/ios-simulator/Headers && mv pyconfig.h ../include/python2.7
152
+
140
153
141
154
build/python/ios-armv7/Python : src/Python-$(PYTHON_VERSION ) /build
142
155
# Apply extra patches for iPhone build
@@ -161,26 +174,39 @@ build/python/ios-armv7/Python: src/Python-$(PYTHON_VERSION)/build
161
174
cd src/Python-$(PYTHON_VERSION ) && patch -p1 -R < ../../patch/Python/$(PYTHON_VERSION ) /ctypes_duplicate.patch
162
175
# cd src/Python-$(PYTHON_VERSION) && patch -p1 -R < ../../patch/Python/$(PYTHON_VERSION)/pyconfig.patch
163
176
# Clean up build directory
177
+ cd build/python/ios-armv7/lib/python2.7 && rm config/libpython2.7.a config/python.o config/config.c.in config/makesetup
164
178
cd build/python/ios-armv7/lib/python2.7 && rm -rf * test* lib* wsgiref bsddb curses idlelib hotshot
165
179
cd build/python/ios-armv7/lib/python2.7 && find . -iname ' *.pyc' | xargs rm
166
180
cd build/python/ios-armv7/lib/python2.7 && find . -iname ' *.py' | xargs rm
167
181
cd build/python/ios-armv7/lib && rm -rf pkgconfig
182
+ # Pack libraries into .zip file
183
+ cd build/python/ios-armv7/lib/python2.7 && mv config ..
184
+ cd build/python/ios-armv7/lib/python2.7 && mv site-packages ..
185
+ cd build/python/ios-armv7/lib/python2.7 && zip -r ../python27.zip *
186
+ cd build/python/ios-armv7/lib/python2.7 && rm -rf *
187
+ cd build/python/ios-armv7/lib/python2.7 && mv ../config .
188
+ cd build/python/ios-armv7/lib/python2.7 && mv ../site-packages .
189
+ # Move all headers except for pyconfig.h into a Headers directory
190
+ mkdir -p build/python/ios-simulator/Headers
191
+ cd build/python/ios-simulator/Headers && mv ../include/python2.7/* .
192
+ cd build/python/ios-simulator/Headers && mv pyconfig.h ../include/python2.7
168
193
169
194
build/Python.framework : build/python/ios-simulator/Python build/python/ios-armv7/Python
170
195
# Create the framework directory from the compiled resrouces
171
196
mkdir -p build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /
172
197
cd build/Python.framework/Versions && ln -fs $(basename $(PYTHON_VERSION ) ) Current
173
- # Use the include and .pyo files from the simulator build.
174
- cp -r build/python/ios-simulator/include/python $( basename $( PYTHON_VERSION ) ) build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Headers
198
+ # Copy the headers from the simulator
199
+ cp -r build/python/ios-simulator/Headers build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Headers
175
200
cd build/Python.framework && ln -fs Versions/Current/Headers
176
- mkdir -p build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Resources
177
- cp -r build/python/ios-simulator/lib build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Resources/lib
178
- mkdir -p build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Resources/include/python2.7
179
- cp -r build/python/ios-simulator/include/python2.7/pyconfig.h build/Python.framework/Versions/$(basename $(PYTHON_VERSION ) ) /Resources/include/python2.7/pyconfig.h
180
- cd build/Python.framework && ln -fs Versions/Current/Resources
181
201
# Build a fat library with all targets included.
182
202
xcrun lipo -create -output build/Python.framework/Versions/Current/Python build/python/ios-simulator/Python build/python/ios-armv7/Python
183
203
cd build/Python.framework && ln -fs Versions/Current/Python
204
+ # Clean up simulator dir
205
+ rm -rf build/python/ios-simulator/bin
206
+ rm -rf build/python/ios-simulator/Python
207
+ # Clean up armv7 dir
208
+ rm -rf build/python/ios-armv7/bin
209
+ rm -rf build/python/ios-armv7/Python
184
210
185
211
env :
186
212
# PYTHON_VERSION $(PYTHON_VERSION)
0 commit comments