From 8c5c8295d31eebd92c02d9e8d9fa42363f5e765c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 2 Oct 2023 00:37:28 +0300 Subject: [PATCH 32/32] Meson: Add "localeprefix" configure option See osdn #44814 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 6 ++++++ meson.build | 12 ++++++++++-- meson_options.txt | 5 +++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index 2bfac5f0ee..49d81f43a7 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -178,6 +178,12 @@ min-win-ver (string): Minimum Windows version the build should support. Versions listed on https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=msvc-170 +localeprefix (string): + If non-empty, will be used instead of default prefix when constructing locale path. + Default prefix is the regular prefix on most systems, + but current directory ('.') in Windows. + Unlike regular prefix, this can also be a relative path. + run.sh ------ diff --git a/meson.build b/meson.build index 8a0776c2d6..c1d4da4373 100644 --- a/meson.build +++ b/meson.build @@ -111,7 +111,7 @@ pub_conf_data.set('FREECIV_STORAGE_DIR', storage_dir) priv_conf_data.set('FREECIV_STORAGE_DIR', storage_dir) if host_system == 'windows' - priv_conf_data.set('LOCALEDIR', join_paths('.', get_option('localedir'))) + default_localeprefix = '.' priv_conf_data.set('DEFAULT_DATA_PATH', '".;data;@FREECIV_STORAGE_DIR@/@DATASUBDIR@;@DATADIR@/freeciv"') @@ -120,7 +120,7 @@ if host_system == 'windows' priv_conf_data.set('DEFAULT_SCENARIO_PATH', '".;data/scenarios;@FREECIV_STORAGE_DIR@/@DATASUBDIR@/scenarios;@FREECIV_STORAGE_DIR@/scenarios;@DATADIR@/freeciv/scenarios"') else - priv_conf_data.set('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) + default_localeprefix = get_option('prefix') priv_conf_data.set('DEFAULT_DATA_PATH', '".:data:@FREECIV_STORAGE_DIR@/@DATASUBDIR@:@DATADIR@/freeciv"') @@ -130,6 +130,14 @@ else '".:data/scenarios:@FREECIV_STORAGE_DIR@/@DATASUBDIR@/scenarios:@FREECIV_STORAGE_DIR@/scenarios:@DATADIR@/freeciv/scenarios"') endif +localeprefix = get_option('localeprefix') + +if localeprefix == '' + priv_conf_data.set('LOCALEDIR', join_paths(default_localeprefix, get_option('localedir'))) +else + priv_conf_data.set('LOCALEDIR', join_paths(localeprefix, get_option('localedir'))) +endif + server_type = get_option('server') if server_type == 'freeciv-web' diff --git a/meson_options.txt b/meson_options.txt index 1222fcac08..5169a92cbb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -86,3 +86,8 @@ option('min-win-ver', type: 'string', value: '', description: 'Minimum Windows version to support') + +option('localeprefix', + type: 'string', + value: '', + description: 'Localedir prefix to use instead of regular prefix') -- 2.40.1