Skip to content

Commit 909ec16

Browse files
committed
More recipe doc (including NDKRecipe)
1 parent dd5417d commit 909ec16

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/source/recipes.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,34 @@ CythonRecipe inherits from it (to avoid code duplication).
307307
Using an NDKRecipe
308308
------------------
309309

310+
If you are writing a recipe not for a Python module but for something
311+
that would normall go in the JNI dir of an Android project (i.e. it
312+
has an ``Application.mk`` and ``Android.mk`` that the Android build
313+
system can use), you can use an NDKRecipe to automatically set it
314+
up. The NDKRecipe overrides the normal ``get_build_dir`` method to
315+
place things in the Android project.
316+
317+
.. warning:: The NDKRecipe does *not* currently actually call
318+
ndk-build, you must add this call (for your module) by
319+
manually making a build_arch method. This may be fixed
320+
later.
321+
322+
For instance, the following recipe is all that's necessary to place
323+
SDL2_ttf in the jni dir. This is built later by the SDL2 recipe, which
324+
calls ndk-build with this as a dependency::
325+
326+
class LibSDL2TTF(NDKRecipe):
327+
version = '2.0.12'
328+
url = 'https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-{version}.tar.gz'
329+
dir_name = 'SDL2_ttf'
330+
331+
recipe = LibSDL2TTF()
332+
333+
The dir_name argument is a new class attribute that tells the recipe
334+
what the jni dir folder name should be. If it is omitted, the recipe
335+
name is used. Be careful here, sometimes the folder name is important,
336+
especially if this folder is a dependency of something else.
337+
310338
.. _recipe_class:
311339

312340
The ``Recipe`` class

0 commit comments

Comments
 (0)