From 17c4cdf4d463d301b38265373d6bcf8f3f054235 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 29 Sep 2023 21:27:42 +0300 Subject: [PATCH] Server: Backport 0047-Meson-Turn-audio-option-to-a-combo.patch Signed-off-by: Marko Lindqvist --- freeciv/apply_patches.sh | 4 + ...7-Meson-Turn-audio-option-to-a-combo.patch | 81 +++++++++++++++++++ freeciv/prepare_freeciv.sh | 2 +- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 freeciv/patches/backports/0047-Meson-Turn-audio-option-to-a-combo.patch diff --git a/freeciv/apply_patches.sh b/freeciv/apply_patches.sh index c83ad2e10..57a6148de 100755 --- a/freeciv/apply_patches.sh +++ b/freeciv/apply_patches.sh @@ -23,6 +23,9 @@ # 0036-tile_move_cost_ptrs-Make-cardinal_move-signed.patch # Unit movemenet handling fix # osdn #48737 +# 0047-Meson-Turn-audio-option-to-a-combo.patch +# Rework disabling audio +# osdn #48757 # Not in the upstream Freeciv server # ---------------------------------- @@ -51,6 +54,7 @@ declare -a PATCHLIST=( "backports/0031-Lua-Always-pass-lua_Integer-to-API_TYPE_INT" "backports/0042-Meson-Make-manual-generator-build-optional" "backports/0036-tile_move_cost_ptrs-Make-cardinal_move-signed" + "backports/0047-Meson-Turn-audio-option-to-a-combo" "meson_webperimental" "metachange" "text_fixes" diff --git a/freeciv/patches/backports/0047-Meson-Turn-audio-option-to-a-combo.patch b/freeciv/patches/backports/0047-Meson-Turn-audio-option-to-a-combo.patch new file mode 100644 index 000000000..003b2bb71 --- /dev/null +++ b/freeciv/patches/backports/0047-Meson-Turn-audio-option-to-a-combo.patch @@ -0,0 +1,81 @@ +From 258d802b11fe6998f1b09581c1923c87499ccd02 Mon Sep 17 00:00:00 2001 +From: Marko Lindqvist +Date: Fri, 29 Sep 2023 20:50:33 +0300 +Subject: [PATCH 47/47] Meson: Turn 'audio' option to a combo + +See osdn #48757 + +Signed-off-by: Marko Lindqvist +--- + doc/INSTALL.meson | 4 ++-- + meson.build | 6 +++--- + meson_options.txt | 7 ++++--- + 3 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson +index 88f8c7af4c..98636a6e01 100644 +--- a/doc/INSTALL.meson ++++ b/doc/INSTALL.meson +@@ -147,8 +147,8 @@ readline ('try'/'true'/'false') + Whether to enable readline functionality on server. + The default is 'try' to enable it if suitable readline found. + +-audio (boolean): +- Build sound support to the clients. Defaults to true. ++audio ('none'/'sdl2'): ++ What kind of sound support should be built to the clients. Defaults to sdl2. + + tools (array): + Extra tools to build: +diff --git a/meson.build b/meson.build +index ce7ba03070..45663542c9 100644 +--- a/meson.build ++++ b/meson.build +@@ -770,7 +770,7 @@ if c_compiler.compiles('''int main(void) { __builtin_unreachable(); return 0; }' + pub_conf_data.set('FREECIV_HAVE_UNREACHABLE', 1) + endif + +-if get_option('audio') or get_option('clients').contains('sdl2') ++if get_option('audio') == 'sdl2' or get_option('clients').contains('sdl2') + if host_system == 'windows' + sdl2main_dep = [c_compiler.find_library('mingw32', dirs: cross_lib_path), + c_compiler.find_library('SDL2main', dirs: cross_lib_path), +@@ -781,7 +781,7 @@ if get_option('audio') or get_option('clients').contains('sdl2') + '-s', 'USE_SDL=2' + ] + +- if get_option('audio') ++ if get_option('audio') == 'sdl2' + emscripten_sdl2_args += [ '-s', 'USE_SDL_MIXER=2' ] + endif + +@@ -840,7 +840,7 @@ else + qt_opts = 'cpp_std=c++17' + endif + +-if get_option('audio') ++if get_option('audio') != 'none' + priv_conf_data.set('AUDIO_SDL', 1) + + if emscripten +diff --git a/meson_options.txt b/meson_options.txt +index f5bb14e456..ac65a3f727 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -46,9 +46,10 @@ option('readline', + description: 'Enable readline functionality') + + option('audio', +- type: 'boolean', +- value: true, +- description: 'Build in sound support') ++ type: 'combo', ++ choices: ['none', 'sdl2'], ++ value: 'sdl2', ++ description: 'Sound support type to build') + + option('tools', + type: 'array', +-- +2.40.1 + diff --git a/freeciv/prepare_freeciv.sh b/freeciv/prepare_freeciv.sh index cf33e7bb5..d69b441f8 100755 --- a/freeciv/prepare_freeciv.sh +++ b/freeciv/prepare_freeciv.sh @@ -35,7 +35,7 @@ mkdir -p build ( cd build meson setup ../freeciv -Dserver='freeciv-web' \ -Dclients=[] -Dfcmp=cli -Djson-protocol=true -Dnls=false \ - -Daudio=false -Dtools=manual \ + -Daudio=none -Dtools=manual \ -Dproject-definition=../freeciv-web.fcproj \ -Ddefault_library=static -Dprefix=${HOME}/freeciv \ -Doptimization=3 $EXTRA_MESON_PARAMS