forked from external/yambar
meson: make ‘removables’ plugin compile time optional
This commit is contained in:
parent
b901ac50ee
commit
eb26f64ea7
4 changed files with 17 additions and 4 deletions
|
@ -144,6 +144,7 @@ yambar = executable(
|
||||||
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
plugin_i3_enabled ? '-DPLUGIN_ENABLED_I3' : [],
|
||||||
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
plugin_label_enabled ? '-DPLUGIN_ENABLED_LABEL' : [],
|
||||||
plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [],
|
plugin_network_enabled ? '-DPLUGIN_ENABLED_NETWORK' : [],
|
||||||
|
plugin_removables_enabled ? '-DPLUGIN_ENABLED_REMOVABLES' : [],
|
||||||
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
plugin_pipewire_enabled ? '-DPLUGIN_ENABLED_PIPEWIRE' : [],
|
||||||
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
plugin_pulse_enabled ? '-DPLUGIN_ENABLED_PULSE' : [],
|
||||||
],
|
],
|
||||||
|
@ -196,6 +197,7 @@ summary(
|
||||||
'i3+Sway': plugin_i3_enabled,
|
'i3+Sway': plugin_i3_enabled,
|
||||||
'Label': plugin_label_enabled,
|
'Label': plugin_label_enabled,
|
||||||
'Network monitoring': plugin_network_enabled,
|
'Network monitoring': plugin_network_enabled,
|
||||||
|
'Removables monitoring': plugin_removables_enabled,
|
||||||
'Pipewire': plugin_pipewire_enabled,
|
'Pipewire': plugin_pipewire_enabled,
|
||||||
'PulseAudio': plugin_pulse_enabled,
|
'PulseAudio': plugin_pulse_enabled,
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,6 +30,8 @@ option('plugin-label', type: 'feature', value: 'auto',
|
||||||
description: 'Label support')
|
description: 'Label support')
|
||||||
option('plugin-network', type: 'feature', value: 'auto',
|
option('plugin-network', type: 'feature', value: 'auto',
|
||||||
description: 'Network monitoring support')
|
description: 'Network monitoring support')
|
||||||
|
option('plugin-removables', type: 'feature', value: 'auto',
|
||||||
|
description: 'Removables (USB sticks, CD-ROM etc) monitoring support')
|
||||||
option('plugin-pipewire', type: 'feature', value: 'auto',
|
option('plugin-pipewire', type: 'feature', value: 'auto',
|
||||||
description: 'Pipewire support')
|
description: 'Pipewire support')
|
||||||
option('plugin-pulse', type: 'feature', value: 'auto',
|
option('plugin-pulse', type: 'feature', value: 'auto',
|
||||||
|
|
|
@ -2,7 +2,6 @@ module_sdk = declare_dependency(dependencies: [pixman, threads, tllist, fcft])
|
||||||
|
|
||||||
modules = []
|
modules = []
|
||||||
|
|
||||||
udev = dependency('udev')
|
|
||||||
json = dependency('json-c')
|
json = dependency('json-c')
|
||||||
xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
|
xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
|
||||||
|
|
||||||
|
@ -30,6 +29,9 @@ plugin_i3_enabled = json_i3.found()
|
||||||
plugin_label_enabled = get_option('plugin-label').allowed()
|
plugin_label_enabled = get_option('plugin-label').allowed()
|
||||||
plugin_network_enabled = get_option('plugin-network').allowed()
|
plugin_network_enabled = get_option('plugin-network').allowed()
|
||||||
|
|
||||||
|
udev_removables = dependency('udev', required: get_option('plugin-removables'))
|
||||||
|
plugin_removables_enabled = udev_removables.found()
|
||||||
|
|
||||||
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
pipewire = dependency('libpipewire-0.3', required: get_option('plugin-pipewire'))
|
||||||
plugin_pipewire_enabled = pipewire.found()
|
plugin_pipewire_enabled = pipewire.found()
|
||||||
|
|
||||||
|
@ -40,7 +42,6 @@ plugin_dwl_enabled = get_option('plugin-dwl').allowed()
|
||||||
|
|
||||||
# Module name -> (source-list, dep-list)
|
# Module name -> (source-list, dep-list)
|
||||||
mod_data = {
|
mod_data = {
|
||||||
'removables': [[], [dynlist, udev]],
|
|
||||||
'script': [[], []],
|
'script': [[], []],
|
||||||
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
'sway-xkb': [['i3-common.c', 'i3-common.h'], [dynlist, json]],
|
||||||
}
|
}
|
||||||
|
@ -93,6 +94,10 @@ if plugin_network_enabled
|
||||||
mod_data += {'network': [[], []]}
|
mod_data += {'network': [[], []]}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if plugin_removables_enabled
|
||||||
|
mod_data += {'removables': [[], [dynlist, udev_removables]]}
|
||||||
|
endif
|
||||||
|
|
||||||
if plugin_pipewire_enabled
|
if plugin_pipewire_enabled
|
||||||
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
mod_data += {'pipewire': [[], [pipewire, dynlist, json]]}
|
||||||
endif
|
endif
|
||||||
|
|
8
plugin.c
8
plugin.c
|
@ -69,13 +69,15 @@ EXTERN_MODULE(label);
|
||||||
#if defined(PLUGIN_ENABLED_NETWORK)
|
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||||
EXTERN_MODULE(network);
|
EXTERN_MODULE(network);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||||
|
EXTERN_MODULE(removables);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PULSE)
|
#if defined(PLUGIN_ENABLED_PULSE)
|
||||||
EXTERN_MODULE(pulse);
|
EXTERN_MODULE(pulse);
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||||
EXTERN_MODULE(pipewire);
|
EXTERN_MODULE(pipewire);
|
||||||
#endif
|
#endif
|
||||||
EXTERN_MODULE(removables);
|
|
||||||
EXTERN_MODULE(river);
|
EXTERN_MODULE(river);
|
||||||
EXTERN_MODULE(sway_xkb);
|
EXTERN_MODULE(sway_xkb);
|
||||||
EXTERN_MODULE(script);
|
EXTERN_MODULE(script);
|
||||||
|
@ -183,13 +185,15 @@ init(void)
|
||||||
#if defined(PLUGIN_ENABLED_NETWORK)
|
#if defined(PLUGIN_ENABLED_NETWORK)
|
||||||
REGISTER_CORE_MODULE(network, network);
|
REGISTER_CORE_MODULE(network, network);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PLUGIN_ENABLED_REMOVABLES)
|
||||||
|
REGISTER_CORE_MODULE(removables, removables);
|
||||||
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PULSE)
|
#if defined(PLUGIN_ENABLED_PULSE)
|
||||||
REGISTER_CORE_MODULE(pulse, pulse);
|
REGISTER_CORE_MODULE(pulse, pulse);
|
||||||
#endif
|
#endif
|
||||||
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
#if defined(PLUGIN_ENABLED_PIPEWIRE)
|
||||||
REGISTER_CORE_MODULE(pipewire, pipewire);
|
REGISTER_CORE_MODULE(pipewire, pipewire);
|
||||||
#endif
|
#endif
|
||||||
REGISTER_CORE_MODULE(removables, removables);
|
|
||||||
#if defined(HAVE_PLUGIN_river)
|
#if defined(HAVE_PLUGIN_river)
|
||||||
REGISTER_CORE_MODULE(river, river);
|
REGISTER_CORE_MODULE(river, river);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue