1
1
2
2
from pythonforandroid .recipe import CythonRecipe
3
+ from pythonforandroid .toolchain import shprint , current_directory , info
4
+ import sh
3
5
from os .path import join
4
6
5
7
6
8
class 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'
8
12
url = 'https://github.com/kivy/audiostream/archive/{version}.zip'
13
+ sha256sum = '4d415c91706fd76865d0d22f1945f87900dc42125ff5a6c8d77898ccdf613c21'
9
14
name = 'audiostream'
10
15
depends = ['python3' , 'sdl2' , 'pyjnius' ]
11
16
@@ -24,5 +29,18 @@ def get_recipe_env(self, arch):
24
29
env ['LIBLINK' ] = 'NOTNONE' # Hacky fix. Needed by audiostream setup.py
25
30
return env
26
31
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
+
27
45
28
46
recipe = AudiostreamRecipe ()
0 commit comments