From 2b49698592a9d397bae22bd9dd06c4a7fc3f19c6 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Thu, 12 May 2016 13:50:30 -0500 Subject: [PATCH 1/2] add kivent recipes --- pythonforandroid/recipes/cymunk/__init__.py | 15 ++++++++ .../recipes/kivent_core/__init__.py | 34 +++++++++++++++++++ .../recipes/kivent_cymunk/__init__.py | 32 +++++++++++++++++ .../recipes/kivent_particles/__init__.py | 30 ++++++++++++++++ .../recipes/kivent_polygen/__init__.py | 30 ++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 pythonforandroid/recipes/cymunk/__init__.py create mode 100644 pythonforandroid/recipes/kivent_core/__init__.py create mode 100644 pythonforandroid/recipes/kivent_cymunk/__init__.py create mode 100644 pythonforandroid/recipes/kivent_particles/__init__.py create mode 100644 pythonforandroid/recipes/kivent_polygen/__init__.py diff --git a/pythonforandroid/recipes/cymunk/__init__.py b/pythonforandroid/recipes/cymunk/__init__.py new file mode 100644 index 0000000000..c9b29d1327 --- /dev/null +++ b/pythonforandroid/recipes/cymunk/__init__.py @@ -0,0 +1,15 @@ +from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchARM +from os.path import exists, join +import sh +import glob + + +class CymunkRecipe(CythonRecipe): + version = 'master' + url = 'https://github.com/tito/cymunk/archive/{version}.zip' + name = 'cymunk' + + depends = [('python2', 'python3')] + + +recipe = CymunkRecipe() diff --git a/pythonforandroid/recipes/kivent_core/__init__.py b/pythonforandroid/recipes/kivent_core/__init__.py new file mode 100644 index 0000000000..b83907bcc2 --- /dev/null +++ b/pythonforandroid/recipes/kivent_core/__init__.py @@ -0,0 +1,34 @@ +from pythonforandroid.toolchain 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/pythonforandroid/recipes/kivent_cymunk/__init__.py b/pythonforandroid/recipes/kivent_cymunk/__init__.py new file mode 100644 index 0000000000..ae18d0a8bf --- /dev/null +++ b/pythonforandroid/recipes/kivent_cymunk/__init__.py @@ -0,0 +1,32 @@ +from pythonforandroid.toolchain 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/pythonforandroid/recipes/kivent_particles/__init__.py b/pythonforandroid/recipes/kivent_particles/__init__.py new file mode 100644 index 0000000000..f83fc5aaea --- /dev/null +++ b/pythonforandroid/recipes/kivent_particles/__init__.py @@ -0,0 +1,30 @@ +from pythonforandroid.toolchain 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/pythonforandroid/recipes/kivent_polygen/__init__.py b/pythonforandroid/recipes/kivent_polygen/__init__.py new file mode 100644 index 0000000000..aa80311fe8 --- /dev/null +++ b/pythonforandroid/recipes/kivent_polygen/__init__.py @@ -0,0 +1,30 @@ +from pythonforandroid.toolchain import CythonRecipe +from os.path import join + + +class KiventPolygenRecipe(CythonRecipe): + name = 'kivent_polygen' + + depends = ['kivent_core'] + + subbuilddir = False + + def get_recipe_env(self, arch, with_flags_in_cc=True): + env = super(KiventPolygenRecipe, 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', 'polygen') + + +recipe = KiventPolygenRecipe() From 26c1214154e57e61c75da3cdea656c60deafe309 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Thu, 12 May 2016 13:56:20 -0500 Subject: [PATCH 2/2] cleanup kivent recipes --- pythonforandroid/recipes/cymunk/__init__.py | 13 ++--- .../recipes/kivent_core/__init__.py | 46 +++++++++--------- .../recipes/kivent_cymunk/__init__.py | 48 +++++++++---------- .../recipes/kivent_particles/__init__.py | 34 ++++++------- .../recipes/kivent_polygen/__init__.py | 34 ++++++------- 5 files changed, 86 insertions(+), 89 deletions(-) diff --git a/pythonforandroid/recipes/cymunk/__init__.py b/pythonforandroid/recipes/cymunk/__init__.py index c9b29d1327..a3607b70bb 100644 --- a/pythonforandroid/recipes/cymunk/__init__.py +++ b/pythonforandroid/recipes/cymunk/__init__.py @@ -1,15 +1,12 @@ -from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchARM -from os.path import exists, join -import sh -import glob +from pythonforandroid.toolchain import CythonRecipe class CymunkRecipe(CythonRecipe): - version = 'master' - url = 'https://github.com/tito/cymunk/archive/{version}.zip' - name = 'cymunk' + version = 'master' + url = 'https://github.com/tito/cymunk/archive/{version}.zip' + name = 'cymunk' - depends = [('python2', 'python3')] + depends = [('python2', 'python3')] recipe = CymunkRecipe() diff --git a/pythonforandroid/recipes/kivent_core/__init__.py b/pythonforandroid/recipes/kivent_core/__init__.py index b83907bcc2..044aca0e1c 100644 --- a/pythonforandroid/recipes/kivent_core/__init__.py +++ b/pythonforandroid/recipes/kivent_core/__init__.py @@ -3,32 +3,32 @@ class KiventCoreRecipe(CythonRecipe): - version = 'master' - url = 'https://github.com/kivy/kivent/archive/{version}.zip' - name = 'kivent_core' + version = 'master' + url = 'https://github.com/kivy/kivent/archive/{version}.zip' + name = 'kivent_core' - depends = ['kivy'] - - subbuilddir = False + 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_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 + 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/pythonforandroid/recipes/kivent_cymunk/__init__.py b/pythonforandroid/recipes/kivent_cymunk/__init__.py index ae18d0a8bf..38132546d4 100644 --- a/pythonforandroid/recipes/kivent_cymunk/__init__.py +++ b/pythonforandroid/recipes/kivent_cymunk/__init__.py @@ -3,30 +3,30 @@ 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') + 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/pythonforandroid/recipes/kivent_particles/__init__.py b/pythonforandroid/recipes/kivent_particles/__init__.py index f83fc5aaea..ce82ea0c5b 100644 --- a/pythonforandroid/recipes/kivent_particles/__init__.py +++ b/pythonforandroid/recipes/kivent_particles/__init__.py @@ -3,28 +3,28 @@ class KiventParticlesRecipe(CythonRecipe): - name = 'kivent_particles' + name = 'kivent_particles' - depends = ['kivent_core'] + depends = ['kivent_core'] - subbuilddir = False + 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 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 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') + 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/pythonforandroid/recipes/kivent_polygen/__init__.py b/pythonforandroid/recipes/kivent_polygen/__init__.py index aa80311fe8..9cbd198143 100644 --- a/pythonforandroid/recipes/kivent_polygen/__init__.py +++ b/pythonforandroid/recipes/kivent_polygen/__init__.py @@ -3,28 +3,28 @@ class KiventPolygenRecipe(CythonRecipe): - name = 'kivent_polygen' + name = 'kivent_polygen' - depends = ['kivent_core'] + depends = ['kivent_core'] - subbuilddir = False + subbuilddir = False - def get_recipe_env(self, arch, with_flags_in_cc=True): - env = super(KiventPolygenRecipe, 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 get_recipe_env(self, arch, with_flags_in_cc=True): + env = super(KiventPolygenRecipe, 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 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', 'polygen') + def get_build_dir(self, arch): + builddir = self.get_recipe('kivent_core', self.ctx).get_build_dir(arch) + return join(builddir, 'modules', 'polygen') recipe = KiventPolygenRecipe()