Blame SOURCES/0004-kiosk-script-Give-xsession-and-wayland-session-file-.patch

f5e75e
From 2bd27ae9e08d6848ab14cde0a8bf81827df7a98b Mon Sep 17 00:00:00 2001
f5e75e
From: Ray Strode <rstrode@redhat.com>
f5e75e
Date: Wed, 11 Aug 2021 15:03:38 -0400
f5e75e
Subject: [PATCH 4/6] kiosk-script: Give xsession and wayland-session file the
f5e75e
 same name
f5e75e
f5e75e
In order for fallback logic to work properly, the two session names
f5e75e
need to be the same.
f5e75e
f5e75e
This commit fixes that.
f5e75e
---
f5e75e
 .../gnome-kiosk-script.desktop.in}                   |  2 +-
f5e75e
 .../gnome-kiosk-script-wayland.desktop.in            |  9 ---------
f5e75e
 meson.build                                          | 12 ++----------
f5e75e
 meson/postinstall.py                                 |  5 ++---
f5e75e
 4 files changed, 5 insertions(+), 23 deletions(-)
f5e75e
 rename kiosk-script/{xsessions/gnome-kiosk-script-xorg.desktop.in => sessions/gnome-kiosk-script.desktop.in} (84%)
f5e75e
 delete mode 100644 kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
f5e75e
f5e75e
diff --git a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in b/kiosk-script/sessions/gnome-kiosk-script.desktop.in
f5e75e
similarity index 84%
f5e75e
rename from kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
f5e75e
rename to kiosk-script/sessions/gnome-kiosk-script.desktop.in
f5e75e
index 11dc0cf..36f810f 100644
f5e75e
--- a/kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in
f5e75e
+++ b/kiosk-script/sessions/gnome-kiosk-script.desktop.in
f5e75e
@@ -1,9 +1,9 @@
f5e75e
 [Desktop Entry]
f5e75e
-Name=Kiosk Script Session (X11 Display Server)
f5e75e
+Name=Kiosk Script Session
f5e75e
 Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
f5e75e
 Exec=gnome-session --session gnome-kiosk-script
f5e75e
 TryExec=gnome-session
f5e75e
 Type=Application
f5e75e
 DesktopNames=GNOME-Kiosk;GNOME;
f5e75e
 X-GDM-SessionRegisters=true
f5e75e
 
f5e75e
diff --git a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in b/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
f5e75e
deleted file mode 100644
f5e75e
index 05e8dea..0000000
f5e75e
--- a/kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in
f5e75e
+++ /dev/null
f5e75e
@@ -1,9 +0,0 @@
f5e75e
-[Desktop Entry]
f5e75e
-Name=Kiosk Script Session (Wayland Display Server)
f5e75e
-Comment=This session logs you into the sessoin started by ~/.local/bin/gnome-kiosk-script
f5e75e
-Exec=gnome-session --session gnome-kiosk-script
f5e75e
-TryExec=gnome-session
f5e75e
-Type=Application
f5e75e
-DesktopNames=GNOME-Kiosk;GNOME;
f5e75e
-X-GDM-SessionRegisters=true
f5e75e
-
f5e75e
diff --git a/meson.build b/meson.build
f5e75e
index 1f5a756..0faf9fe 100644
f5e75e
--- a/meson.build
f5e75e
+++ b/meson.build
f5e75e
@@ -181,75 +181,67 @@ desktop_file = configure_file(
f5e75e
         input: 'kiosk-script/desktop/org.gnome.Kiosk.Script.desktop.in.in',
f5e75e
         output: 'org.gnome.Kiosk.Script.desktop.in',
f5e75e
         configuration: desktop_config_data
f5e75e
 )
f5e75e
 
f5e75e
 i18n.merge_file('desktop',
f5e75e
         input: desktop_file,
f5e75e
         output: 'org.gnome.Kiosk.Script.desktop',
f5e75e
         po_dir: po_dir,
f5e75e
         install: true,
f5e75e
         install_dir: desktop_data_dir,
f5e75e
         type: 'desktop'
f5e75e
 )
