Skip to content

Commit 5615989

Browse files
committed
Add Bleak recipe
1 parent 2ca492a commit 5615989

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import sh
2+
from os.path import join
3+
from pythonforandroid.recipe import PythonRecipe
4+
from pythonforandroid.toolchain import shprint, info
5+
6+
# Lightly inspired by Bleak's upstream p4a recipe residing at:
7+
# https://github.com/hbldh/bleak/blob/develop/bleak/backends/p4android/recipes/bleak/__init__.py
8+
class BleakRecipe(PythonRecipe):
9+
version = '0.14.2'
10+
url = 'https://pypi.python.org/packages/source/b/bleak/bleak-{version}.tar.gz'
11+
name = 'bleak'
12+
blake2bsum = '9a6adb9ec627248255586d53260648cfdb2e6054b0faa4a35b92138f8a87a8b7bcff14f4e84a45b931ad13880d37a6de7ac2174235d6df38b0758442ca2da105'
13+
sha512sum = '5594e5ac524fb8969c16202b7984c546daf65c7d2492df7bf2cefbcf1839dfdc0cb8ca0c0304722b9a85bb9110b08625c0f15626a0139634fb0162e7e1fd0dbb'
14+
15+
depends = ['pyjnius', 'setuptools']
16+
call_hostpython_via_targetpython = False
17+
18+
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
19+
env = super().get_recipe_env(arch, with_flags_in_cc)
20+
env['PYJNIUS_PACKAGES'] = self.ctx.get_site_packages_dir(arch)
21+
return env
22+
23+
def postbuild_arch(self, arch):
24+
super().postbuild_arch(arch)
25+
26+
info('Copying Java class files...')
27+
src_javaclass_dir = join(
28+
self.get_build_dir(arch.arch),
29+
'bleak', 'backends', 'p4android', 'java',
30+
)
31+
shprint(sh.cp, '-a', src_javaclass_dir, self.ctx.javaclass_dir)
32+
33+
34+
recipe = BleakRecipe()

0 commit comments

Comments
 (0)