lbry-android-sdk/p4a/pythonforandroid/recipes/openal/__init__.py

32 lines
961 B
Python
Raw Normal View History

from pythonforandroid.recipe import NDKRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class OpenALRecipe(NDKRecipe):
2022-12-02 21:15:34 +01:00
version = '1.21.1'
url = 'https://github.com/kcat/openal-soft/archive/refs/tags/{version}.tar.gz'
generated_libraries = ['libopenal.so']
def build_arch(self, arch):
with current_directory(self.get_build_dir(arch.arch)):
env = self.get_recipe_env(arch)
cmake_args = [
2022-12-02 21:15:34 +01:00
"-DANDROID_STL=" + self.stl_lib_name,
"-DCMAKE_TOOLCHAIN_FILE={}".format(
join(self.ctx.ndk_dir, "build", "cmake", "android.toolchain.cmake")
),
]
shprint(
sh.cmake, '.',
*cmake_args,
_env=env
)
shprint(sh.make, _env=env)
self.install_libs(arch, 'libopenal.so')
recipe = OpenALRecipe()