f5e75e
 
f5e75e
 configure_file(
f5e75e
        input: 'kiosk-script/systemd/org.gnome.Kiosk.Script.service.in',
f5e75e
        output: '@BASENAME@',
f5e75e
        configuration: systemd_service_config_data,
f5e75e
        install_dir: systemd_user_unit_dir
f5e75e
 )
f5e75e
 
f5e75e
 kiosk_script_systemd_target_dir = join_paths(systemd_user_unit_dir, 'gnome-session@gnome-kiosk-script.target.d')
f5e75e
 install_data('kiosk-script/systemd/session.conf',
f5e75e
         install_dir: kiosk_script_systemd_target_dir
f5e75e
 )
f5e75e
 
f5e75e
 install_data('kiosk-script/gnome-session/gnome-kiosk-script.session',
f5e75e
         install_dir: session_dir,
f5e75e
 )
f5e75e
 
f5e75e
-i18n.merge_file('desktop',
f5e75e
-        input: 'kiosk-script/xsessions/gnome-kiosk-script-xorg.desktop.in',
f5e75e
-        output: '@BASENAME@',
f5e75e
-        po_dir: po_dir,
f5e75e
-        install: true,
f5e75e
-        install_dir: xsessions_dir,
f5e75e
-        type: 'desktop'
f5e75e
-)
f5e75e
 
f5e75e
 i18n.merge_file('desktop',
f5e75e
-        input: 'kiosk-script/wayland-sessions/gnome-kiosk-script-wayland.desktop.in',
f5e75e
+        input: 'kiosk-script/sessions/gnome-kiosk-script.desktop.in',
f5e75e
         output: '@BASENAME@',
f5e75e
         po_dir: po_dir,
f5e75e
         install: true,
f5e75e
-        install_dir: wayland_sessions_dir,
f5e75e
+        install_dir: xsessions_dir,
f5e75e
         type: 'desktop'
f5e75e
 )
f5e75e
 
f5e75e
 session_config_data = configuration_data()
f5e75e
 session_config_data.set('required_components', 'org.gnome.Kiosk;org.gnome.Kiosk.SearchApp;')
f5e75e
 
f5e75e
 session_file = configure_file(
f5e75e
         input: 'search-app/org.gnome.Kiosk.SearchApp.session.desktop.in.in',
f5e75e
         output: 'org.gnome.Kiosk.SearchApp.session.desktop.in',
f5e75e
         configuration: session_config_data
f5e75e
 )
f5e75e
 
f5e75e
 subdir('input-selector')
f5e75e
 
f5e75e
 i18n.merge_file('desktop',
f5e75e
         input: session_file,
f5e75e
         output: 'org.gnome.Kiosk.SearchApp.session',
f5e75e
         po_dir: po_dir,
f5e75e
         install: true,
f5e75e
         install_dir: session_dir,
f5e75e
         type: 'desktop'
f5e75e
 )
f5e75e
 
f5e75e
 i18n.merge_file('desktop',
f5e75e
         input: 'search-app/org.gnome.Kiosk.SearchApp.Session.desktop.in',
f5e75e
         output: 'org.gnome.Kiosk.SearchApp.Session.desktop',
f5e75e
         po_dir: po_dir,
f5e75e
         install: true,
f5e75e
         install_dir: xsessions_dir,
f5e75e
         type: 'desktop'
f5e75e
diff --git a/meson/postinstall.py b/meson/postinstall.py
f5e75e
index ace3927..430ae6c 100755
f5e75e
--- a/meson/postinstall.py
f5e75e
+++ b/meson/postinstall.py
f5e75e
@@ -1,44 +1,43 @@
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(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
+source_file = os.path.join(xsessions_dir, 'gnome-kiosk-script.desktop')
f5e75e
 destination_file = os.path.join(wayland_sessions_dir, 'gnome-kiosk-script.desktop')
f5e75e
+shutil.copyfile(source_file, destination_file)
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