<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    The following is based on kivy/python-for-android<br>
    So currently on Android pyjnius needs sdl so we need to compile sdl
    first<br>
    <br>
    sdl source can be found here<br>
    <a class="moz-txt-link-freetext" href="https://github.com/kivy/python-for-android/tree/master/src/jni/">https://github.com/kivy/python-for-android/tree/master/src/jni/</a><br>
    <br>
    this is what python-for-android do for sdl :<br>
    <br>
    push_arm <== initialize environment , define in distribute.sh<br>
    try ndk-build V=1 <== build<br>
    pop_arm <== leave environment <br>
    try cp -a $SRC_PATH/libs/$ARCH/*.so $LIBS_PATH <br>
    <br>
    next for pyjnius :<br>
    <br>
    push_arm <== initialize environment , define in distribute.sh<br>
    <br>
        export LDFLAGS="$LDFLAGS -L$LIBS_PATH"<br>
        export LDSHARED="$LIBLINK"<br>
    <br>
        # fake try to be able to cythonize generated files<br>
        $HOSTPYTHON setup.py build_ext   <=$HOSTPYTHON seems to be a
    local python binary compiled just before<br>
        try find . -iname '*.pyx' -exec $CYTHON {} \;  <= $CYTHON is
    a system wide installed cython<br>
        try $HOSTPYTHON setup.py build_ext -v<br>
        try find build/lib.* -name "*.o" -exec $STRIP {} \;<br>
        try $HOSTPYTHON setup.py install -O2<br>
        try cp -a jnius/src/org $JAVACLASS_PATH<br>
    <br>
        unset LDSHARED<br>
        pop_arm<br>
    <br>
    <br>
    detail of push_arm :<br>
    <br>
    function push_arm() {<br>
        info "Entering in ARM environment"<br>
    <br>
        # save for pop<br>
        export OLD_PATH=$PATH<br>
        export OLD_CFLAGS=$CFLAGS<br>
        export OLD_CXXFLAGS=$CXXFLAGS<br>
        export OLD_LDFLAGS=$LDFLAGS<br>
        export OLD_CC=$CC<br>
        export OLD_CXX=$CXX<br>
        export OLD_AR=$AR<br>
        export OLD_RANLIB=$RANLIB<br>
        export OLD_STRIP=$STRIP<br>
        export OLD_MAKE=$MAKE<br>
        export OLD_LD=$LD<br>
    <br>
        # to override the default optimization, set OFLAG<br>
        #export OFLAG="-Os"<br>
        #export OFLAG="-O2"<br>
    <br>
        export CFLAGS="-DANDROID -mandroid $OFLAG -fomit-frame-pointer
    --sysroot $NDKPLATFORM"<br>
        if [ "X$ARCH" == "Xarmeabi-v7a" ]; then<br>
            CFLAGS+=" -march=armv7-a -mfloat-abi=softfp -mfpu=vfp
    -mthumb"<br>
        fi<br>
        export CXXFLAGS="$CFLAGS"<br>
    <br>
        # that could be done only for darwin platform, but it doesn't
    hurt.<br>
        export LDFLAGS="-lm"<br>
    <br>
        # this must be something depending of the API level of Android<br>
        PYPLATFORM=$($PYTHON -c 'from __future__ import print_function;
    import sys; print(sys.platform)')<br>
        if [ "$PYPLATFORM" == "linux2" ]; then<br>
            PYPLATFORM="linux"<br>
        elif [ "$PYPLATFORM" == "linux3" ]; then<br>
            PYPLATFORM="linux"<br>
        fi<br>
    <br>
        if [ "X$ANDROIDNDKVER" == "Xr5b" ]; then<br>
            export TOOLCHAIN_PREFIX=arm-eabi<br>
            export TOOLCHAIN_VERSION=4.4.0<br>
        elif [ "X${ANDROIDNDKVER:0:2}" == "Xr7" ] || [
    "X${ANDROIDNDKVER:0:2}" == "Xr8" ]; then<br>
            export TOOLCHAIN_PREFIX=arm-linux-androideabi<br>
            export TOOLCHAIN_VERSION=4.4.3<br>
        elif  [ "X${ANDROIDNDKVER:0:2}" == "Xr9" ]; then<br>
            export TOOLCHAIN_PREFIX=arm-linux-androideabi<br>
            export TOOLCHAIN_VERSION=4.8<br>
        elif [ "X${ANDROIDNDKVER:0:3}" == "Xr10" ]; then<br>
            export TOOLCHAIN_PREFIX=arm-linux-androideabi<br>
            export TOOLCHAIN_VERSION=4.9<br>
        else<br>
            echo "Error: Please report issue to enable support for newer
    ndk."<br>
            exit 1<br>
        fi<br>
    <br>
        export
PATH="$ANDROIDNDK/toolchains/$TOOLCHAIN_PREFIX-$TOOLCHAIN_VERSION/prebuilt/$PYPLATFORM-x86/bin/:$ANDROIDNDK/toolchains/$TOOLCHAIN_PREFIX-$TOOLCHAIN_VERSION/prebuilt/$PYPLATFORM-x86_64/bin/:$ANDROIDNDK:$ANDROIDSDK/tools:$PATH"<br>
    <br>
        # search compiler in the path, to fail now instead of later.<br>
        CC=$(which $TOOLCHAIN_PREFIX-gcc)<br>
        if [ "X$CC" == "X" ]; then<br>
            error "Unable to find compiler ($TOOLCHAIN_PREFIX-gcc) !!"<br>
            error "1. Ensure that SDK/NDK paths are correct"<br>
            error "2. Ensure that you've the Android API $ANDROIDAPI SDK
    Platform (via android tool)"<br>
            exit 1<br>
        else<br>
            debug "Compiler found at $CC"<br>
        fi<br>
    <br>
        export CC="$TOOLCHAIN_PREFIX-gcc $CFLAGS"<br>
        export CXX="$TOOLCHAIN_PREFIX-g++ $CXXFLAGS"<br>
        export AR="$TOOLCHAIN_PREFIX-ar" <br>
        export RANLIB="$TOOLCHAIN_PREFIX-ranlib"<br>
        export LD="$TOOLCHAIN_PREFIX-ld"<br>
        export STRIP="$TOOLCHAIN_PREFIX-strip --strip-unneeded"<br>
        export MAKE="make -j5"<br>
        export READELF="$TOOLCHAIN_PREFIX-readelf"<br>
    <br>
        # This will need to be updated to support Python versions other
    than 2.7<br>
        export BUILDLIB_PATH="$BUILD_hostpython/build/lib.linux-`uname
    -m`-2.7/"<br>
    <br>
        # Use ccache ?<br>
        which ccache &>/dev/null<br>
        if [ $? -eq 0 ]; then<br>
            export CC="ccache $CC"<br>
            export CXX="ccache $CXX"<br>
        fi<br>
    }<br>
    <br>
    <div class="moz-signature"><small><b> <br>
        </b> </small></div>
    <div class="moz-cite-prefix">Le 10/08/2015 10:49, Phil Thompson a
      écrit :<br>
    </div>
    <blockquote
      cite="mid:e1bfb55c849d6035dfe45012ca1e1467@riverbankcomputing.com"
      type="cite">On 10/08/2015 8:37 am, Sébastien RAMAGE wrote:
      <br>
      <blockquote type="cite">So having pyjnius could be awesome and
        this fork of pyjnius seems to
        <br>
        python3.4 compatible ^^
        <br>
        <a class="moz-txt-link-freetext" href="https://github.com/physion/pyjnius">https://github.com/physion/pyjnius</a>
        <br>
        <br>
        I really want to help, but I don't know how I can try to compile
        it ? Any tips ?
        <br>
      </blockquote>
      <br>
      If you can identify what steps need to be taken, rather than the
      details of how to actually do it, for example...
      <br>
      <br>
      The Cython source file that needs converting to C.
      <br>
      The C files (generated or otherwise) that need compiling.
      <br>
      Any .py files that need including.
      <br>
      Any additional include directories that need to be searched.
      <br>
      Any additional libraries that need to be linked.
      <br>
      <br>
      I can then see how to add general support for Cython extensions to
      pyqtdeploy.
      <br>
      <br>
      Phil
      <br>
      _______________________________________________
      <br>
      PyQt mailing list    <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
    </blockquote>
    <br>
  </body>
</html>