From 3d90df29e8834dcb3d6fd886221745a453e66489 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 2 Oct 2023 00:34:16 +0300 Subject: [PATCH 59/59] 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 f47502bd06..f78c17d963 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -182,6 +182,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. + Project definition file ----------------------- diff --git a/meson.build b/meson.build index 6cc886ba16..70685ab287 100644 --- a/meson.build +++ b/meson.build @@ -180,7 +180,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"') @@ -189,7 +189,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"') @@ -199,6 +199,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 3ec70cfee9..1c9acb4a38 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -98,3 +98,8 @@ option('svgflags', type: 'boolean', value: false, description: 'svg flags features enabled on build level') + +option('localeprefix', + type: 'string', + value: '', + description: 'Localedir prefix to use instead of regular prefix') -- 2.40.1