Skip to content

Commit

Permalink
Fix installing autostart files in NixOS
Browse files Browse the repository at this point in the history
sysconfdir can be absolute or relative, trying to ensure
the file is actually installed to the prefix in NixOS.
  • Loading branch information
bobby285271 committed Jul 22, 2023
1 parent d68bed2 commit e9beaf7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit e9beaf7

Please sign in to comment.