From 838af929a0ae07e238d30cd7afc96cd7311457ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Mon, 22 May 2023 22:23:38 +0200 Subject: [PATCH] meson: use correct prefix for systemd dirs See https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/ Fixes the build in nixpkgs --- systemd/system/meson.build | 5 ++++- systemd/user/meson.build | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/systemd/system/meson.build b/systemd/system/meson.build index f90f93d5a..632ff420e 100644 --- a/systemd/system/meson.build +++ b/systemd/system/meson.build @@ -2,7 +2,10 @@ systemd_system_unit_dir = get_option('systemd_system_unit_dir') if systemd_system_unit_dir == '' systemd = dependency('systemd', required: false) if systemd.found() - systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir') + systemd_system_unit_dir = systemd.get_variable( + pkgconfig: 'systemdsystemunitdir', + pkgconfig_define: ['prefix', get_option('prefix')], + ) endif endif if systemd_system_unit_dir == '' diff --git a/systemd/user/meson.build b/systemd/user/meson.build index 86a1fd933..7a3522ce5 100644 --- a/systemd/user/meson.build +++ b/systemd/user/meson.build @@ -2,7 +2,10 @@ systemd_user_unit_dir = get_option('systemd_user_unit_dir') if systemd_user_unit_dir == '' systemd = dependency('systemd', required: false) if systemd.found() - systemd_user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir') + systemd_user_unit_dir = systemd.get_variable( + pkgconfig: 'systemduserunitdir', + pkgconfig_define: ['prefix', get_option('prefix')], + ) endif endif if systemd_user_unit_dir == ''