2018-08-10 16:37:03 +02:00
|
|
|
project(
|
|
|
|
'waybar', 'cpp', 'c',
|
2023-01-11 11:39:30 +01:00
|
|
|
version: '0.9.17',
|
2018-08-10 16:37:03 +02:00
|
|
|
license: 'MIT',
|
2023-04-15 01:36:15 +02:00
|
|
|
meson_version: '>= 0.50.0',
|
2018-08-30 11:30:20 +02:00
|
|
|
default_options : [
|
|
|
|
'cpp_std=c++17',
|
2018-11-08 09:57:24 +01:00
|
|
|
'buildtype=release',
|
|
|
|
'default_library=static'
|
2018-08-30 11:30:20 +02:00
|
|
|
],
|
2018-08-10 16:37:03 +02:00
|
|
|
)
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2020-02-11 14:38:05 +01:00
|
|
|
compiler = meson.get_compiler('cpp')
|
|
|
|
|
2018-12-26 11:13:36 +01:00
|
|
|
cpp_args = []
|
2018-08-19 13:41:22 +02:00
|
|
|
cpp_link_args = []
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2019-05-12 19:53:14 +02:00
|
|
|
if get_option('libcxx')
|
2018-08-08 23:54:58 +02:00
|
|
|
cpp_args += ['-stdlib=libc++']
|
|
|
|
cpp_link_args += ['-stdlib=libc++', '-lc++abi']
|
2019-08-09 12:00:52 +02:00
|
|
|
endif
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2019-08-09 12:00:52 +02:00
|
|
|
if compiler.has_link_argument('-lc++fs')
|
|
|
|
cpp_link_args += ['-lc++fs']
|
|
|
|
elif compiler.has_link_argument('-lc++experimental')
|
|
|
|
cpp_link_args += ['-lc++experimental']
|
|
|
|
elif compiler.has_link_argument('-lstdc++fs')
|
2018-08-08 23:54:58 +02:00
|
|
|
cpp_link_args += ['-lstdc++fs']
|
|
|
|
endif
|
|
|
|
|
2020-04-05 16:12:25 +02:00
|
|
|
git = find_program('git', native: true, required: false)
|
2018-12-26 11:13:36 +01:00
|
|
|
|
|
|
|
if not git.found()
|
|
|
|
add_project_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'cpp')
|
|
|
|
else
|
2020-05-24 19:14:27 +02:00
|
|
|
git_path = run_command([git.path(), 'rev-parse', '--show-toplevel']).stdout().strip()
|
|
|
|
if meson.source_root() == git_path
|
|
|
|
git_commit_hash = run_command([git.path(), 'describe', '--always', '--tags']).stdout().strip()
|
|
|
|
git_branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD']).stdout().strip()
|
2020-06-24 15:06:30 +02:00
|
|
|
version = '"@0@ (branch \'@1@\')"'.format(git_commit_hash, git_branch)
|
2020-05-24 19:14:27 +02:00
|
|
|
add_project_arguments('-DVERSION=@0@'.format(version), language: 'cpp')
|
|
|
|
else
|
|
|
|
add_project_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'cpp')
|
|
|
|
endif
|
2018-12-26 11:13:36 +01:00
|
|
|
endif
|
2018-11-08 09:57:24 +01:00
|
|
|
|
|
|
|
if not compiler.has_header('filesystem')
|
2019-05-12 19:53:14 +02:00
|
|
|
if compiler.has_header('experimental/filesystem')
|
|
|
|
add_project_arguments('-DFILESYSTEM_EXPERIMENTAL', language: 'cpp')
|
|
|
|
else
|
|
|
|
add_project_arguments('-DNO_FILESYSTEM', language: 'cpp')
|
|
|
|
warning('No filesystem header found, some modules may not work')
|
|
|
|
endif
|
2018-11-08 09:57:24 +01:00
|
|
|
endif
|
|
|
|
|
2020-02-05 20:02:42 +01:00
|
|
|
code = '''
|
|
|
|
#include <langinfo.h>
|
|
|
|
#include <locale.h>
|
2020-02-04 01:58:18 +01:00
|
|
|
int main(int argc, char** argv) {
|
2020-02-05 20:02:42 +01:00
|
|
|
locale_t locale = newlocale(LC_ALL, "en_US.UTF-8", nullptr);
|
2020-02-04 01:58:18 +01:00
|
|
|
char* str;
|
2020-02-05 20:02:42 +01:00
|
|
|
str = nl_langinfo_l(_NL_TIME_WEEK_1STDAY, locale);
|
|
|
|
str = nl_langinfo_l(_NL_TIME_FIRST_WEEKDAY, locale);
|
|
|
|
freelocale(locale);
|
2020-02-04 01:58:18 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
'''
|
|
|
|
if compiler.links(code, name : 'nl_langinfo with _NL_TIME_WEEK_1STDAY, _NL_TIME_FIRST_WEEKDAY')
|
|
|
|
add_project_arguments('-DHAVE_LANGINFO_1STDAY', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2018-08-08 23:54:58 +02:00
|
|
|
add_global_arguments(cpp_args, language : 'cpp')
|
|
|
|
add_global_link_arguments(cpp_link_args, language : 'cpp')
|
|
|
|
|
2019-08-09 11:52:16 +02:00
|
|
|
is_linux = host_machine.system() == 'linux'
|
2019-08-09 12:40:33 +02:00
|
|
|
is_dragonfly = host_machine.system() == 'dragonfly'
|
|
|
|
is_freebsd = host_machine.system() == 'freebsd'
|
|
|
|
is_netbsd = host_machine.system() == 'netbsd'
|
|
|
|
is_openbsd = host_machine.system() == 'openbsd'
|
2019-08-09 11:52:16 +02:00
|
|
|
|
2018-08-08 23:54:58 +02:00
|
|
|
thread_dep = dependency('threads')
|
2022-06-24 15:44:06 +02:00
|
|
|
fmt = dependency('fmt', version : ['>=8.1.1'], fallback : ['fmt', 'fmt_dep'])
|
|
|
|
spdlog = dependency('spdlog', version : ['>=1.10.0'], fallback : ['spdlog', 'spdlog_dep'], default_options : ['external_fmt=enabled'])
|
2018-08-08 23:54:58 +02:00
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
wayland_cursor = dependency('wayland-cursor')
|
|
|
|
wayland_protos = dependency('wayland-protocols')
|
2019-08-28 05:57:23 +02:00
|
|
|
gtkmm = dependency('gtkmm-3.0', version : ['>=3.22.0'])
|
2018-10-25 11:47:03 +02:00
|
|
|
dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4', required: get_option('dbusmenu-gtk'))
|
2021-11-01 19:17:29 +01:00
|
|
|
giounix = dependency('gio-unix-2.0', required: (get_option('dbusmenu-gtk').enabled() or
|
|
|
|
get_option('logind').enabled() or
|
|
|
|
get_option('upower_glib').enabled() or
|
|
|
|
get_option('mpris').enabled()))
|
2022-11-03 14:08:22 +01:00
|
|
|
jsoncpp = dependency('jsoncpp', version : ['>=1.9.2'], fallback : ['jsoncpp', 'jsoncpp_dep'])
|
2018-08-08 23:54:58 +02:00
|
|
|
sigcpp = dependency('sigc++-2.0')
|
2022-08-23 20:22:40 +02:00
|
|
|
libinotify = dependency('libinotify', required: false)
|
2019-08-09 11:52:16 +02:00
|
|
|
libepoll = dependency('epoll-shim', required: false)
|
2022-08-22 14:36:21 +02:00
|
|
|
libinput = dependency('libinput', required: get_option('libinput'))
|
2018-10-21 11:58:35 +02:00
|
|
|
libnl = dependency('libnl-3.0', required: get_option('libnl'))
|
|
|
|
libnlgen = dependency('libnl-genl-3.0', required: get_option('libnl'))
|
2022-03-15 17:54:06 +01:00
|
|
|
upower_glib = dependency('upower-glib', required: get_option('upower_glib'))
|
2021-11-01 19:17:29 +01:00
|
|
|
playerctl = dependency('playerctl', version : ['>=2.0.0'], required: get_option('mpris'))
|
2018-10-21 11:58:35 +02:00
|
|
|
libpulse = dependency('libpulse', required: get_option('pulseaudio'))
|
2019-02-19 05:11:18 +01:00
|
|
|
libudev = dependency('libudev', required: get_option('libudev'))
|
2021-02-07 21:05:11 +01:00
|
|
|
libevdev = dependency('libevdev', required: get_option('libevdev'))
|
2019-04-16 16:34:37 +02:00
|
|
|
libmpdclient = dependency('libmpdclient', required: get_option('mpd'))
|
2021-07-13 03:33:12 +02:00
|
|
|
xkbregistry = dependency('xkbregistry')
|
2022-02-09 08:53:52 +01:00
|
|
|
libjack = dependency('jack', required: get_option('jack'))
|
2022-11-16 21:23:12 +01:00
|
|
|
libwireplumber = dependency('wireplumber-0.4', required: get_option('wireplumber'))
|
2020-09-06 19:44:13 +02:00
|
|
|
|
|
|
|
libsndio = compiler.find_library('sndio', required: get_option('sndio'))
|
|
|
|
if libsndio.found()
|
|
|
|
if not compiler.has_function('sioctl_open', prefix: '#include <sndio.h>', dependencies: libsndio)
|
|
|
|
if get_option('sndio').enabled()
|
|
|
|
error('libsndio is too old, required >=1.7.0')
|
|
|
|
else
|
|
|
|
warning('libsndio is too old, required >=1.7.0')
|
|
|
|
libsndio = dependency('', required: false)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-08-18 03:12:20 +02:00
|
|
|
gtk_layer_shell = dependency('gtk-layer-shell-0',
|
|
|
|
required: get_option('gtk-layer-shell'),
|
|
|
|
fallback : ['gtk-layer-shell', 'gtk_layer_shell_dep'])
|
2019-09-07 19:57:35 +02:00
|
|
|
systemd = dependency('systemd', required: get_option('systemd'))
|
2023-01-17 02:30:06 +01:00
|
|
|
|
|
|
|
cpp_lib_chrono = compiler.compute_int('__cpp_lib_chrono', prefix : '#include <chrono>')
|
|
|
|
have_chrono_timezones = cpp_lib_chrono >= 201907
|
|
|
|
if have_chrono_timezones
|
|
|
|
tz_dep = declare_dependency()
|
|
|
|
else
|
|
|
|
tz_dep = dependency('date',
|
|
|
|
required: false,
|
|
|
|
default_options : [ 'use_system_tzdb=true' ],
|
|
|
|
modules : [ 'date::date', 'date::date-tz' ],
|
|
|
|
fallback: [ 'date', 'tz_dep' ])
|
|
|
|
endif
|
2019-09-07 19:57:35 +02:00
|
|
|
|
2019-09-10 14:12:52 +02:00
|
|
|
prefix = get_option('prefix')
|
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
2019-08-11 12:09:55 +02:00
|
|
|
sysconfdir = get_option('sysconfdir')
|
2019-09-08 14:04:34 +02:00
|
|
|
conf_data = configuration_data()
|
2019-09-10 14:12:52 +02:00
|
|
|
conf_data.set('prefix', prefix)
|
2019-09-08 14:04:34 +02:00
|
|
|
|
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
2019-08-11 12:09:55 +02:00
|
|
|
add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'cpp')
|
|
|
|
|
2019-09-07 19:57:35 +02:00
|
|
|
if systemd.found()
|
|
|
|
user_units_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
|
2019-09-08 14:04:34 +02:00
|
|
|
|
|
|
|
configure_file(
|
|
|
|
configuration: conf_data,
|
|
|
|
input: './resources/waybar.service.in',
|
|
|
|
output: '@BASENAME@',
|
|
|
|
install_dir: user_units_dir
|
|
|
|
)
|
2019-09-07 19:57:35 +02:00
|
|
|
endif
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2018-08-20 17:20:02 +02:00
|
|
|
src_files = files(
|
|
|
|
'src/factory.cpp',
|
2019-06-15 14:57:52 +02:00
|
|
|
'src/AModule.cpp',
|
2018-08-20 17:20:02 +02:00
|
|
|
'src/ALabel.cpp',
|
2021-10-17 20:08:16 +02:00
|
|
|
'src/AIconLabel.cpp',
|
2018-08-20 17:20:02 +02:00
|
|
|
'src/modules/custom.cpp',
|
2019-09-23 22:25:54 +02:00
|
|
|
'src/modules/disk.cpp',
|
2019-08-22 18:04:09 +02:00
|
|
|
'src/modules/idle_inhibitor.cpp',
|
2022-01-17 00:55:13 +01:00
|
|
|
'src/modules/image.cpp',
|
2019-03-13 13:18:08 +01:00
|
|
|
'src/modules/temperature.cpp',
|
2022-09-30 13:33:23 +02:00
|
|
|
'src/modules/user.cpp',
|
2018-08-20 17:20:02 +02:00
|
|
|
'src/main.cpp',
|
|
|
|
'src/bar.cpp',
|
2020-01-21 17:48:45 +01:00
|
|
|
'src/client.cpp',
|
2021-08-13 15:08:27 +02:00
|
|
|
'src/config.cpp',
|
2021-10-31 23:55:13 +01:00
|
|
|
'src/group.cpp',
|
2022-10-09 19:13:54 +02:00
|
|
|
'src/util/ustring_clen.cpp',
|
2022-10-19 13:25:08 +02:00
|
|
|
'src/util/sanitize_str.cpp',
|
2023-03-25 17:33:01 +01:00
|
|
|
'src/util/rewrite_string.cpp'
|
2018-08-20 17:20:02 +02:00
|
|
|
)
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2023-04-15 01:36:15 +02:00
|
|
|
inc_dirs = ['include']
|
|
|
|
|
2019-08-09 11:52:16 +02:00
|
|
|
if is_linux
|
2019-08-11 15:10:37 +02:00
|
|
|
add_project_arguments('-DHAVE_CPU_LINUX', language: 'cpp')
|
2019-08-09 12:40:33 +02:00
|
|
|
add_project_arguments('-DHAVE_MEMORY_LINUX', language: 'cpp')
|
2019-08-09 11:52:16 +02:00
|
|
|
src_files += files(
|
|
|
|
'src/modules/battery.cpp',
|
2019-08-11 15:10:37 +02:00
|
|
|
'src/modules/cpu/common.cpp',
|
|
|
|
'src/modules/cpu/linux.cpp',
|
2019-08-09 12:40:33 +02:00
|
|
|
'src/modules/memory/common.cpp',
|
|
|
|
'src/modules/memory/linux.cpp',
|
|
|
|
)
|
|
|
|
elif is_dragonfly or is_freebsd or is_netbsd or is_openbsd
|
2019-08-11 15:10:37 +02:00
|
|
|
add_project_arguments('-DHAVE_CPU_BSD', language: 'cpp')
|
2019-08-09 12:40:33 +02:00
|
|
|
add_project_arguments('-DHAVE_MEMORY_BSD', language: 'cpp')
|
|
|
|
src_files += files(
|
2019-08-11 15:10:37 +02:00
|
|
|
'src/modules/cpu/bsd.cpp',
|
|
|
|
'src/modules/cpu/common.cpp',
|
2019-08-09 12:40:33 +02:00
|
|
|
'src/modules/memory/bsd.cpp',
|
|
|
|
'src/modules/memory/common.cpp',
|
2019-08-09 11:52:16 +02:00
|
|
|
)
|
2022-09-30 21:59:27 +02:00
|
|
|
if is_freebsd
|
|
|
|
src_files += files(
|
|
|
|
'src/modules/battery.cpp',
|
|
|
|
)
|
|
|
|
endif
|
2019-08-09 11:52:16 +02:00
|
|
|
endif
|
|
|
|
|
2020-06-24 13:28:27 +02:00
|
|
|
add_project_arguments('-DHAVE_SWAY', language: 'cpp')
|
|
|
|
src_files += [
|
|
|
|
'src/modules/sway/ipc/client.cpp',
|
2020-10-20 04:34:48 +02:00
|
|
|
'src/modules/sway/bar.cpp',
|
2020-06-24 13:28:27 +02:00
|
|
|
'src/modules/sway/mode.cpp',
|
2020-10-10 18:09:18 +02:00
|
|
|
'src/modules/sway/language.cpp',
|
2020-06-24 13:28:27 +02:00
|
|
|
'src/modules/sway/window.cpp',
|
2022-08-28 22:55:48 +02:00
|
|
|
'src/modules/sway/workspaces.cpp',
|
|
|
|
'src/modules/sway/scratchpad.cpp'
|
2020-06-24 13:28:27 +02:00
|
|
|
]
|
2018-08-20 17:20:02 +02:00
|
|
|
|
2020-05-30 12:07:38 +02:00
|
|
|
if true
|
|
|
|
add_project_arguments('-DHAVE_WLR', language: 'cpp')
|
|
|
|
src_files += 'src/modules/wlr/taskbar.cpp'
|
2020-08-05 22:10:08 +02:00
|
|
|
src_files += 'src/modules/wlr/workspace_manager.cpp'
|
|
|
|
src_files += 'src/modules/wlr/workspace_manager_binding.cpp'
|
2020-05-30 12:07:38 +02:00
|
|
|
endif
|
|
|
|
|
2020-06-06 15:41:37 +02:00
|
|
|
if true
|
|
|
|
add_project_arguments('-DHAVE_RIVER', language: 'cpp')
|
2022-05-31 22:28:09 +02:00
|
|
|
src_files += 'src/modules/river/mode.cpp'
|
2020-06-06 15:41:37 +02:00
|
|
|
src_files += 'src/modules/river/tags.cpp'
|
2022-05-19 22:33:50 +02:00
|
|
|
src_files += 'src/modules/river/window.cpp'
|
2023-01-31 06:34:38 +01:00
|
|
|
src_files += 'src/modules/river/layout.cpp'
|
2020-06-06 15:41:37 +02:00
|
|
|
endif
|
|
|
|
|
2023-04-11 03:50:21 +02:00
|
|
|
if true
|
|
|
|
add_project_arguments('-DHAVE_DWL', language: 'cpp')
|
|
|
|
src_files += 'src/modules/dwl/tags.cpp'
|
2020-06-06 15:41:37 +02:00
|
|
|
endif
|
|
|
|
|
2022-07-01 12:46:28 +02:00
|
|
|
if true
|
|
|
|
add_project_arguments('-DHAVE_HYPRLAND', language: 'cpp')
|
|
|
|
src_files += 'src/modules/hyprland/backend.cpp'
|
|
|
|
src_files += 'src/modules/hyprland/window.cpp'
|
2022-08-18 18:00:27 +02:00
|
|
|
src_files += 'src/modules/hyprland/language.cpp'
|
2022-12-21 01:45:57 +01:00
|
|
|
src_files += 'src/modules/hyprland/submap.cpp'
|
2022-07-01 12:46:28 +02:00
|
|
|
endif
|
|
|
|
|
2018-08-20 17:20:02 +02:00
|
|
|
if libnl.found() and libnlgen.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBNL', language: 'cpp')
|
|
|
|
src_files += 'src/modules/network.cpp'
|
|
|
|
endif
|
|
|
|
|
2022-05-13 21:30:45 +02:00
|
|
|
if (giounix.found() and not get_option('logind').disabled())
|
|
|
|
add_project_arguments('-DHAVE_GAMEMODE', language: 'cpp')
|
|
|
|
src_files += 'src/modules/gamemode.cpp'
|
|
|
|
endif
|
|
|
|
|
2022-03-15 22:49:40 +01:00
|
|
|
if (upower_glib.found() and giounix.found() and not get_option('logind').disabled())
|
2022-03-15 17:54:06 +01:00
|
|
|
add_project_arguments('-DHAVE_UPOWER', language: 'cpp')
|
2022-03-19 11:34:34 +01:00
|
|
|
src_files += 'src/modules/upower/upower.cpp'
|
2022-03-19 17:09:55 +01:00
|
|
|
src_files += 'src/modules/upower/upower_tooltip.cpp'
|
2022-03-15 17:54:06 +01:00
|
|
|
endif
|
|
|
|
|
2021-11-01 19:17:29 +01:00
|
|
|
if (playerctl.found() and giounix.found() and not get_option('logind').disabled())
|
|
|
|
add_project_arguments('-DHAVE_MPRIS', language: 'cpp')
|
|
|
|
src_files += 'src/modules/mpris/mpris.cpp'
|
|
|
|
endif
|
|
|
|
|
2018-08-20 17:20:02 +02:00
|
|
|
if libpulse.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBPULSE', language: 'cpp')
|
|
|
|
src_files += 'src/modules/pulseaudio.cpp'
|
|
|
|
endif
|
|
|
|
|
2022-07-20 01:27:39 +02:00
|
|
|
if libjack.found()
|
2022-02-09 08:53:52 +01:00
|
|
|
add_project_arguments('-DHAVE_LIBJACK', language: 'cpp')
|
|
|
|
src_files += 'src/modules/jack.cpp'
|
|
|
|
endif
|
|
|
|
|
2022-11-16 21:23:12 +01:00
|
|
|
if libwireplumber.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBWIREPLUMBER', language: 'cpp')
|
|
|
|
src_files += 'src/modules/wireplumber.cpp'
|
|
|
|
endif
|
|
|
|
|
2018-10-25 11:47:03 +02:00
|
|
|
if dbusmenu_gtk.found()
|
|
|
|
add_project_arguments('-DHAVE_DBUSMENU', language: 'cpp')
|
|
|
|
src_files += files(
|
|
|
|
'src/modules/sni/tray.cpp',
|
2018-11-22 15:47:23 +01:00
|
|
|
'src/modules/sni/watcher.cpp',
|
|
|
|
'src/modules/sni/host.cpp',
|
|
|
|
'src/modules/sni/item.cpp'
|
2018-10-25 11:47:03 +02:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2019-08-09 11:52:16 +02:00
|
|
|
if libudev.found() and (is_linux or libepoll.found())
|
2019-02-19 05:11:18 +01:00
|
|
|
add_project_arguments('-DHAVE_LIBUDEV', language: 'cpp')
|
|
|
|
src_files += 'src/modules/backlight.cpp'
|
|
|
|
endif
|
|
|
|
|
2022-08-23 20:22:40 +02:00
|
|
|
if libevdev.found() and (is_linux or libepoll.found()) and libinput.found() and (is_linux or libinotify.found())
|
2021-02-07 21:05:11 +01:00
|
|
|
add_project_arguments('-DHAVE_LIBEVDEV', language: 'cpp')
|
2022-08-22 14:36:21 +02:00
|
|
|
add_project_arguments('-DHAVE_LIBINPUT', language: 'cpp')
|
2021-02-07 21:05:11 +01:00
|
|
|
src_files += 'src/modules/keyboard_state.cpp'
|
|
|
|
endif
|
|
|
|
|
2019-04-16 16:34:37 +02:00
|
|
|
if libmpdclient.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBMPDCLIENT', language: 'cpp')
|
2020-10-04 07:01:51 +02:00
|
|
|
src_files += 'src/modules/mpd/mpd.cpp'
|
|
|
|
src_files += 'src/modules/mpd/state.cpp'
|
2019-04-16 16:34:37 +02:00
|
|
|
endif
|
|
|
|
|
2019-08-18 03:12:20 +02:00
|
|
|
if gtk_layer_shell.found()
|
|
|
|
add_project_arguments('-DHAVE_GTK_LAYER_SHELL', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2020-09-06 19:44:13 +02:00
|
|
|
if libsndio.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBSNDIO', language: 'cpp')
|
|
|
|
src_files += 'src/modules/sndio.cpp'
|
|
|
|
endif
|
|
|
|
|
2021-12-03 23:32:53 +01:00
|
|
|
if (giounix.found() and not get_option('logind').disabled())
|
|
|
|
add_project_arguments('-DHAVE_GIO_UNIX', language: 'cpp')
|
|
|
|
src_files += 'src/modules/inhibitor.cpp'
|
2022-05-02 18:11:21 +02:00
|
|
|
src_files += 'src/modules/bluetooth.cpp'
|
2021-12-03 23:32:53 +01:00
|
|
|
endif
|
|
|
|
|
2022-05-02 18:11:21 +02:00
|
|
|
if get_option('rfkill').enabled() and is_linux
|
|
|
|
add_project_arguments('-DWANT_RFKILL', language: 'cpp')
|
|
|
|
src_files += files(
|
|
|
|
'src/util/rfkill.cpp'
|
|
|
|
)
|
2020-08-14 20:56:45 +02:00
|
|
|
endif
|
|
|
|
|
2023-01-17 02:30:06 +01:00
|
|
|
if have_chrono_timezones
|
|
|
|
add_project_arguments('-DHAVE_CHRONO_TIMEZONES', language: 'cpp')
|
|
|
|
src_files += 'src/modules/clock.cpp'
|
|
|
|
elif tz_dep.found()
|
2020-10-10 14:09:55 +02:00
|
|
|
add_project_arguments('-DHAVE_LIBDATE', language: 'cpp')
|
|
|
|
src_files += 'src/modules/clock.cpp'
|
|
|
|
else
|
|
|
|
src_files += 'src/modules/simpleclock.cpp'
|
|
|
|
endif
|
|
|
|
|
2021-11-27 23:12:35 +01:00
|
|
|
if get_option('experimental')
|
|
|
|
add_project_arguments('-DUSE_EXPERIMENTAL', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2023-04-15 01:36:15 +02:00
|
|
|
cava = compiler.find_library('cava',
|
|
|
|
required: get_option('cava'))
|
|
|
|
if not cava.found() and not get_option('cava').disabled()
|
|
|
|
cava = dependency('cava',
|
|
|
|
required: false,
|
|
|
|
fallback: [ 'cava', 'cava_dep' ])
|
|
|
|
endif
|
|
|
|
|
|
|
|
if cava.found()
|
|
|
|
add_project_arguments('-DHAVE_LIBCAVA', language: 'cpp')
|
|
|
|
src_files += 'src/modules/cava.cpp'
|
|
|
|
endif
|
|
|
|
|
2018-08-20 17:20:02 +02:00
|
|
|
subdir('protocol')
|
2018-08-16 14:29:41 +02:00
|
|
|
|
2018-08-08 23:54:58 +02:00
|
|
|
executable(
|
|
|
|
'waybar',
|
2018-08-16 14:29:41 +02:00
|
|
|
src_files,
|
2018-08-08 23:54:58 +02:00
|
|
|
dependencies: [
|
|
|
|
thread_dep,
|
|
|
|
client_protos,
|
|
|
|
wayland_client,
|
|
|
|
fmt,
|
2019-05-19 01:44:45 +02:00
|
|
|
spdlog,
|
2018-08-08 23:54:58 +02:00
|
|
|
sigcpp,
|
|
|
|
jsoncpp,
|
|
|
|
wayland_cursor,
|
|
|
|
gtkmm,
|
2018-10-04 18:03:01 +02:00
|
|
|
dbusmenu_gtk,
|
2018-10-27 08:19:58 +02:00
|
|
|
giounix,
|
2022-08-22 14:36:21 +02:00
|
|
|
libinput,
|
2018-08-09 16:38:24 +02:00
|
|
|
libnl,
|
|
|
|
libnlgen,
|
2022-03-15 17:54:06 +01:00
|
|
|
upower_glib,
|
2021-11-01 19:17:29 +01:00
|
|
|
playerctl,
|
2019-02-10 10:35:19 +01:00
|
|
|
libpulse,
|
2022-02-09 08:53:52 +01:00
|
|
|
libjack,
|
2022-11-16 21:23:12 +01:00
|
|
|
libwireplumber,
|
2019-04-16 16:34:37 +02:00
|
|
|
libudev,
|
2022-08-23 20:22:40 +02:00
|
|
|
libinotify,
|
2019-08-09 11:52:16 +02:00
|
|
|
libepoll,
|
2019-08-18 03:12:20 +02:00
|
|
|
libmpdclient,
|
2021-02-07 21:05:11 +01:00
|
|
|
libevdev,
|
2020-01-21 00:47:15 +01:00
|
|
|
gtk_layer_shell,
|
2020-09-06 19:44:13 +02:00
|
|
|
libsndio,
|
2021-07-13 03:33:12 +02:00
|
|
|
tz_dep,
|
2023-04-15 01:36:15 +02:00
|
|
|
xkbregistry,
|
|
|
|
cava
|
2018-08-08 23:54:58 +02:00
|
|
|
],
|
2023-04-15 01:36:15 +02:00
|
|
|
include_directories: inc_dirs,
|
2018-08-08 23:54:58 +02:00
|
|
|
install: true,
|
|
|
|
)
|
2018-08-09 17:02:30 +02:00
|
|
|
|
|
|
|
install_data(
|
|
|
|
'./resources/config',
|
|
|
|
'./resources/style.css',
|
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
2019-08-11 12:09:55 +02:00
|
|
|
install_dir: sysconfdir + '/xdg/waybar'
|
2018-08-09 17:02:30 +02:00
|
|
|
)
|
2018-08-16 14:29:41 +02:00
|
|
|
|
2019-08-29 12:25:04 +02:00
|
|
|
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
|
2019-08-22 18:04:09 +02:00
|
|
|
|
|
|
|
if scdoc.found()
|
|
|
|
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
|
|
|
sh = find_program('sh', native: true)
|
2020-09-29 22:31:28 +02:00
|
|
|
|
|
|
|
main_manpage = configure_file(
|
|
|
|
input: 'man/waybar.5.scd.in',
|
|
|
|
output: 'waybar.5.scd',
|
|
|
|
configuration: {
|
|
|
|
'sysconfdir': join_paths(prefix, sysconfdir)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
main_manpage_path = join_paths(meson.build_root(), '@0@'.format(main_manpage))
|
|
|
|
|
2019-08-22 18:04:09 +02:00
|
|
|
mandir = get_option('mandir')
|
|
|
|
man_files = [
|
2020-09-29 22:31:28 +02:00
|
|
|
main_manpage_path,
|
2019-08-24 16:39:46 +02:00
|
|
|
'waybar-backlight.5.scd',
|
2019-08-24 18:44:29 +02:00
|
|
|
'waybar-battery.5.scd',
|
2019-08-26 14:31:57 +02:00
|
|
|
'waybar-clock.5.scd',
|
2019-08-26 14:23:11 +02:00
|
|
|
'waybar-cpu.5.scd',
|
2019-08-26 14:42:59 +02:00
|
|
|
'waybar-custom.5.scd',
|
2019-09-25 09:07:46 +02:00
|
|
|
'waybar-disk.5.scd',
|
2022-05-23 14:13:30 +02:00
|
|
|
'waybar-gamemode.5.scd',
|
2019-08-26 16:06:20 +02:00
|
|
|
'waybar-idle-inhibitor.5.scd',
|
2023-01-22 13:16:46 +01:00
|
|
|
'waybar-image.5.scd',
|
2021-04-15 23:41:15 +02:00
|
|
|
'waybar-keyboard-state.5.scd',
|
2019-08-26 16:12:42 +02:00
|
|
|
'waybar-memory.5.scd',
|
2019-08-26 16:23:07 +02:00
|
|
|
'waybar-mpd.5.scd',
|
2021-11-01 19:17:29 +01:00
|
|
|
'waybar-mpris.5.scd',
|
2019-08-26 18:42:30 +02:00
|
|
|
'waybar-network.5.scd',
|
2019-08-26 18:50:16 +02:00
|
|
|
'waybar-pulseaudio.5.scd',
|
2022-05-31 22:28:09 +02:00
|
|
|
'waybar-river-mode.5.scd',
|
2020-06-06 15:41:37 +02:00
|
|
|
'waybar-river-tags.5.scd',
|
2022-05-19 22:41:05 +02:00
|
|
|
'waybar-river-window.5.scd',
|
2023-01-31 06:34:38 +01:00
|
|
|
'waybar-river-layout.5.scd',
|
2021-03-17 15:07:06 +01:00
|
|
|
'waybar-sway-language.5.scd',
|
2019-08-26 18:55:20 +02:00
|
|
|
'waybar-sway-mode.5.scd',
|
2022-08-30 20:27:30 +02:00
|
|
|
'waybar-sway-scratchpad.5.scd',
|
2019-08-26 19:00:46 +02:00
|
|
|
'waybar-sway-window.5.scd',
|
2019-08-26 19:08:06 +02:00
|
|
|
'waybar-sway-workspaces.5.scd',
|
2019-08-26 19:13:48 +02:00
|
|
|
'waybar-temperature.5.scd',
|
2019-08-26 19:15:58 +02:00
|
|
|
'waybar-tray.5.scd',
|
2019-08-26 23:49:04 +02:00
|
|
|
'waybar-states.5.scd',
|
2020-05-30 12:07:38 +02:00
|
|
|
'waybar-wlr-taskbar.5.scd',
|
2020-08-07 23:09:35 +02:00
|
|
|
'waybar-wlr-workspaces.5.scd',
|
2020-04-28 17:40:44 +02:00
|
|
|
'waybar-bluetooth.5.scd',
|
2020-09-06 19:44:13 +02:00
|
|
|
'waybar-sndio.5.scd',
|
2022-03-25 14:53:46 +01:00
|
|
|
'waybar-upower.5.scd',
|
2023-04-11 07:09:01 +02:00
|
|
|
'waybar-wireplumber.5.scd',
|
2023-04-17 09:07:59 +02:00
|
|
|
'waybar-dwl-tags.5.scd',
|
2019-08-22 18:04:09 +02:00
|
|
|
]
|
|
|
|
|
2021-12-14 08:15:44 +01:00
|
|
|
if (giounix.found() and not get_option('logind').disabled())
|
|
|
|
man_files += 'waybar-inhibitor.5.scd'
|
|
|
|
endif
|
|
|
|
|
2020-09-29 22:31:28 +02:00
|
|
|
foreach file : man_files
|
|
|
|
path = '@0@'.format(file)
|
2020-11-27 00:31:40 +01:00
|
|
|
basename = path.split('/')[-1]
|
2020-09-29 22:31:28 +02:00
|
|
|
|
2020-11-27 00:31:40 +01:00
|
|
|
topic = basename.split('.')[-3]
|
2020-09-29 22:31:28 +02:00
|
|
|
section = basename.split('.')[-2]
|
2019-08-22 18:04:09 +02:00
|
|
|
output = '@0@.@1@'.format(topic, section)
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
output,
|
2020-09-29 22:31:28 +02:00
|
|
|
# drops the 'man' if `path` is an absolute path
|
|
|
|
input: join_paths('man', path),
|
2019-08-22 18:04:09 +02:00
|
|
|
output: output,
|
|
|
|
command: [
|
|
|
|
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
|
|
|
|
],
|
|
|
|
install: true,
|
|
|
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2021-08-14 03:33:24 +02:00
|
|
|
catch2 = dependency(
|
|
|
|
'catch2',
|
2023-01-16 20:04:56 +01:00
|
|
|
version: '>=2.0.0',
|
2021-08-14 03:33:24 +02:00
|
|
|
fallback: ['catch2', 'catch2_dep'],
|
|
|
|
required: get_option('tests'),
|
|
|
|
)
|
|
|
|
if catch2.found()
|
|
|
|
subdir('test')
|
|
|
|
endif
|
|
|
|
|
2018-08-16 14:29:41 +02:00
|
|
|
clangtidy = find_program('clang-tidy', required: false)
|
|
|
|
|
|
|
|
if clangtidy.found()
|
|
|
|
run_target(
|
|
|
|
'tidy',
|
|
|
|
command: [
|
|
|
|
clangtidy,
|
|
|
|
'-checks=*,-fuchsia-default-arguments',
|
|
|
|
'-p', meson.build_root()
|
|
|
|
] + src_files)
|
|
|
|
endif
|
2021-11-27 23:12:35 +01:00
|
|
|
|