[gnome-2048] Fix distbuild.



commit 44a75e1d9dc566e5297528a7613ad9b9aecf7ca1
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Jan 9 22:37:30 2019 +0100

    Fix distbuild.
    
    When building for distribution, the compilation fails
    at the glib-compile-schemas call. Fix that by copying
    the post-install script of dconf-editor, as it works.

 data/meson.build      |  1 -
 meson.build           |  5 +++++
 meson_post_install.py | 22 ++++++++++++++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)
---
diff --git a/data/meson.build b/data/meson.build
index 40676ba..47922ee 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -22,7 +22,6 @@ install_data(
   'org.gnome.2048.gschema.xml',
   install_dir: schemadir,
 )
-meson.add_install_script('glib-compile-schemas', schemadir)
 
 desktop_file = i18n.merge_file(
   'desktop-file',
diff --git a/meson.build b/meson.build
index ac58c08..2b2043b 100644
--- a/meson.build
+++ b/meson.build
@@ -35,3 +35,8 @@ subdir('po')
 subdir('data')
 subdir('help')
 subdir('src')
+
+meson.add_install_script(
+  'meson_post_install.py',
+  datadir
+)
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..a814cdf
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+if not os.environ.get('DESTDIR'):
+  prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
+  datadir = os.path.join(prefix, 'share')
+
+  print('Updating icon cache...')
+  icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
+  if not os.path.exists(icon_cache_dir):
+    os.makedirs(icon_cache_dir)
+  subprocess.call(['gtk-update-icon-cache',
+                   '--quiet', '--force', '--ignore-theme-index',
+                   icon_cache_dir])
+
+  print('Compiling GSettings schemas...')
+  schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
+  if not os.path.exists(schemas_dir):
+    os.makedirs(schemas_dir)
+  subprocess.call(['glib-compile-schemas', schemas_dir])


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