Blame SOURCES/0003-kiosk-script-Install-session-file-with-fallback-in-m.patch

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