From 78a5f881ba329ea28ade0c3c91fe18521135877a Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Thu, 11 Nov 2021 21:14:58 +0800 Subject: [PATCH] build: add systemduserunitdir option --- data/meson.build | 5 ++++- meson_options.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/data/meson.build b/data/meson.build index e98cd147..968ddfd1 100644 --- a/data/meson.build +++ b/data/meson.build @@ -45,7 +45,10 @@ install_data('icons/64x64/multitasking-view.svg', install_dir: join_paths(icons_ if get_option('systemd') dep_systemd = dependency('systemd', required: true) - systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir') + systemd_userunitdir = get_option('systemduserunitdir') + if systemd_userunitdir == '' + systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir', define_variable: ['prefix', get_option('prefix')]) + endif bindir = join_paths(get_option('prefix'), get_option('bindir')) unit_conf = configuration_data() diff --git a/meson_options.txt b/meson_options.txt index b41e9d76..54b3ac94 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option ('documentation', type : 'boolean', value : false) option ('systemd', type : 'boolean', value : true) +option ('systemduserunitdir', type : 'string', value : '')