c2c552e7a9
Numpy requires severals requirements: - It absolutely requires unittest, that was deleted before (reduce-python.sh) - It requires future_builtins (ModuleSetup) - Deduplication of symbols now can merge multiple .a for easier management in Xcode (tools/environments.sh) - Avoid passing specific linker parameters to ar (-Wl ignored in tools/liblink). Numpy itself have few patch for: - force endianess to be little, using directly endian.h leads to detection error during the build process. - force not BLAS to be built, Accelerate framework already have it - rework the dependencies relation for lapack_lite and _umath_linalg, to prevent duplicate symbols and force compilation of necessary module / missing symbols.
33 lines
905 B
Bash
Executable file
33 lines
905 B
Bash
Executable file
#!/bin/bash
|
|
|
|
. $(dirname $0)/environment.sh
|
|
|
|
if [ -f $BUILDROOT/python/lib/python27.zip ]; then
|
|
echo "Python already reduced and compressed."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Starting reducing python 2.7"
|
|
|
|
try rm -rf $BUILDROOT/python/embed/include/python2.7
|
|
try mkdir -p $BUILDROOT/python/embed/include/python2.7
|
|
try cp $BUILDROOT/python/include/python2.7/pyconfig.h $BUILDROOT/python/embed/include/python2.7/pyconfig.h
|
|
|
|
try cd $BUILDROOT/python/lib/python2.7
|
|
find . -iname '*.pyc' | xargs rm
|
|
find . -iname '*.py' | xargs rm
|
|
find . -iname 'test*' | xargs rm -rf
|
|
rm -rf lib* wsgiref bsddb curses idlelib hotshot || true
|
|
try cd ..
|
|
rm -rf pkgconfig || true
|
|
|
|
echo "Compressing to python27.zip"
|
|
try pushd $BUILDROOT/python/lib/python2.7
|
|
rm config/libpython2.7.a config/python.o config/config.c.in config/makesetup
|
|
mv config ..
|
|
mv site-packages ..
|
|
zip -r ../python27.zip *
|
|
rm -rf *
|
|
mv ../config .
|
|
mv ../site-packages .
|
|
popd
|