This fork of the Ren'Py Android Packaging Tool can be used to build the shared libraries for pgs4a.
Follow these instructions:
-
Get a virtual machine running Linux
- for example, Xubuntu 64 bit, running with VirtualBox
-
Clone this repository
-
Download android NDK r13b, and put it in the cloned repository
- this version still uses old headers so it will work with our toolchain, newer versions require edits
- it can build apps with minimum android-9 platform API
-
Download android SDK
- this may not be necessary at this time, but in case the toolchain needs it, api-9 could be installed in it, using
./sdkmanager "platforms;android-9" - sdk tools version 25.2.5 or older is even nicer; this will be used later when building apps, because android commands are still supported, and it has a nice GUI to install packages
- this may not be necessary at this time, but in case the toolchain needs it, api-9 could be installed in it, using
-
Use
pip install cython==0.20to install older cython version, to avoid errors with jnius -
Run
./build_pgs4a_new.sh. A pgs4a dist should be created in /dist -
When something fails, most likely some paths have to be edited, for example in build_pgs4a_new.sh, /python-for-android/distribute_new.sh so all path match with the downloaded NDK
-
The master branch outputs 32-bit libraries. Checkout the 64-bit branches (both here and p4a) to create 64-bit libs (then you'll get an arm64-v8a folder in dist/pgs4/libs, apps on Google Play soon needs to have both 32 and 64-bit libs).
Now it's time to use the pgs4a dist!
The following repositories where cloned and edited:
- Both clones used releases or commits from 12th june 2013
- The recipe for pyjnius was edited, so the correct package was downloaded (also from that old date).
- Edited the paths and files in both build_pgs4a and distribute shell scripts, and saved them as _new.sh
- Edited sdl_androidinput.c: return 0 (add zero) to avoid compile error
- Edit liblink: remove -arch option
- Added rm -rf of build folders at the beginning of build_pgs4a.sh, so everything starts fresh on retry after something has failed.