[gnome-packagekit] Fix compiling with newer versions of Meson



commit 030decdab928f06e0128f3fcb1375d89eda20caf
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jun 20 17:09:24 2017 +0100

    Fix compiling with newer versions of Meson
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=784004

 meson.build |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/meson.build b/meson.build
index 2346053..696e35f 100644
--- a/meson.build
+++ b/meson.build
@@ -123,21 +123,23 @@ subdir('src')
 subdir('po')
 subdir('data')
 
-archiver = find_program('git', required : false)
-if archiver.found()
-  run_target('dist',
-    # git config tar.tar.xz.command "xz -c"
-    command: [
-      'git', 'archive',
-      '--prefix=' + meson.project_name() + '-' + meson.project_version() + '/',
-      'HEAD',
-      '--format=tar.xz',
-      '--output',
-      meson.project_name() + '-' + meson.project_version() + '.tar.xz'
-    ]
-  )
-else
-  message('git not found, you will not be able to run `ninja dist`')
+if meson.version().version_compare('<0.41.0')
+  archiver = find_program('git', required : false)
+  if archiver.found()
+    run_target('dist',
+      # git config tar.tar.xz.command "xz -c"
+      command: [
+        'git', 'archive',
+        '--prefix=' + meson.project_name() + '-' + meson.project_version() + '/',
+        'HEAD',
+        '--format=tar.xz',
+        '--output',
+        meson.project_name() + '-' + meson.project_version() + '.tar.xz'
+      ]
+    )
+  else
+    message('git not found, you will not be able to run `ninja dist`')
+  endif
 endif
 
 appstream_util = find_program('appstream-util', required : false)


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