diff options
author | Carlos Soriano <csoriano@gnome.org> | 2017-05-02 19:44:41 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2017-05-02 19:50:54 +0200 |
commit | 53928d7f468e233b569f37d058bd9d4742bb60a5 (patch) | |
tree | 44408ab6d58656ed41b7a781c39e5cabea3b8f96 /build-aux | |
parent | e9f56f411c5959d0c2961f33bcf9d38fb859f20b (diff) | |
download | nautilus-53928d7f468e233b569f37d058bd9d4742bb60a5.tar.gz |
postinstall: Use python
Instead of shell scripts, much better to maintain.
Also, the new python script has better handling of non existing paths.
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/meson/postinstall.py | 27 | ||||
-rwxr-xr-x | build-aux/meson/postinstall.sh | 13 |
2 files changed, 27 insertions, 13 deletions
diff --git a/build-aux/meson/postinstall.py b/build-aux/meson/postinstall.py new file mode 100755 index 000000000..81afb18b7 --- /dev/null +++ b/build-aux/meson/postinstall.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import os +import subprocess + +prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') +datadir = os.path.join(prefix, 'share') + +# Packaging tools define DESTDIR and this isn't needed for them +if 'DESTDIR' not in os.environ: + 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', '-qtf', icon_cache_dir]) + + print('Updating desktop database...') + desktop_database_dir = os.path.join(datadir, 'applications') + if not os.path.exists(desktop_database_dir): + os.makedirs(desktop_database_dir) + subprocess.call(['update-desktop-database', '-q', desktop_database_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]) diff --git a/build-aux/meson/postinstall.sh b/build-aux/meson/postinstall.sh deleted file mode 100755 index 9d10bf1e2..000000000 --- a/build-aux/meson/postinstall.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Package managers set this so we don't need to run -if [ -z "$DESTDIR" ]; then - echo Compiling GSettings schemas... - glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas - - echo Updating desktop database... - update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications - - echo Updating icon cache... - gtk-update-icon-cache -q -t -f ${MESON_INSTALL_PREFIX}/share/icons/hicolor -fi
\ No newline at end of file |