From 86ab4fbcae2c61cc42c286cd30d69c024c13fb2b Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 25 Aug 2026 06:55:50 +0300
Subject: [PATCH 58/58] Meson: Install man pages directly from configure_file()

Fixes meson-1.12 warnigs like:
freeciv.6' is a generated file, and should be passed by reference
instead of string name. This will become a hard error in Meson 2.0

See RM #2166

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 meson.build | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/meson.build b/meson.build
index 717879eedc..4a2f1b7d28 100644
--- a/meson.build
+++ b/meson.build
@@ -1167,7 +1167,15 @@ foreach manp : man_pages
   man_conf_data.set('DATASUBDIR', '"' + datasubdir + '"')
   configure_file(input : 'doc/man/' + manp + '.6.in',
                  output : manp + '.6',
-                 configuration : man_conf_data)
+                 configuration : man_conf_data,
+                 install_dir: join_paths(get_option('mandir'), 'man6'))
+endforeach
+
+foreach manp : man_links
+  install_data(
+    join_paths('doc/man/', manp + '.6'),
+    install_dir : join_paths(get_option('mandir'), 'man6')
+    )
 endforeach
 
 add_global_arguments('-DHAVE_CONFIG_H',
@@ -3438,20 +3446,6 @@ 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 : join_paths(get_option('mandir'), 'man6')
-    )
-endforeach
-
-foreach manp : man_links
-  install_data(
-    join_paths('doc/man/', manp + '.6'),
-    install_dir : join_paths(get_option('mandir'), 'man6')
-    )
-endforeach
-
 gtk322_dep = dependency('gtk+-3.0', version : '>= 3.22', required : false)
 gtk4_dep = dependency('gtk4', version : '>= 4.0.0', required : false)
 gtk5_dep = dependency('gtk4', version : '>= 4.14.0', required : false)
-- 
2.53.0

