2019-03-30 21:58:45 +01:00
|
|
|
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'
|
2019-03-30 21:58:45 +01:00
|
|
|
|
|
|
|
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")
|
|
|
|
),
|
2019-03-30 21:58:45 +01:00
|
|
|
]
|
|
|
|
shprint(
|
|
|
|
sh.cmake, '.',
|
|
|
|
*cmake_args,
|
|
|
|
_env=env
|
|
|
|
)
|
|
|
|
shprint(sh.make, _env=env)
|
|
|
|
self.install_libs(arch, 'libopenal.so')
|
|
|
|
|
|
|
|
|
|
|
|
recipe = OpenALRecipe()
|