I'd like to add our Little Mauve Riding Hood game to F-Droid, which is an alternate store for Android dedicated to free & open source software - including games
To ensure the game really is free software, F-Droid rebuilds all the submitted apps: you don't send an .apk - instead you submit a recipe which may point to a git repository, and the final .apk is built on their server.
The following documentation tracks my progress towards this goal.
Currently there are issues with:
- compilation in the limited fdroid buildserver environment, in particular rebuilding a full native renpy to start the APK builder
- stubbing several renpy optional utilities interfacing with pre-built or proprietary libraries
- missing Android SDK extras from Google
Code: Select all
# Clone the projects using this layout:
WD=/mnt/workdir/renpy
cd $WD
git clone https://github.com/renpy/renpy -b 6.99.0.303 renpy-git/
git clone https://github.com/renpy/rapt -b renpy-6.99.0.303 rapt-git/
git clone https://github.com/renpy/pygame_sdl2 -b renpy-6.99.0.303 renpy-git/pygame_sdl2/
git clone https://github.com/renpy/python-for-android -b renpy-6.99.0.303 rapt-git/python-for-android/
cd rapt-git/
ln -nfs $WD/android-ndk-r10c # http://dl.google.com/android/ndk/android-ndk-r10c-linux-x86_64.bin
ln -nfs $WD/android-sdk-linux android-sdk-r23
# Build RAPT
# Work-arounds
ln -nfs android-sdk-r23 android-sdk
# compile all .pyo, 'build_renpy.sh' forgets e.g. glblacklist.pyo and swdraw.pyo
(cd $WD/renpy-git && python -O -m compileall .)
# Make it possible to compile without rebuilding a full native Ren'Py,
# which requires installing lots of -dev .deb (as root...):
# - sed -i -e 's|try ./run.sh the_question compile|#&|' build_renpy.sh
# - comment out references to angle in ../renpy-git/module/setup.py
# Optional: disable pre-built or proprietary APIs
# - sed -i -e '/ouya-sdk.*.jar/s/^/#/' build_renpy.sh
# - sed -i -e '/amazon-iap.*.jar/s/^/#/' build_renpy.sh
# - stub python-for-android/src/src/org/renpy/iap/*Store.java
#pip install -U cython==0.21.1
#sudo apt-get install cython # 0.21.1 already pre-installed in the fdroid buildserver
LANG=C ./build_renpy.sh renpy $WD/renpy-git/ $WD/renpy-git/pygame_sdl2/
# Prepare RAPT distribution in dist/renpy/
cat <<EOF > local.properties
key.alias=android
key.store.password=android
key.alias.password=android
key.store=android.keystore
EOF
sed -i -e "s|^try ./build_renpy.sh|#&|" test_renpy.sh # already done with non-'pytom' paths ;)
ln -nfs $WD/apache-ant-1.9.3
./test_renpy.sh
# ^^^ FYI installsdk installs APL-licensed extensions not present in the fdroid buildserver:
# (cd android-sdk-r23 && ./tools/android update sdk -u -f -a -t build-tools-20.0.0,android-19,platform-tools,extra-google-play_apk_expansion,extra-google-play_licensing)
rm -rf $WD/renpy-git/rapt/
cp -a dist/renpy $WD/renpy-git/rapt/
# Build the full Ren'Py to be able to run the APK builder..
# Cf. https://github.com/renpy/renpy/blob/master/README.rst:
sudo apt-get install python-dev libavcodec-dev libavformat-dev \
libavresample-dev libswscale-dev libfreetype6-dev libglew1.6-dev \
libfribidi-dev libsdl2-dev libsdl2-image-dev libsdl2-gfx-dev \
libsdl2-mixer-dev libsdl2-ttf-dev libjpeg-turbo8-dev
export RENPY_DEPS_INSTALL="/usr::/usr/lib/x86_64-linux-gnu/"
sudo apt-get install virtualenvwrapper
mkvirtualenv renpy_android
(
cd $WD/renpy-git/pygame_sdl2/
# Fixes ~/.virtualenvs/renpy_android/include/python2.7 being a symlink to (non-writable) /usr/include/python2.7
python fix_virtualenv.py $VIRTUAL_ENV
)
pip install -U cython==0.21.1
(cd ../renpy-git && ./run.sh the_question compile)
# Build the game APK
cd $WD/renpy-git/rapt/
# - edit ../launcher/game/distribute.rpy, remove calls to self.add_python(), self.add_mac_files(), self.add_windows_files()
# - cp your 'android.keystore' here
echo '{"layout": null, "name": "The Question", "package": "org.renpy.thequestion", "orientation": "sensor", "include_pil": false, "expansion": false, "source": false, "icon_name": "The Question", "version": "1.0", "target_version": 14, "permissions": ["VIBRATE"], "include_sqlite": false, "store": "none", "numeric_version": "100"}' > ../the_question/.android.json
python ../renpy.py ../launcher android_build ../the_question release
#python ../renpy.py ../launcher android_build --launch ../the_question release install
# Debug
./android-sdk-r23/platform-tools/adb pull /storage/sdcard0/Android/data/org.renpy.thequestion/files/log.txt
./android-sdk-r23/platform-tools/adb logcat
EDIT: here was my (obsolete) original post, the remaining issues are different:
Hi,
I'd like to add our Little Mauve Riding Hood game to F-Droid, which is an alternate store for Android dedicated to free & open source software - including games
To ensure the game really is free software, F-Droid rebuilds all the submitted apps: you don't send an .apk - instead you submit a recipe which may point to a git repository, and the final .apk is built on their server.
I'm trying to use ./build_renpy.sh from rapt-git, but there seem to be several implicit requirements.
Also there's no release tag for rapt-git and python_sdl2, so I don't know which revision I should checkout exactly.
Running I'm trying:
Code: Select all
$ apt-get install libsdl2-dev
$ PYTHONPATH=$(python -c 'import sys; print ":".join(sys.path)') bash -x ./build_renpy.sh android /mnt/workdir/renpy/renpy-6.99.0-git/ /mnt/workdir/renpy/pygame_sdl2/
...
'Could not find required library SDL2.'
Is there documentation on how to do a full APK rebuild from sources?
I would be happy to contribute.
