From e9beaf7cd494deb2726b87bcc8277ede8843a37b Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Sat, 22 Jul 2023 18:50:10 +0800 Subject: [PATCH] Fix installing autostart files in NixOS sysconfdir can be absolute or relative, trying to ensure the file is actually installed to the prefix in NixOS. --- data/meson.build | 5 +++-- meson.build | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/meson.build b/data/meson.build index bc55550e..2c77cf01 100644 --- a/data/meson.build +++ b/data/meson.build @@ -4,10 +4,11 @@ install_data( rename: meson.project_name() + '.desktop' ) +fs = import('fs') meson.add_install_script( symlink, - join_paths(get_option('datadir'), 'applications', meson.project_name() + '.desktop'), - join_paths(get_option('sysconfdir'), 'xdg', 'autostart', meson.project_name() + '.desktop'), + join_paths(datadir, 'applications', meson.project_name() + '.desktop'), + join_paths(fs.is_absolute(sysconfdir) ? sysconfdir : prefix / sysconfdir, 'xdg', 'autostart', meson.project_name() + '.desktop'), ) dbus_dep = dependency('dbus-1') diff --git a/meson.build b/meson.build index 69bfd963..b728a3af 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,7 @@ project('io.elementary.settings-daemon', 'c', 'vala', version: '1.3.0', license: 'GPL3', + meson_version: '>= 0.54.0', ) fwupd_dep = dependency('fwupd') @@ -46,6 +47,7 @@ config_dep = declare_dependency( prefix = get_option('prefix') datadir = join_paths(prefix, get_option('datadir')) +sysconfdir = get_option('sysconfdir') symlink = join_paths(meson.current_source_dir (), 'meson', 'create-symlink.sh')