|
|
f5e75e |
From 0a9f3dc7cd45bda1fae2e17ab5ef17b1187327a2 Mon Sep 17 00:00:00 2001
|
|
|
f5e75e |
From: Ray Strode <rstrode@redhat.com>
|
|
|
f5e75e |
Date: Wed, 11 Aug 2021 15:00:20 -0400
|
|
|
f5e75e |
Subject: [PATCH 3/6] kiosk-script: Install session file with fallback in mind
|
|
|
f5e75e |
|
|
|
f5e75e |
---
|
|
|
f5e75e |
meson/postinstall.py | 8 +++++++-
|
|
|
f5e75e |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
f5e75e |
|
|
|
f5e75e |
diff --git a/meson/postinstall.py b/meson/postinstall.py
|
|
|
f5e75e |
index 537fb3f..ace3927 100755
|
|
|
f5e75e |
--- a/meson/postinstall.py
|
|
|
f5e75e |
+++ b/meson/postinstall.py
|
|
|
f5e75e |
@@ -1,38 +1,44 @@
|
|
|
f5e75e |
#!/usr/bin/env python3
|
|
|
f5e75e |
|
|
|
f5e75e |
import os
|
|
|
f5e75e |
import shutil
|
|
|
f5e75e |
import subprocess
|
|
|
f5e75e |
import sys
|
|
|
f5e75e |
|
|
|
f5e75e |
destdir = os.environ.get('DESTDIR', '/')
|
|
|
f5e75e |
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
|
|
f5e75e |
datadir = os.path.join(destdir + prefix, 'share')
|
|
|
f5e75e |
|
|
|
f5e75e |
+xsessions_dir = os.path.join(datadir, 'xsessions')
|
|
|
f5e75e |
wayland_sessions_dir = os.path.join(datadir, 'wayland-sessions')
|
|
|
f5e75e |
if not os.path.exists(wayland_sessions_dir):
|
|
|
f5e75e |
os.makedirs(wayland_sessions_dir)
|
|
|
f5e75e |
|
|
|
f5e75e |
-source_file = os.path.join(datadir, 'xsessions', 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
|
|
f5e75e |
+source_file = os.path.join(xsessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
|
|
f5e75e |
destination_file = os.path.join(wayland_sessions_dir, 'org.gnome.Kiosk.SearchApp.Session.desktop')
|
|
|
f5e75e |
shutil.copyfile(source_file, destination_file)
|
|
|
f5e75e |
|
|
|
f5e75e |
+source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script-xorg.desktop')
|
|
|
f5e75e |
+destination_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop')
|
|
|
f5e75e |
+source_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script-wayland.desktop')
|
|
|
f5e75e |
+destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop')
|
|
|
f5e75e |
+
|
|
|
f5e75e |
# Packaging tools define DESTDIR and this isn't needed for them
|
|
|
f5e75e |
if 'DESTDIR' not in os.environ:
|
|
|
f5e75e |
print('Updating icon cache...')
|
|
|
f5e75e |
icon_cache_dir = os.path.join(datadir, 'icons', 'hicolor')
|
|
|
f5e75e |
if not os.path.exists(icon_cache_dir):
|
|
|
f5e75e |
os.makedirs(icon_cache_dir)
|
|
|
f5e75e |
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
|
|
|
f5e75e |
|
|
|
f5e75e |
print('Updating desktop database...')
|
|
|
f5e75e |
desktop_database_dir = os.path.join(datadir, 'applications')
|
|
|
f5e75e |
if not os.path.exists(desktop_database_dir):
|
|
|
f5e75e |
os.makedirs(desktop_database_dir)
|
|
|
f5e75e |
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
|
|
|
f5e75e |
|
|
|
f5e75e |
print('Compiling GSettings schemas...')
|
|
|
f5e75e |
schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
|
|
|
f5e75e |
if not os.path.exists(schemas_dir):
|
|
|
f5e75e |
os.makedirs(schemas_dir)
|
|
|
f5e75e |
subprocess.call(['glib-compile-schemas', schemas_dir])
|
|
|
f5e75e |
--
|
|
|
f5e75e |
2.31.1
|
|
|
f5e75e |
|