meson: also allow setting GIT_VERSION via templates

GIT_VERSION is not available as a config.h variable, because it's rendered
into version.h during builds. Let's rework jinja2 rendering to also
parse version.h. No functional change, the new variable is so far unused.

I guess this will make partial rebuilds a bit slower, but it's useful
to be able to use the full version string.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2022-04-05 22:18:31 +02:00
parent 3761002eea
commit 8f04a1ca2b
22 changed files with 28 additions and 25 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ load_fragment_gperf_gperf = custom_target(
'load-fragment-gperf.gperf',
input : 'load-fragment-gperf.gperf.in',
output: 'load-fragment-gperf.gperf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'])
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'])
load_fragment_gperf_c = custom_target(
'load-fragment-gperf.c',
@@ -217,7 +217,7 @@ foreach item : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : (dir == pkgsysconfdir) ? install_sysconfdir_samples : (dir != 'no'),
install_dir : dir)
endforeach
+1 -1
View File
@@ -54,7 +54,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[1],
install_dir : pkgsysconfdir)
endforeach
+1 -1
View File
@@ -186,7 +186,7 @@ custom_target(
'libsystemd.pc',
input : 'libsystemd.pc.in',
output : 'libsystemd.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfiglibdir != 'no',
install_dir : pkgconfiglibdir)
+1 -1
View File
@@ -38,7 +38,7 @@ custom_target(
'libudev.pc',
input : 'libudev.pc.in',
output : 'libudev.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfiglibdir != 'no',
install_dir : pkgconfiglibdir)
+1 -1
View File
@@ -80,7 +80,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[2] and install,
install_dir : dir)
endforeach
+1 -1
View File
@@ -168,7 +168,7 @@ custom_target(
'resolved.conf',
input : 'resolved.conf.in',
output : 'resolved.conf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_RESOLVE') == 1 and install_sysconfdir_samples,
install_dir : pkgsysconfdir)
+1 -1
View File
@@ -18,7 +18,7 @@ foreach tuple : in_files
file,
input : file + '.in',
output : file,
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : tuple[1],
install_dir : tuple.length() > 2 ? tuple[2] : '',
build_by_default : true)
+1 -1
View File
@@ -39,7 +39,7 @@ custom_target(
'timesyncd.conf',
input : 'timesyncd.conf.in',
output : 'timesyncd.conf',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_TIMESYNCD') == 1 and install_sysconfdir_samples,
install_dir : pkgsysconfdir)
+1 -1
View File
@@ -166,7 +166,7 @@ custom_target(
'udev.pc',
input : 'udev.pc.in',
output : 'udev.pc',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : pkgconfigdatadir != 'no',
install_dir : pkgconfigdatadir)
+1 -1
View File
@@ -4,6 +4,6 @@ custom_target(
'90-vconsole.rules',
input : '90-vconsole.rules.in',
output : '90-vconsole.rules',
command : [meson_render_jinja2, config_h, '@INPUT@', '@OUTPUT@'],
command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
install : conf.get('ENABLE_VCONSOLE') == 1,
install_dir : udevrulesdir)