#!/usr/bin/env python3 import os import pathlib import subprocess prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')) datadir = prefix / 'share' bindir = prefix / 'bin' destdir = os.environ.get('DESTDIR', '') src = os.path.join(datadir, 'org.snapcast.control.gtk', 'org.snapcast.control.gtk') dest = os.path.join(bindir, 'snapcontrol') subprocess.call(['ln', '-s', '-f', src, dest]) if not destdir: print('Compiling gsettings schemas...') subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0/schemas')]) print('Updating icon cache...') subprocess.call(['gtk-update-icon-cache', '-qtf', str(datadir / 'icons' / 'hicolor' / 'scalable')]) print('Updating desktop database...') subprocess.call(['update-desktop-database', '-q', str(datadir / 'applications')])