[gimp/wip/Jehan/installer-to-windows-store: 2/2] data: fix gimp-release file on Windows.




commit fcf575012febdfb57a3d446dbb7ef0d2680b58c5
Author: Jehan <jehan girinstud io>
Date:   Mon Jun 6 17:14:44 2022 +0200

    data: fix gimp-release file on Windows.
    
    Only needed on meson. The autotools rule work properly according to my
    tests.

 data/meson.build | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index bc14eadba7..a9bfe63882 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -15,10 +15,20 @@ meson.add_install_script('sh', '-c',
   'mkdir -p $MESON_INSTALL_DESTDIR_PREFIX/@0@'.format(gimpdatadir / 'fonts')
 )
 
+# It's crappy, but is a combination of meson not transforming \n into
+# Windows CRLF for us (which might not be considered a bug) and GLib's
+# g_key_file_load_from_file() API apparently not able to work with Unix
+# newlines LF-only while on Windows.
+if platform_windows
+  nl='\r\n'
+else
+  nl='\n'
+endif
+
 custom_target('gimp-release',
   output: [ 'gimp-release' ],
   command: [
-    'echo', ['[package]' + '\nrevision=@0@'.format(get_option('revision'))]
+    'echo', ['[package]' + nl + 'revision=@0@'.format(get_option('revision'))]
   ],
   capture: true,
   install: true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]