From ce50249c04f83fa72abd684ccca1a92d346d7907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Sun, 8 Sep 2019 14:04:34 +0200 Subject: [PATCH 1/2] service file: allow for waybar installed in different prefix --- meson.build | 11 +++++++++-- resources/{waybar.service => waybar.service.in} | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) rename resources/{waybar.service => waybar.service.in} (89%) diff --git a/meson.build b/meson.build index 33c3f5f7..33069cc6 100644 --- a/meson.build +++ b/meson.build @@ -64,10 +64,17 @@ libudev = dependency('libudev', required: get_option('libudev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) systemd = dependency('systemd', required: get_option('systemd')) +conf_data = configuration_data() + if systemd.found() user_units_dir = systemd.get_pkgconfig_variable('systemduserunitdir') - install_data('./resources/waybar.service', - install_dir: user_units_dir) + + configure_file( + configuration: conf_data, + input: './resources/waybar.service.in', + output: '@BASENAME@', + install_dir: user_units_dir + ) endif src_files = files( diff --git a/resources/waybar.service b/resources/waybar.service.in similarity index 89% rename from resources/waybar.service rename to resources/waybar.service.in index 5eee4aaf..1c086bfa 100644 --- a/resources/waybar.service +++ b/resources/waybar.service.in @@ -6,7 +6,7 @@ PartOf=wayland-session.target [Service] Type=dbus BusName=fr.arouillard.waybar -ExecStart=/usr/bin/waybar +ExecStart=@prefix@/bin/waybar [Install] WantedBy=wayland-session.target From 4b24c19fa72c91ad38701efa19e69618ead9991e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Tue, 10 Sep 2019 14:12:52 +0200 Subject: [PATCH 2/2] add prefix to the configuration data --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 33069cc6..4bcd5729 100644 --- a/meson.build +++ b/meson.build @@ -64,7 +64,9 @@ libudev = dependency('libudev', required: get_option('libudev')) libmpdclient = dependency('libmpdclient', required: get_option('mpd')) systemd = dependency('systemd', required: get_option('systemd')) +prefix = get_option('prefix') conf_data = configuration_data() +conf_data.set('prefix', prefix) if systemd.found() user_units_dir = systemd.get_pkgconfig_variable('systemduserunitdir')