From 4110ee092873bd4452fcefbb285e3803fd840e48 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 31 Aug 2022 05:44:20 +0300 Subject: [PATCH] wscript: require Opus Custom for build Apparently, not all Linux distributions enable it. Anyway, we can build codec ourselves --- 3rdparty/opus/wscript | 2 +- wscript | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/3rdparty/opus/wscript b/3rdparty/opus/wscript index 9f3d2098..1f6c9af4 100644 --- a/3rdparty/opus/wscript +++ b/3rdparty/opus/wscript @@ -27,7 +27,7 @@ def build(bld): 'opus/celt/opus_custom_demo.c' ]) includes = ['opus/include/', 'opus/celt/', 'opus/silk/', 'opus/silk/float/'] - defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"'] + defines = ['USE_ALLOCA', 'OPUS_BUILD', 'FLOAT_APPROX', 'PACKAGE_VERSION="1.3.1"', 'CUSTOM_MODES'] bld.stlib( source = sources, diff --git a/wscript b/wscript index fb335fb6..26f34e6c 100644 --- a/wscript +++ b/wscript @@ -328,8 +328,8 @@ int main(int argc, char **argv) { strcasestr(argv[1], argv[2]); return 0; }''' if not conf.options.BUILD_BUNDLED_DEPS: # check if we can use system opus - if conf.check_pkg('opus', 'opus', '''#include -int main(void){ return (opus_encoder_create(48000, 2, OPUS_APPLICATION_VOIP, 0) != 0) && (opus_decoder_create(48000, 2, 0) != 0);}''', fatal = False): + if conf.check_pkg('opus', 'opus', '''#include +int main(void){ return opus_custom_mode_create(44100, 1024, 0) != 0; }''', fatal = False): conf.env.HAVE_SYSTEM_OPUS = True conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')