diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-11-14 11:25:35 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-11-15 13:49:46 +0100 |
commit | a18ecf2fd8c0a396526765ffdebb43fec661451b (patch) | |
tree | e9d0d004915317ff0dcd4c2a9deb9dba1208940b | |
parent | ceb066a1ea088f63597a39f0188d2bac7301171e (diff) | |
download | gnome-bluetooth-a18ecf2fd8c0a396526765ffdebb43fec661451b.tar.gz |
build: Improve post-install script
The post install script is executing a rename process from when the
icons' filenames also contained their installation path, which is
not necessary anymore. It also contains a fixed path for datadir,
which might change.
This patch removes the unnecessary rename process and also uses
the provided datadir path, if the user provides one, or the default
path.
https://bugzilla.gnome.org/show_bug.cgi?id=790332
-rw-r--r-- | icons/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 8 | ||||
-rw-r--r-- | meson_post_install.py | 12 |
3 files changed, 8 insertions, 14 deletions
diff --git a/icons/meson.build b/icons/meson.build index f60a0880..d01af7ef 100644 --- a/icons/meson.build +++ b/icons/meson.build @@ -1 +1 @@ -install_subdir('hicolor', install_dir: gnomebt_icondir) +install_subdir('hicolor', install_dir: join_paths(gnomebt_datadir, 'icons')) diff --git a/meson.build b/meson.build index 9c7bd428..bdc8eaf3 100644 --- a/meson.build +++ b/meson.build @@ -32,8 +32,6 @@ gnomebt_mandir = join_paths(gnomebt_prefix, get_option('mandir')) gnomebt_pkgdatadir = join_paths(gnomebt_datadir, meson.project_name()) gnomebt_pkglibdir = join_paths(gnomebt_libdir, meson.project_name()) -gnomebt_icondir = join_paths(gnomebt_datadir, 'icons') - gnomebt_buildtype = get_option('buildtype') gnomebt_debug = gnomebt_buildtype.contains('debug') @@ -128,7 +126,11 @@ configure_file( configuration: config_h ) -meson.add_install_script('meson_post_install.py', get_option('icon_update') ? 'icon_update' : '') +meson.add_install_script( + 'meson_post_install.py', + get_option('icon_update') ? 'icon_update' : '', + gnomebt_datadir +) output = '\nConfigure summary:\n\n' output += ' Compiler....................: ' + cc.get_id() + '\n\n' diff --git a/meson_post_install.py b/meson_post_install.py index 824a94c7..cd917218 100644 --- a/meson_post_install.py +++ b/meson_post_install.py @@ -1,18 +1,10 @@ #!/usr/bin/env python3 -import glob import os -import re import subprocess import sys -name_pattern = re.compile('hicolor_(?:apps|status)_(?:\d+x\d+|scalable)_(.*)') -search_pattern = '/**/hicolor_*' - -icon_dir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'icons', 'hicolor') -[os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1))) - for file in glob.glob(icon_dir + search_pattern, recursive=True)] - if not os.environ.get('DESTDIR') and sys.argv[1] == 'icon_update': + icondir = os.path.join(sys.argv[2], 'icons', 'hicolor') print('Update icon cache...') - subprocess.call(['gtk-update-icon-cache', '-f', '-t', icon_dir]) + subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir]) |