diff --git a/modules/recipes/kivent_core/__init__.py b/modules/recipes/kivent_core/__init__.py new file mode 100644 index 00000000..f04152a6 --- /dev/null +++ b/modules/recipes/kivent_core/__init__.py @@ -0,0 +1,34 @@ +from pythonforandroid.recipe import CythonRecipe +from os.path import join + + +class KiventCoreRecipe(CythonRecipe): + version = 'master' + url = 'https://github.com/kivy/kivent/archive/{version}.zip' + name = 'kivent_core' + + depends = ['kivy'] + + subbuilddir = False + + def get_recipe_env(self, arch, with_flags_in_cc=True): + env = super(KiventCoreRecipe, self).get_recipe_env( + arch, with_flags_in_cc=with_flags_in_cc) + env['CYTHONPATH'] = self.get_recipe( + 'kivy', self.ctx).get_build_dir(arch.arch) + return env + + def get_build_dir(self, arch, sub=False): + builddir = super(KiventCoreRecipe, self).get_build_dir(arch) + if sub or self.subbuilddir: + return join(builddir, 'modules', 'core') + else: + return builddir + + def build_arch(self, arch): + self.subbuilddir = True + super(KiventCoreRecipe, self).build_arch(arch) + self.subbuilddir = False + + +recipe = KiventCoreRecipe() diff --git a/modules/recipes/kivent_core/recipe.sh b/modules/recipes/kivent_core/recipe.sh deleted file mode 100644 index 467cf722..00000000 --- a/modules/recipes/kivent_core/recipe.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -VERSION_kivent_core=2.1.0 -URL_kivent_core=https://github.com/kivy/KivEnt/archive/master.zip -MD5_kivent_core= -DEPS_kivent_core=(python kivy) -BUILD_kivent_core=$BUILD_PATH/kivent_core/master/modules/core -RECIPE_kivent_core=$RECIPES_PATH/kivent_core - -function prebuild_kivent_core() { - true -} - -function build_kivent_core() { - cd $BUILD_kivent_core - - push_arm - - export LDSHARED="$LIBLINK" - export PYTHONPATH=$BUILD_kivy/:$PYTHONPATH - try find . -iname '*.pyx' -exec $CYTHON {} \; - try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v - try find build/lib.* -name "*.o" -exec $STRIP {} \; - - export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages:$PYTHONPATH - try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages - - unset LDSHARED - pop_arm -} - -function postbuild_kivent_core() { - true -} diff --git a/modules/recipes/kivent_cymunk/__init__.py b/modules/recipes/kivent_cymunk/__init__.py new file mode 100644 index 00000000..20031f16 --- /dev/null +++ b/modules/recipes/kivent_cymunk/__init__.py @@ -0,0 +1,32 @@ +from pythonforandroid.recipe import CythonRecipe +from os.path import join + + +class KiventCymunkRecipe(CythonRecipe): + name = 'kivent_cymunk' + + depends = ['kivent_core', 'cymunk'] + + subbuilddir = False + + def get_recipe_env(self, arch, with_flags_in_cc=True): + env = super(KiventCymunkRecipe, self).get_recipe_env( + arch, with_flags_in_cc=with_flags_in_cc) + cymunk = self.get_recipe('cymunk', self.ctx).get_build_dir(arch.arch) + env['PYTHONPATH'] = join(cymunk, 'cymunk', 'python') + kivy = self.get_recipe('kivy', self.ctx).get_build_dir(arch.arch) + kivent = self.get_recipe('kivent_core', + self.ctx).get_build_dir(arch.arch, sub=True) + env['CYTHONPATH'] = ':'.join((kivy, cymunk, kivent)) + return env + + def prepare_build_dir(self, arch): + '''No need to prepare, we'll use kivent_core''' + return + + def get_build_dir(self, arch): + builddir = self.get_recipe('kivent_core', self.ctx).get_build_dir(arch) + return join(builddir, 'modules', 'cymunk') + + +recipe = KiventCymunkRecipe() diff --git a/modules/recipes/kivent_cymunk/recipe.sh b/modules/recipes/kivent_cymunk/recipe.sh deleted file mode 100644 index 78b88e46..00000000 --- a/modules/recipes/kivent_cymunk/recipe.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -VERSION_kivent_cymunk=1.0.0 -URL_kivent_cymunk=https://github.com/kivy/KivEnt/archive/master.zip -MD5_kivent_cymunk= -DEPS_kivent_cymunk=(python cymunk kivy kivent_core) -BUILD_kivent_cymunk=$BUILD_PATH/kivent_cymunk/master/modules/cymunk -RECIPE_kivent_cymunk=$RECIPES_PATH/kivent_cymunk - -function prebuild_kivent_cymunk() { - true -} - -function build_kivent_cymunk() { - cd $BUILD_kivent_cymunk - - push_arm - - export LDSHARED="$LIBLINK" - export PYTHONPATH=$BUILD_kivy/:$PYTHONPATH - export PYTHONPATH=$BUILD_cymunk/:$PYTHONPATH - export PYTHONPATH=$BUILD_kivent_core/:$PYTHONPATH - try find . -iname 'physics.pyx' -exec $CYTHON {} \; - try find . -iname 'interaction.pyx' -exec $CYTHON {} \; - try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v - try find build/lib.* -name "*.o" -exec $STRIP {} \; - - export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages:$PYTHONPATH - try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages - - unset LDSHARED - pop_arm -} - -function postbuild_kivent_cymunk() { - true -} diff --git a/modules/recipes/kivent_particles/__init__.py b/modules/recipes/kivent_particles/__init__.py new file mode 100644 index 00000000..0ec8efeb --- /dev/null +++ b/modules/recipes/kivent_particles/__init__.py @@ -0,0 +1,30 @@ +from pythonforandroid.recipe import CythonRecipe +from os.path import join + + +class KiventParticlesRecipe(CythonRecipe): + name = 'kivent_particles' + + depends = ['kivent_core'] + + subbuilddir = False + + def get_recipe_env(self, arch, with_flags_in_cc=True): + env = super(KiventParticlesRecipe, self).get_recipe_env( + arch, with_flags_in_cc=with_flags_in_cc) + kivy = self.get_recipe('kivy', self.ctx).get_build_dir(arch.arch) + kivent = self.get_recipe('kivent_core', + self.ctx).get_build_dir(arch.arch, sub=True) + env['CYTHONPATH'] = ':'.join((kivy, kivent)) + return env + + def prepare_build_dir(self, arch): + '''No need to prepare, we'll use kivent_core''' + return + + def get_build_dir(self, arch): + builddir = self.get_recipe('kivent_core', self.ctx).get_build_dir(arch) + return join(builddir, 'modules', 'particles') + + +recipe = KiventParticlesRecipe() diff --git a/modules/recipes/kivent_particles/recipe.sh b/modules/recipes/kivent_particles/recipe.sh deleted file mode 100644 index a5911a66..00000000 --- a/modules/recipes/kivent_particles/recipe.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -VERSION_kivent_particles=1.0.0 -URL_kivent_particles=https://github.com/kivy/KivEnt/archive/master.zip -MD5_kivent_particles= -DEPS_kivent_particles=(python kivy) -BUILD_kivent_particles=$BUILD_PATH/kivent_particles/master/modules/particles -RECIPE_kivent_particles=$RECIPES_PATH/kivent_particles - -function prebuild_kivent_particles() { - true -} - -function build_kivent_particles() { - cd $BUILD_kivent_particles - - push_arm - - export LDSHARED="$LIBLINK" - export PYTHONPATH=$BUILD_kivy/:$PYTHONPATH - export PYTHONPATH=$BUILD_kivent_core/:$PYTHONPATH - try find . -iname '*.pyx' -exec $CYTHON {} \; - try $BUILD_PATH/python-install/bin/python.host setup.py build_ext -v - try find build/lib.* -name "*.o" -exec $STRIP {} \; - - export PYTHONPATH=$BUILD_PATH/python-install/lib/python2.7/site-packages:$PYTHONPATH - try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages - - unset LDSHARED - pop_arm -} - -function postbuild_kivent_particles() { - true -}