Skip to content

Commit f7bfc67

Browse files
committed
Merge branch 'update-icon-cache'
2 parents 466bfda + 0451453 commit f7bfc67

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

meson.build

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ run_target('build', command: 'build-cli.sh')
1414
subdir('data')
1515
subdir('src')
1616
subdir('fonts/lora')
17+
18+
meson.add_install_script('meson/post_install.py')
19+

meson/post_install.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import subprocess
5+
6+
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
7+
datadir = os.path.join(prefix, 'share')
8+
9+
# Packaging tools define DESTDIR and this isn't needed for them
10+
if 'DESTDIR' not in os.environ:
11+
print('Updating icon cache...')
12+
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
13+
if not os.path.exists(icon_cache_dir):
14+
os.makedirs(icon_cache_dir)
15+
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
16+
17+
print('Updating desktop database...')
18+
desktop_database_dir = os.path.join(datadir, 'applications')
19+
if not os.path.exists(desktop_database_dir):
20+
os.makedirs(desktop_database_dir)
21+
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
22+

0 commit comments

Comments
 (0)