stardt
stardt

Reputation: 1219

custom recipes for python for android

I have written a python module with linked C code and would like to include it in a kivy project. I wrote a recipe.sh and added it to .buildozer/android/platform/python-for-android/recipes/mypackage Everytime I run buildozer android debug my new folder is removed from the recipes folder. Then buildozer assumes my module is a pure python module and fails to find and add it to a virtualenv.

I worked around this by commenting out a call to git clean in the buildozer code, but I would like a more elegant solution. What is the correct way to add new recipes to python for android?

Upvotes: 2

Views: 4568

Answers (2)

Error
Error

Reputation: 1

The problem in the buildozer.spec, it says it clearly if you don't define the path it clones it for you

buildozer.spec

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

Upvotes: 0

pradyunsg
pradyunsg

Reputation: 19456

From python-for-android docs:

Create your own recipes

A recipe is a script that contain the “definition” of a module to compile. The directory layout of a recipe for a is something like:

python-for-android/recipes/<modulename>/recipe.sh
python-for-android/recipes/<modulename>/patches/
python-for-android/recipes/<modulename>/patches/fix-path.patch

When building, all the recipe build must go to:

python-for-android/build/<modulename>/<archiveroot>

For example, if you want to create a recipe for sdl, do:

cd python-for-android/recipes
mkdir sdl
cp recipe.sh.tmpl sdl/recipe.sh
sed -i 's#XXX#sdl#' sdl/recipe.sh

Then, edit the sdl/recipe.sh to adjust other information (version, url) and complete build function.

Upvotes: 3

Related Questions