From 49dd61f977250b942bdeae37cff707f29772974e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 24 May 2023 03:03:37 +0300 Subject: [PATCH 7/7] Meson: Compress scenario files installed See osdn #47826 Signed-off-by: Marko Lindqvist --- meson.build | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/meson.build b/meson.build index b4a8246de7..b99a821cf5 100644 --- a/meson.build +++ b/meson.build @@ -653,6 +653,7 @@ endif python_exe = find_program('python3') sh_exe = find_program('sh') +gzip_exe = find_program('gzip') common_inc = include_directories(cross_inc_path, lua_inc_path, 'dependencies/luasql/src', 'dependencies/tinycthread', @@ -1788,19 +1789,30 @@ install_data('data/buildings/airport.png', install_dir : join_paths(get_option('datadir'), 'freeciv/buildings')) -install_data('data/scenarios/british-isles.sav', - 'data/scenarios/earth-large.sav', - 'data/scenarios/earth-small.sav', - 'data/scenarios/europe.sav', - 'data/scenarios/europe_1900_WWI.sav', - 'data/scenarios/france.sav', - 'data/scenarios/hagworld.sav', - 'data/scenarios/iberian-peninsula.sav', - 'data/scenarios/italy.sav', - 'data/scenarios/japan.sav', - 'data/scenarios/north_america.sav', - 'data/scenarios/tutorial.sav', - install_dir : join_paths(get_option('datadir'), 'freeciv/scenarios')) +scenarios = [ + 'british-isles.sav', + 'earth-large.sav', + 'earth-small.sav', + 'europe.sav', + 'europe_1900_WWI.sav', + 'france.sav', + 'hagworld.sav', + 'iberian-peninsula.sav', + 'italy.sav', + 'japan.sav', + 'north_america.sav', + 'tutorial.sav' +] + +foreach scen : scenarios + scenzip = custom_target('gzip_' + scen, + command: [gzip_exe, '--best', '-n', '-c', '@INPUT@' ], + output: '@PLAINNAME@.gz', + capture: true, + input: join_paths('data/scenarios', scen), + install: true, + install_dir: join_paths(get_option('datadir'), 'freeciv/scenarios')) +endforeach install_data('data/wonders/apollo_program.png', 'data/wonders/asmiths_trading_co.png', -- 2.39.2