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




commit f7aa8d2228e8e57bf47e533fc6d3da588466ae03
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]