From 981ede6a099dce805ecd59d4d0e57daee7f35da6 Mon Sep 17 00:00:00 2001 From: xloem <0xloem@gmail.com> Date: Sat, 19 Dec 2020 03:11:54 -0500 Subject: [PATCH] fix for audiostream/issues/25 --- .../recipes/audiostream/__init__.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/audiostream/__init__.py b/pythonforandroid/recipes/audiostream/__init__.py index 66fd42f081..69e5ab4c49 100644 --- a/pythonforandroid/recipes/audiostream/__init__.py +++ b/pythonforandroid/recipes/audiostream/__init__.py @@ -1,11 +1,16 @@ from pythonforandroid.recipe import CythonRecipe +from pythonforandroid.toolchain import shprint, current_directory, info +import sh from os.path import join class AudiostreamRecipe(CythonRecipe): - version = 'master' + # audiostream has no tagged versions; this is the latest commit to master 2020-12-22 + # it includes a fix for the dyload issue on android that was preventing use + version = '69f6b100f1ea4e3982a1acf6bbb0804e31a2cd50' url = 'https://github.com/kivy/audiostream/archive/{version}.zip' + sha256sum = '4d415c91706fd76865d0d22f1945f87900dc42125ff5a6c8d77898ccdf613c21' name = 'audiostream' depends = ['python3', 'sdl2', 'pyjnius'] @@ -24,5 +29,18 @@ def get_recipe_env(self, arch): env['LIBLINK'] = 'NOTNONE' # Hacky fix. Needed by audiostream setup.py return env + def postbuild_arch(self, arch): + # TODO: This code was copied from pyjnius, but judging by the + # audiostream history, it looks like this step might have + # happened automatically in the past. + # Given the goal of migrating off of recipes, it would + # be good to repair or build infrastructure for doing this + # automatically, for when including a java class is + # the best solution to a problem. + super().postbuild_arch(arch) + info('Copying audiostream java files to classes build dir') + with current_directory(self.get_build_dir(arch.arch)): + shprint(sh.cp, '-a', join('audiostream', 'platform', 'android'), self.ctx.javaclass_dir) + recipe = AudiostreamRecipe()