From 48da7784e35ecd739e409d0b71842da71eb7e780 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 1 Dec 2020 13:03:39 +0200 Subject: [PATCH] build script: add openal target --- .gitignore | 1 + build.py | 20 +++++++++++++++++++- deps/openal/include/{ => AL}/al.h | 0 deps/openal/include/{ => AL}/alc.h | 0 deps/openal/include/{ => AL}/alext.h | 0 deps/openal/include/{ => AL}/efx-creative.h | 0 deps/openal/include/{ => AL}/efx-presets.h | 0 deps/openal/include/{ => AL}/efx.h | 0 8 files changed, 20 insertions(+), 1 deletion(-) rename deps/openal/include/{ => AL}/al.h (100%) rename deps/openal/include/{ => AL}/alc.h (100%) rename deps/openal/include/{ => AL}/alext.h (100%) rename deps/openal/include/{ => AL}/efx-creative.h (100%) rename deps/openal/include/{ => AL}/efx-presets.h (100%) rename deps/openal/include/{ => AL}/efx.h (100%) diff --git a/.gitignore b/.gitignore index a4536627..a09eed00 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ /deps/jpeg-turbo/include/turbojpeg.h /deps/jpeg-turbo/lib/libturbojpeg.a /deps/nasm/bin/ndisasm +/deps/openal/lib/cmake/ /deps/opusfile/lib/libopusurl.a diff --git a/build.py b/build.py index 9389e807..0c739448 100755 --- a/build.py +++ b/build.py @@ -307,7 +307,7 @@ class ZDoomBaseTarget(CMakeTarget): opts['PK3_QUIET_ZIPDIR'] = 'YES' opts['DYN_OPENAL'] = 'NO' # Explicit OpenAL configuration to avoid selection of Apple's framework - opts['OPENAL_INCLUDE_DIR'] = builder.include_path + opts['OPENAL_INCLUDE_DIR'] = builder.include_path + 'AL' opts['OPENAL_LIBRARY'] = builder.lib_path + 'libopenal.a' @@ -699,6 +699,23 @@ class OggTarget(ConfigureMakeStaticDependencyTarget): return os.path.exists(builder.source_path + 'ogg.pc.in') +class OpenALTarget(CMakeStaticDependencyTarget): + def __init__(self, name='openal'): + super().__init__(name) + + opts = self.options + opts['ALSOFT_EXAMPLES'] = 'NO' + opts['ALSOFT_UTILS'] = 'NO' + + def prepare_source(self, builder: 'Builder'): + builder.download_source( + 'https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2', + '2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297') + + def detect(self, builder: 'Builder') -> bool: + return os.path.exists(builder.source_path + 'openal.pc.in') + + class OpusTarget(ConfigureMakeStaticDependencyTarget): def __init__(self, name='opus'): super().__init__(name) @@ -945,6 +962,7 @@ class Builder(object): Mpg123Target(), NasmTarget(), OggTarget(), + OpenALTarget(), OpusTarget(), OpusFileTarget(), VorbisTarget(), diff --git a/deps/openal/include/al.h b/deps/openal/include/AL/al.h similarity index 100% rename from deps/openal/include/al.h rename to deps/openal/include/AL/al.h diff --git a/deps/openal/include/alc.h b/deps/openal/include/AL/alc.h similarity index 100% rename from deps/openal/include/alc.h rename to deps/openal/include/AL/alc.h diff --git a/deps/openal/include/alext.h b/deps/openal/include/AL/alext.h similarity index 100% rename from deps/openal/include/alext.h rename to deps/openal/include/AL/alext.h diff --git a/deps/openal/include/efx-creative.h b/deps/openal/include/AL/efx-creative.h similarity index 100% rename from deps/openal/include/efx-creative.h rename to deps/openal/include/AL/efx-creative.h diff --git a/deps/openal/include/efx-presets.h b/deps/openal/include/AL/efx-presets.h similarity index 100% rename from deps/openal/include/efx-presets.h rename to deps/openal/include/AL/efx-presets.h diff --git a/deps/openal/include/efx.h b/deps/openal/include/AL/efx.h similarity index 100% rename from deps/openal/include/efx.h rename to deps/openal/include/AL/efx.h