用于python-for-android的matplotlib编译方法

时间:2015-05-18 05:47:23

标签: android python numpy matplotlib

我只是想知道我是否正在编写matplotlib的编译配方。我还想知道是否必须在build_matplotlib函数或任何其他依赖项中包含numpy,或者我只是在函数末尾使用try语句?

这是我到目前为止所做的:

VERSION_matplotlib=${VERSION_matplotlib:-1.4.3}
DEPS_matplotlib=(numpy python dateutil pyparsing six linpng pytz freetype agg PyCXX qhull ttconv)
URL_matplotlib=http://pypi.python.org/packages/source/m/matplotlib/matplotlib-$VERSION_matplotlib.tar.gz
MD5_matplotlib=f43c20480a1673185afefc7d4848a1d2
BUILD_matplotlib=$BUILD_PATH/matplotlib/$(get_directory $URL_matplotlib)
RECIPE_matplotlib=$RECIPES_PATH/matplotlib

# function called for preparing source code if needed
# (you can apply patch etc here.)
function prebuild_matplotlib() {
    true
}

function shouldbuild_lxml() {
    if [ -d "$SITEPACKAGES_PATH/matplotlib" ]; then
        DO_BUILD=0
    fi
}

# function called to build the source code
function build_matplotlib() {
    cd $BUILD_matplotlib

    push_arm

    export CC="$CC -I$BUILD_numpy/"
    export LDFLAGS="-L$BUILD_numpy/numpy/.libs -L$BUILD_numpy/numpy/.libs -L$BUILD_numpy/.libs -L$BUILD_numpy/numpy -L$BUILD_numpy/numpy -L$BUILD_numpy/  $LDFLAGS"
    export LDSHARED="$LIBLINK"

    chmod +x $BUILD_numpy/numpy-config
    export PATH=$PATH:$BUILD_numpy
    #plus more for the other dependencies
    try $HOSTPYTHON setup.py build_ext -I$BUILD_matplotlib
    try find . -iname '*.pyx' -exec $CYTHON {} \;
    try $HOSTPYTHON setup.py build_ext -v
    try find build/lib.* -name "*.o" -exec $STRIP {} \;

    export PYTHONPATH=$BUILD_hostpython/Lib/site-packages
    try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages

    unset LDSHARED
    pop_arm
}

# function called after all the compile have been done
function postbuild_matplotlib() {
    true
}

0 个答案:

没有答案