11
22from pythonforandroid .recipe import CythonRecipe
3+ from pythonforandroid .toolchain import shprint , current_directory , info
4+ import sh
35from os .path import join
46
57
68class AudiostreamRecipe (CythonRecipe ):
7- version = 'master'
9+ # audiostream has no tagged versions; this is the latest commit to master 2020-12-22
10+ # it includes a fix for the dyload issue on android that was preventing use
11+ version = '69f6b100f1ea4e3982a1acf6bbb0804e31a2cd50'
812 url = 'https://github.com/kivy/audiostream/archive/{version}.zip'
13+ sha256sum = '4d415c91706fd76865d0d22f1945f87900dc42125ff5a6c8d77898ccdf613c21'
914 name = 'audiostream'
1015 depends = ['python3' , 'sdl2' , 'pyjnius' ]
1116
@@ -24,5 +29,18 @@ def get_recipe_env(self, arch):
2429 env ['LIBLINK' ] = 'NOTNONE' # Hacky fix. Needed by audiostream setup.py
2530 return env
2631
32+ def postbuild_arch (self , arch ):
33+ # TODO: This code was copied from pyjnius, but judging by the
34+ # audiostream history, it looks like this step might have
35+ # happened automatically in the past.
36+ # Given the goal of migrating off of recipes, it would
37+ # be good to repair or build infrastructure for doing this
38+ # automatically, for when including a java class is
39+ # the best solution to a problem.
40+ super ().postbuild_arch (arch )
41+ info ('Copying audiostream java files to classes build dir' )
42+ with current_directory (self .get_build_dir (arch .arch )):
43+ shprint (sh .cp , '-a' , join ('audiostream' , 'platform' , 'android' ), self .ctx .javaclass_dir )
44+
2745
2846recipe = AudiostreamRecipe ()
0 commit comments