[balsa] images/meson.build: Clean up icon-cache code



commit 92dcf1032b21af618a03d24a8bc79c88c0077178
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Aug 15 17:39:01 2022 -0400

    images/meson.build: Clean up icon-cache code
    
    modified:   images/meson.build
    modified:   meson.build

 images/meson.build | 20 +++++++++++++-------
 meson.build        |  2 --
 2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/images/meson.build b/images/meson.build
index c40e6f77a..049891c20 100644
--- a/images/meson.build
+++ b/images/meson.build
@@ -14,14 +14,20 @@ balsa_imgs = [
   'balsa_logo.png'
   ]
 
-balsabitmapsdir = join_paths(get_option('datadir'), 'balsa', 'pixmaps')
-install_data(balsa_imgs, install_dir : balsabitmapsdir)
+balsa_bitmaps_dir = join_paths(get_option('datadir'), 'balsa', 'pixmaps')
+install_data(balsa_imgs, install_dir : balsa_bitmaps_dir)
 
+gtk_update_icon_cache_program = find_program('gtk-update-icon-cache')
 if gtk_update_icon_cache_program.found()
   icon_cache_dir = join_paths(get_option('prefix'), get_option('datadir'), 'balsa')
-  result = run_command(gtk_update_icon_cache_program, '--ignore-theme-index', icon_cache_dir,
-                       check : false)
-  if result.returncode() != 0
-    warning(result.stderr())
-  endif # result.returncode() != 0
+  if meson.version().version_compare('>=0.55')
+    meson.add_install_script(gtk_update_icon_cache_program, '--ignore-theme-index', icon_cache_dir)
+  else # meson.version().version_compare('>=0.55')
+    gtk_update_icon_cache_script = join_paths(meson.current_build_dir(), 'gtk-update-icon-cache.sh')
+    run_command('sh', '-c', 'echo "#!/bin/sh" > ' + gtk_update_icon_cache_script,
+                check : false)
+    run_command('sh', '-c', 'echo "gtk-update-icon-cache $1 $2" >> ' + gtk_update_icon_cache_script,
+                check : false)
+    meson.add_install_script(gtk_update_icon_cache_script, '--ignore-theme-index', icon_cache_dir)
+  endif # meson.version().version_compare('>=0.55')
 endif # gtk_update_icon_cache_program.found()
diff --git a/meson.build b/meson.build
index 516ddb73c..00a57a84f 100644
--- a/meson.build
+++ b/meson.build
@@ -492,8 +492,6 @@ endif # balsa_from_git
 balsa_data_prefix = join_paths(get_option('prefix'), get_option('datadir'), 'balsa')
 add_global_arguments('-DBALSA_DATA_PREFIX="' + balsa_data_prefix + '"', language : 'c')
 
-gtk_update_icon_cache_program = find_program('gtk-update-icon-cache')
-
 ###########################################################################
 # Documentation and Testing requirements for libnetclient
 ###########################################################################


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