Skip to content

Commit 0b0388b

Browse files
author
Kim Rinnewitz
committed
Add openal, pyopenal recipes
1 parent 0ac1013 commit 0b0388b

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from pythonforandroid.recipe import NDKRecipe
2+
from pythonforandroid.toolchain import current_directory, shprint
3+
from os.path import join
4+
import os
5+
import sh
6+
7+
8+
class OpenALRecipe(NDKRecipe):
9+
version = '1.18.2'
10+
url = 'https://github.com/kcat/openal-soft/archive/openal-soft-{version}.tar.gz'
11+
12+
generated_libraries = ['libopenal.so']
13+
14+
def prebuild_arch(self, arch):
15+
# we need to build native tools for host system architecture
16+
with current_directory(join(self.get_build_dir(arch.arch), 'native-tools')):
17+
shprint(sh.cmake, '.', _env=os.environ)
18+
shprint(sh.make, _env=os.environ)
19+
20+
def build_arch(self, arch):
21+
with current_directory(self.get_build_dir(arch.arch)):
22+
env = self.get_recipe_env(arch)
23+
shprint(
24+
sh.cmake, '.',
25+
'-DCMAKE_TOOLCHAIN_FILE={}'.format('XCompile-Android.txt'),
26+
'-DHOST={}'.format(self.ctx.toolchain_prefix),
27+
_env=env
28+
)
29+
shprint(sh.make, _env=env)
30+
self.install_libs(arch, 'libopenal.so')
31+
32+
33+
recipe = OpenALRecipe()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pythonforandroid.recipe import PythonRecipe
2+
from os.path import join
3+
4+
5+
class PyOpenALRecipe(PythonRecipe):
6+
version = '0.7.3a1'
7+
url = 'https://files.pythonhosted.org/packages/9f/c5/738c76f0f5fad3c4662a1a08108232fcb510f29c367f06029a6c6a2792cf/PyOpenAL-{version}.tar.gz'
8+
depends = [('python2', 'python3crystax'), 'openal', 'numpy', 'setuptools']
9+
patches = [join('patches', 'fix-find-lib.patch')]
10+
11+
call_hostpython_via_targetpython = False
12+
13+
14+
recipe = PyOpenALRecipe()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/openal/library_loader.py b/openal/library_loader.py
2+
index be2485c..e8c6cd2 100644
3+
--- a/openal/library_loader.py
4+
+++ b/openal/library_loader.py
5+
@@ -56,7 +56,7 @@ class ExternalLibrary:
6+
except:
7+
pass
8+
else:
9+
- for path in [os.getcwd(), _here]:
10+
+ for path in [os.path.join(os.environ['ANDROID_PRIVATE'], '..', 'lib')]:
11+
for style in ExternalLibrary.other_styles:
12+
candidate = os.path.join(path, style.format(name))
13+
if os.path.exists(candidate) and os.path.isfile(candidate):

0 commit comments

Comments
 (0)