From f4ec1167626dc1a0252e720de72956d0702ba37e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 24 May 2023 03:03:37 +0300 Subject: [PATCH 11/12] 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 131e354b02..23424057f4 100644 --- a/meson.build +++ b/meson.build @@ -801,6 +801,7 @@ gen_packets_args = get_option('gen-packets-args') 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', @@ -1954,19 +1955,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