From 00ee48ee2218a0e56f243d797ea2d3705e43d532 Mon Sep 17 00:00:00 2001 From: Ikey Doherty Date: Wed, 15 Nov 2017 00:15:05 +0000 Subject: [PATCH] data: If we're using snap mode, configure frontend to use lsi-exec This will ensure that the settings UI will always work, which will somewhat perversely use lsi-exec through the config that it sets to launch itself to set the config of lsi-exec.. This will allow us to actually expose lsi-settings as a usable thing within the snap, where it is currently omitted. If we're not using snapd mode, we'll just keep the file how it used to look. Signed-off-by: Ikey Doherty --- ...{lsi-settings.desktop => lsi-settings.desktop.in} | 2 +- data/meson.build | 12 ++++++++++-- src/frontend/meson.build | 7 ++++++- src/shim/meson.build | 8 +++++++- 4 files changed, 24 insertions(+), 5 deletions(-) rename data/{lsi-settings.desktop => lsi-settings.desktop.in} (90%) diff --git a/data/lsi-settings.desktop b/data/lsi-settings.desktop.in similarity index 90% rename from data/lsi-settings.desktop rename to data/lsi-settings.desktop.in index 73a5891..50989b9 100644 --- a/data/lsi-settings.desktop +++ b/data/lsi-settings.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Name=Linux Steam Integration Comment=Application for managing Steam integration settings -Exec=lsi-settings +Exec=@LSI_SETTINGS@ Icon=steam Terminal=false Type=Application diff --git a/data/meson.build b/data/meson.build index 5e96af9..95ba000 100644 --- a/data/meson.build +++ b/data/meson.build @@ -2,8 +2,16 @@ appsdir = join_paths(datadir, 'applications') # If frontend is enabled, install lsi-settings.desktop if with_frontend == true - install_data( - 'lsi-settings.desktop', + data_conf = configuration_data() + if with_snap_support == true + data_conf.set('LSI_SETTINGS', 'linux-steam-integration.exec $SNAP/bin/linux-steam-integration.settings') + else + data_conf.set('LSI_SETTINGS', 'lsi-settings') + endif + configure_file( + input: 'lsi-settings.desktop.in', + output: 'lsi-settings.desktop', + configuration: data_conf, install_dir: appsdir, ) endif diff --git a/src/frontend/meson.build b/src/frontend/meson.build index 83c9d74..0c0cb28 100644 --- a/src/frontend/meson.build +++ b/src/frontend/meson.build @@ -6,8 +6,13 @@ if with_frontend == true 'main-window.c', ] + frontend_name = 'lsi-settings' + if with_snap_support == true + frontend_name = 'linux-steam-integration.settings' + endif + frontend = executable( - 'lsi-settings', + frontend_name, sources: frontend_sources + nica_sources, include_directories: nica_includes, dependencies: [ diff --git a/src/shim/meson.build b/src/shim/meson.build index 075332b..cdc829d 100644 --- a/src/shim/meson.build +++ b/src/shim/meson.build @@ -15,6 +15,12 @@ if shim_behaviour != 'none' 'lsi-exec.c', ] + exec_name = 'lsi-exec' + frontend_name = 'lsi-settings' + if with_snap_support == true + exec_name = 'linux-steam-integration.exec' + endif + shim = executable( shim_target_name, sources: shim_sources + nica_sources, @@ -26,7 +32,7 @@ if shim_behaviour != 'none' ) lsi_exec = executable( - 'lsi-exec', + exec_name, sources: exec_sources + nica_sources, include_directories: nica_includes, dependencies: [