<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>