From c94ef092ff2aa59b08cb673c007ee732de3dbeb7 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 11 Aug 2019 10:09:55 +0000 Subject: [PATCH] build: drop -Dout in favor of --prefix $ meson --prefix=/tmp/foo _build $ ninja install -C _build [49/50] Installing files. Installing waybar to /tmp/foo/bin Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 127, in run return options.run_func(options) File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 514, in run installer.do_install(datafilename) File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 346, in do_install self.install_data(d) File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 375, in install_data d.dirmaker.makedirs(outdir, exist_ok=True) File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 55, in makedirs os.makedirs(path, exist_ok=exist_ok) File "/usr/lib/python3.6/os.py", line 210, in makedirs makedirs(head, mode, exist_ok) File "/usr/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/etc/xdg' FAILED: meson-install --- meson.build | 5 ++++- meson_options.txt | 1 - src/client.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 63139035..0b2aa154 100644 --- a/meson.build +++ b/meson.build @@ -89,9 +89,12 @@ systemd = dependency('systemd', required: get_option('systemd')) tz_dep = dependency('date', default_options : [ 'use_system_tzdb=true' ], fallback: [ 'date', 'tz_dep' ]) prefix = get_option('prefix') +sysconfdir = get_option('sysconfdir') conf_data = configuration_data() conf_data.set('prefix', prefix) +add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'cpp') + if systemd.found() user_units_dir = systemd.get_pkgconfig_variable('systemduserunitdir') @@ -198,7 +201,7 @@ executable( install_data( './resources/config', './resources/style.css', - install_dir: join_paths(get_option('out'), 'etc/xdg/waybar') + install_dir: sysconfdir + '/xdg/waybar' ) scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages')) diff --git a/meson_options.txt b/meson_options.txt index 8d442c77..a44ff648 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -6,5 +6,4 @@ option('systemd', type: 'feature', value: 'auto', description: 'Install systemd option('dbusmenu-gtk', type: 'feature', value: 'auto', description: 'Enable support for tray') option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('mpd', type: 'feature', value: 'auto', description: 'Enable support for the Music Player Daemon') -option('out', type: 'string', value : '/', description: 'output prefix directory') option('gtk-layer-shell', type: 'feature', value: 'auto', description: 'Use gtk-layer-shell library for popups support') diff --git a/src/client.cpp b/src/client.cpp index 5e76b3ce..e0515d4f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -161,7 +161,7 @@ std::tuple waybar::Client::getConfigs( "$XDG_CONFIG_HOME/waybar/config", "$HOME/.config/waybar/config", "$HOME/waybar/config", - "/etc/xdg/waybar/config", + SYSCONFDIR "/xdg/waybar/config", "./resources/config", }) : config; @@ -169,7 +169,7 @@ std::tuple waybar::Client::getConfigs( "$XDG_CONFIG_HOME/waybar/style.css", "$HOME/.config/waybar/style.css", "$HOME/waybar/style.css", - "/etc/xdg/waybar/style.css", + SYSCONFDIR "/xdg/waybar/style.css", "./resources/style.css", }) : style;