From c7ffb1de760cc48ccc55e619f65747fd36522868 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 7 Sep 2023 13:34:11 +0300 Subject: [PATCH 6/6] Meson: Generate man-pages See osdn #46208 Signed-off-by: Marko Lindqvist --- gen_headers/meson_fc_config.h.in | 3 +- meson.build | 79 +++++++++++++++++++++++++------- 2 files changed, 64 insertions(+), 18 deletions(-) diff --git a/gen_headers/meson_fc_config.h.in b/gen_headers/meson_fc_config.h.in index 0ecd015617..77c870bf3f 100644 --- a/gen_headers/meson_fc_config.h.in +++ b/gen_headers/meson_fc_config.h.in @@ -11,7 +11,8 @@ #define LOCALEDIR "@LOCALEDIR@" #define BUG_URL "https://osdn.net/projects/freeciv/ticket/" -#define WIKI_URL "https://www.freeciv.org/" + +#mesondefine WIKI_URL #define DATASUBDIR "@DATASUBDIR@" diff --git a/meson.build b/meson.build index 6c9109c099..3de90d400f 100644 --- a/meson.build +++ b/meson.build @@ -8,6 +8,8 @@ endif c_compiler = meson.get_compiler('c') +b_root = meson.project_build_root() + if get_option('ruledit') or \ get_option('clients').contains('qt') or \ get_option('fcmp').contains('qt') @@ -48,6 +50,8 @@ add_global_arguments('-fPIC', language : 'cpp') host_system = host_machine.system() +homepage_url = '"https://www.freeciv.org"' + priv_conf_data = configuration_data() pub_conf_data = configuration_data() liblua_conf_data = configuration_data() @@ -60,9 +64,12 @@ priv_conf_data.set('DATADIR', priv_conf_data.set('SYSCONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'))) +priv_conf_data.set('WIKI_URL', homepage_url) + # Release cycle phases # See fc_version about proper values for these. -priv_conf_data.set('DATASUBDIR', '3.1') +datasubdir = '3.1' +priv_conf_data.set('DATASUBDIR', datasubdir) priv_conf_data.set('IS_DEVEL_VERSION', 1) priv_conf_data.set('IS_FREEZE_VERSION', 1) priv_conf_data.set('IS_BETA_VERSION', 0) @@ -722,6 +729,38 @@ configure_file(input : 'gen_headers/meson_liblua_config.h.in', output : 'liblua_config.h', configuration: liblua_conf_data) +man_pages = [ + 'freeciv', + 'freeciv-client', + 'freeciv-manual', + 'freeciv-modpack', + 'freeciv-ruledit', + 'freeciv-ruleup', + 'freeciv-server' + ] + +man_links = [ + 'freeciv-gtk3.22', + 'freeciv-gtk4', + 'freeciv-sdl2', + 'freeciv-qt', + 'freeciv-mp-gtk3', + 'freeciv-mp-gtk4', + 'freeciv-mp-qt', + 'freeciv-mp-cli' + ] + +foreach manp : man_pages + man_conf_data = configuration_data() + man_conf_data.set('WIKI_URL', '"' + homepage_url + '"') + man_conf_data.set('BUG_URL', '"https://osdn.net/projects/freeciv/ticket/"') + man_conf_data.set('MAIL_ADDRESS', '"freeciv-dev at freelists.org"') + man_conf_data.set('DATASUBDIR', '"' + datasubdir + '"') + configure_file(input : 'doc/man/' + manp + '.6.in', + output : manp + '.6', + configuration : man_conf_data) +endforeach + add_global_arguments('-DHAVE_CONFIG_H', language: ['c', 'cpp']) @@ -2800,6 +2839,20 @@ foreach iconsize : i install_dir : join_paths(get_option('datadir'), 'icons/hicolor', iconsize, 'apps')) endforeach +foreach manp : man_pages + install_data( + join_paths(b_root, manp + '.6'), + install_dir : get_option('mandir') + ) +endforeach + +foreach manp : man_links + install_data( + join_paths('doc/man/', manp + '.6'), + install_dir : get_option('mandir') + ) +endforeach + gtk322_dep = dependency('gtk+-3.0', version : '>= 3.22', required : false) gtk4_dep = dependency('gtk4', version : '>= 4.0.0', required : false) @@ -2887,8 +2940,7 @@ custom_target('mi_gtk322', input: 'bootstrap/org.freeciv.gtk322.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -2975,8 +3027,7 @@ custom_target('mi_gtk4', input: 'bootstrap/org.freeciv.gtk4.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3230,8 +3281,7 @@ custom_target('mi_qt', input: 'bootstrap/org.freeciv.qt.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3363,8 +3413,7 @@ custom_target('mi_sdl2', input: 'bootstrap/org.freeciv.sdl2.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3417,8 +3466,7 @@ custom_target('mi_mp_gtk3', input: 'bootstrap/org.freeciv.mp.gtk3.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3453,8 +3501,7 @@ custom_target('mi_mp_gtk4', input: 'bootstrap/org.freeciv.mp.gtk4.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3496,8 +3543,7 @@ custom_target('mi_mp_qt', input: 'bootstrap/org.freeciv.mp.qt.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) @@ -3616,8 +3662,7 @@ custom_target('mi_ruledit', input: 'bootstrap/org.freeciv.ruledit.metainfo.xml.in', output: '@BASENAME@', command: [sh_exe, files('bootstrap/generate_metainfo.sh'), - '@OUTPUT@', - meson.project_build_root(), 'development'], + '@OUTPUT@', b_root, 'development'], install: true, install_dir: join_paths(get_option('datadir'), 'metainfo')) -- 2.40.1