mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-18 19:50:18 +00:00
7
Updated the Meson post-install script to import shutil and add a helper that checks tool availability before invoking post-install commands. This prevents hard failures when optional desktop tooling is not installed (e.g., on macOS/Homebrew CI). Replaced direct subprocess.call(...) calls for gtk-update-icon-cache and update-desktop-database with guarded calls that emit a clear “Skipping …: command not found” message when absent, while preserving existing behavior when present.
This commit is contained in:
@@ -3,16 +3,24 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
|
||||||
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
||||||
datadir = os.path.join(prefix, 'share')
|
datadir = os.path.join(prefix, 'share')
|
||||||
|
|
||||||
# Packaging tools define DESTDIR and this isn't needed for them
|
# Packaging tools define DESTDIR and this isn't needed for them
|
||||||
if 'DESTDIR' not in os.environ:
|
if 'DESTDIR' not in os.environ:
|
||||||
|
def run_if_available(command, *args):
|
||||||
|
if shutil.which(command) is None:
|
||||||
|
print(f'Skipping {command}: command not found')
|
||||||
|
return
|
||||||
|
|
||||||
|
subprocess.call([command, *args])
|
||||||
|
|
||||||
print('Updating icon cache...')
|
print('Updating icon cache...')
|
||||||
subprocess.call(['gtk-update-icon-cache', '-qtf',
|
run_if_available('gtk-update-icon-cache', '-qtf',
|
||||||
os.path.join(datadir, 'icons', 'hicolor')])
|
os.path.join(datadir, 'icons', 'hicolor'))
|
||||||
|
|
||||||
print('Updating desktop database...')
|
print('Updating desktop database...')
|
||||||
subprocess.call(['update-desktop-database', '-q',
|
run_if_available('update-desktop-database', '-q',
|
||||||
os.path.join(datadir, 'applications')])
|
os.path.join(datadir, 'applications'))
|
||||||
|
|||||||
Reference in New Issue
Block a user