summaryrefslogtreecommitdiff
path: root/meson_post_install.py
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-08-28 20:23:19 +0200
committerIñigo Martínez <inigomartinez@gmail.com>2017-09-10 21:53:02 +0200
commit8405d0b7cccacf5b776a1b1314976a254094c371 (patch)
treeaa3099e9cb4e2ef001c21eba6ca8e74d5d527a35 /meson_post_install.py
parent81d88d0e7c880715273d84d349ac6bd2eb6ce6d6 (diff)
downloadtelepathy-account-widgets-8405d0b7cccacf5b776a1b1314976a254094c371.tar.gz
build: Port to meson build systemwip/inigomartinez/meson
meson is a build system focused on speed an ease of use, which speeds up software development by the developer. https://bugzilla.gnome.org/show_bug.cgi?id=786969
Diffstat (limited to 'meson_post_install.py')
-rw-r--r--meson_post_install.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 00000000..f876ca23
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import glob
+import os
+import re
+import subprocess
+import sys
+
+icondir = os.path.join(sys.argv[1], 'hicolor')
+
+name_pattern = re.compile('hicolor_(?:apps)_(?:\d+x\d+|scalable)_(.*)')
+search_pattern = '/**/hicolor_*'
+
+[os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1)))
+ for file in glob.glob(icondir + search_pattern, recursive=True)]
+
+if not os.environ.get('DESTDIR'):
+ print('Update icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
+
+ if len(sys.argv) > 2:
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', sys.argv[2]])