From 67f7b76e92c19061b272cec58a7fbba0942d037b Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 6 Jun 2022 17:14:44 +0200 Subject: [PATCH] data: fix gimp-release file on Windows. The '\n' newline is transformed into a space (0x20) when building natively on Windows. And unfortunately g_key_file_load_from_file() does not like this. The autotools rule works properly on all platforms according to my tests. Note that at first, I thought it was a LF vs. CRLF issue, and tried to special-case Windows, but I realized it's just that 'echo' command seemingly transform newlines unexpectedly in its Windows form. I didn't want to waste too much time experimenting alternative calls, especially as I have to test through CI (so each test is very costly, time-wise). Instead I go the alternative way of using a pre-generated conf file. --- data/gimp-release.in | 2 ++ data/meson.build | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 data/gimp-release.in diff --git a/data/gimp-release.in b/data/gimp-release.in new file mode 100644 index 0000000000..904317aef3 --- /dev/null +++ b/data/gimp-release.in @@ -0,0 +1,2 @@ +[package] +revision=@REVISION@ diff --git a/data/meson.build b/data/meson.build index bc14eadba7..159ebdcd96 100644 --- a/data/meson.build +++ b/data/meson.build @@ -15,12 +15,14 @@ meson.add_install_script('sh', '-c', 'mkdir -p $MESON_INSTALL_DESTDIR_PREFIX/@0@'.format(gimpdatadir / 'fonts') ) -custom_target('gimp-release', - output: [ 'gimp-release' ], - command: [ - 'echo', ['[package]' + '\nrevision=@0@'.format(get_option('revision'))] - ], - capture: true, +release_conf = configuration_data() +release_conf.set('REVISION', get_option('revision')) + +gimp_release = 'gimp-release' +configure_file( + input : gimp_release + '.in', + output: gimp_release, + configuration: release_conf, install: true, install_dir: gimpdatadir, )