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

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