update PyJNIus recipe
This commit is contained in:
parent
425a83faec
commit
d9a9a310a8
3 changed files with 15 additions and 25 deletions
|
@ -1,30 +1,20 @@
|
||||||
|
from pythonforandroid.recipe import CythonRecipe
|
||||||
from pythonforandroid.toolchain import CythonRecipe, Recipe, shprint, current_directory, info
|
from pythonforandroid.toolchain import shprint, current_directory, info
|
||||||
from pythonforandroid.patching import will_build, check_any
|
from pythonforandroid.patching import will_build
|
||||||
import sh
|
import sh
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
|
|
||||||
class PyjniusRecipe(CythonRecipe):
|
class PyjniusRecipe(CythonRecipe):
|
||||||
version = 'master'
|
version = '1.1.3'
|
||||||
url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
|
url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
|
||||||
name = 'pyjnius'
|
name = 'pyjnius'
|
||||||
depends = [('python2', 'python3crystax'), 'genericndkbuild', 'six']
|
depends = [('python2', 'python3crystax'), ('genericndkbuild', 'sdl2', 'sdl'), 'six']
|
||||||
site_packages_name = 'jnius'
|
site_packages_name = 'jnius'
|
||||||
call_hostpython_via_targetpython = False
|
|
||||||
|
|
||||||
patches = [('sdl2_jnienv_getter.patch', will_build('sdl2')),
|
patches = [('sdl2_jnienv_getter.patch', will_build('sdl2')),
|
||||||
('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild'))]
|
('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild'))]
|
||||||
|
|
||||||
def get_recipe_env(self, arch):
|
|
||||||
env = super(PyjniusRecipe, self).get_recipe_env(arch)
|
|
||||||
target_python = Recipe.get_recipe('python3crystax', self.ctx).get_build_dir(arch.arch)
|
|
||||||
env['PYTHON_ROOT'] = join(target_python, 'python-install')
|
|
||||||
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.6'
|
|
||||||
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython3.6m'
|
|
||||||
|
|
||||||
return env
|
|
||||||
|
|
||||||
def postbuild_arch(self, arch):
|
def postbuild_arch(self, arch):
|
||||||
super(PyjniusRecipe, self).postbuild_arch(arch)
|
super(PyjniusRecipe, self).postbuild_arch(arch)
|
||||||
info('Copying pyjnius java class to classes build dir')
|
info('Copying pyjnius java class to classes build dir')
|
||||||
|
|
|
@ -16,10 +16,10 @@ index 740510f..0c8e55f 100644
|
||||||
+++ b/setup.py
|
+++ b/setup.py
|
||||||
@@ -53,7 +53,7 @@ except ImportError:
|
@@ -53,7 +53,7 @@ except ImportError:
|
||||||
|
|
||||||
if platform == 'android':
|
if PLATFORM == 'android':
|
||||||
# for android, we use SDL...
|
# for android, we use SDL...
|
||||||
- libraries = ['sdl', 'log']
|
- LIBRARIES = ['sdl', 'log']
|
||||||
+ libraries = ['main', 'log']
|
+ LIBRARIES = ['main', 'log']
|
||||||
library_dirs = ['libs/' + getenv('ARCH')]
|
LIBRARY_DIRS = ['libs/' + getenv('ARCH')]
|
||||||
elif platform == 'darwin':
|
elif PLATFORM == 'darwin':
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
|
@ -16,10 +16,10 @@ index 740510f..0c8e55f 100644
|
||||||
+++ b/setup.py
|
+++ b/setup.py
|
||||||
@@ -53,7 +53,7 @@ except ImportError:
|
@@ -53,7 +53,7 @@ except ImportError:
|
||||||
|
|
||||||
if platform == 'android':
|
if PLATFORM == 'android':
|
||||||
# for android, we use SDL...
|
# for android, we use SDL...
|
||||||
- libraries = ['sdl', 'log']
|
- LIBRARIES = ['sdl', 'log']
|
||||||
+ libraries = ['SDL2', 'log']
|
+ LIBRARIES = ['SDL2', 'log']
|
||||||
library_dirs = ['libs/' + getenv('ARCH')]
|
LIBRARY_DIRS = ['libs/' + getenv('ARCH')]
|
||||||
elif platform == 'darwin':
|
elif PLATFORM == 'darwin':
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
Loading…
Reference in a new issue