Add meson_option to build without PulseAudio Widget (#297)
This commit is contained in:
@@ -224,8 +224,10 @@ config file to be able to detect config errors
|
|||||||
optional: true ++
|
optional: true ++
|
||||||
*buttons-grid*++
|
*buttons-grid*++
|
||||||
optional: true ++
|
optional: true ++
|
||||||
|
#START pulse-audio
|
||||||
*volume*++
|
*volume*++
|
||||||
optional: true ++
|
optional: true ++
|
||||||
|
#END pulse-audio
|
||||||
*backlight*++
|
*backlight*++
|
||||||
optional: true ++
|
optional: true ++
|
||||||
*inhibitors*++
|
*inhibitors*++
|
||||||
@@ -415,6 +417,7 @@ config file to be able to detect config errors
|
|||||||
description: "Command to be executed on click" ++
|
description: "Command to be executed on click" ++
|
||||||
description: A list of actions containing a label and a command ++
|
description: A list of actions containing a label and a command ++
|
||||||
description: A grid of buttons that execute shell commands ++
|
description: A grid of buttons that execute shell commands ++
|
||||||
|
#START pulse-audio
|
||||||
*volume*++
|
*volume*++
|
||||||
type: object ++
|
type: object ++
|
||||||
css class: ++
|
css class: ++
|
||||||
@@ -463,6 +466,7 @@ config file to be able to detect config errors
|
|||||||
default: 250 ++
|
default: 250 ++
|
||||||
description: Duration of animation in milliseconds ++
|
description: Duration of animation in milliseconds ++
|
||||||
description: Slider to control pulse volume ++
|
description: Slider to control pulse volume ++
|
||||||
|
#END pulse-audio
|
||||||
*backlight*++
|
*backlight*++
|
||||||
type: object ++
|
type: object ++
|
||||||
css class: widget-backlight ++
|
css class: widget-backlight ++
|
||||||
@@ -565,8 +569,9 @@ config file to be able to detect config errors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
#START scripting
|
||||||
|
|
||||||
# IF BUILT WITH SCRIPTING
|
# Scripts
|
||||||
|
|
||||||
*script-fail-notify* ++
|
*script-fail-notify* ++
|
||||||
type: bool ++
|
type: bool ++
|
||||||
@@ -646,3 +651,4 @@ SWAYNC_REPLACES_ID="ID of notification to replace"
|
|||||||
SWAYNC_ID="SwayNC notification ID"
|
SWAYNC_ID="SwayNC notification ID"
|
||||||
SWAYNC_SUMMARY="Notification summary"
|
SWAYNC_SUMMARY="Notification summary"
|
||||||
```
|
```
|
||||||
|
#END scripting
|
||||||
|
36
meson.build
36
meson.build
@@ -98,9 +98,22 @@ endif
|
|||||||
# Man pages
|
# Man pages
|
||||||
if get_option('man-pages')
|
if get_option('man-pages')
|
||||||
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: true)
|
scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: true)
|
||||||
if scdoc.found()
|
sed = find_program(['sed', '/usr/bin/sed'], required : true)
|
||||||
|
if scdoc.found() and sed.found()
|
||||||
scdoc_prog = find_program(scdoc.get_variable(pkgconfig :'scdoc'), native: true)
|
scdoc_prog = find_program(scdoc.get_variable(pkgconfig :'scdoc'), native: true)
|
||||||
|
|
||||||
|
# Remove parts of man page if necessary
|
||||||
|
sed_command = []
|
||||||
|
foreach option : ['pulse-audio', 'scripting']
|
||||||
|
if get_option(option) == false
|
||||||
|
# Removes all lines between the #START and #END lines (inclusive)
|
||||||
|
sed_command += ['-e', '/#START @0@/,/#END @0@/d'.format(option)]
|
||||||
|
else
|
||||||
|
# Removes the #START and #END lines
|
||||||
|
sed_command += ['-e', '/#START @0@/d;/#END @0@/d'.format(option)]
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
mandir = get_option('mandir')
|
mandir = get_option('mandir')
|
||||||
man_files = [
|
man_files = [
|
||||||
'swaync.1.scd',
|
'swaync.1.scd',
|
||||||
@@ -111,17 +124,36 @@ if get_option('man-pages')
|
|||||||
foreach filename : man_files
|
foreach filename : man_files
|
||||||
topic = filename.split('.')[-3].split('/')[-1]
|
topic = filename.split('.')[-3].split('/')[-1]
|
||||||
section = filename.split('.')[-2]
|
section = filename.split('.')[-2]
|
||||||
|
input = join_paths('man', filename)
|
||||||
output = '@0@.@1@'.format(topic, section)
|
output = '@0@.@1@'.format(topic, section)
|
||||||
message(mandir, section, '@0@/man@1@'.format(mandir, section))
|
message(mandir, section, '@0@/man@1@'.format(mandir, section))
|
||||||
|
|
||||||
|
# Remove parts of man page if necessary
|
||||||
|
if sed_command.length() > 0
|
||||||
|
output_stripped = '.stripped-@0@.@1@'.format(topic, section)
|
||||||
|
input = custom_target(
|
||||||
|
output_stripped,
|
||||||
|
input: input,
|
||||||
|
output: output_stripped,
|
||||||
|
command: [sed, sed_command],
|
||||||
|
install: false,
|
||||||
|
feed: true,
|
||||||
|
capture: true,
|
||||||
|
build_by_default: true,
|
||||||
|
build_always_stale: true
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
custom_target(
|
custom_target(
|
||||||
output,
|
output,
|
||||||
input: join_paths('man', filename),
|
input: input,
|
||||||
output: output,
|
output: output,
|
||||||
command: scdoc_prog,
|
command: scdoc_prog,
|
||||||
install: true,
|
install: true,
|
||||||
feed: true,
|
feed: true,
|
||||||
capture: true,
|
capture: true,
|
||||||
|
build_by_default: true,
|
||||||
|
build_always_stale: true,
|
||||||
install_dir: '@0@/man@1@'.format(mandir, section)
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
||||||
)
|
)
|
||||||
endforeach
|
endforeach
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
option('systemd-service', type: 'boolean', value: true, description: 'Install systemd user service unit.')
|
option('systemd-service', type: 'boolean', value: true, description: 'Install systemd user service unit.')
|
||||||
option('scripting', type: 'boolean', value: true, description: 'Enable notification scripting.')
|
option('scripting', type: 'boolean', value: true, description: 'Enable notification scripting.')
|
||||||
|
option('pulse-audio', type: 'boolean', value: true, description: 'Provide PulseAudio Widget.')
|
||||||
option('man-pages', type: 'boolean', value: true, description: 'Install all man pages.')
|
option('man-pages', type: 'boolean', value: true, description: 'Install all man pages.')
|
||||||
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
|
||||||
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
||||||
|
@@ -26,9 +26,11 @@ namespace SwayNotificationCenter.Widgets {
|
|||||||
case "buttons-grid":
|
case "buttons-grid":
|
||||||
widget = new ButtonsGrid (suffix, swaync_daemon, noti_daemon);
|
widget = new ButtonsGrid (suffix, swaync_daemon, noti_daemon);
|
||||||
break;
|
break;
|
||||||
|
#if HAVE_PULSE_AUDIO
|
||||||
case "volume":
|
case "volume":
|
||||||
widget = new Volume (suffix, swaync_daemon, noti_daemon);
|
widget = new Volume (suffix, swaync_daemon, noti_daemon);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case "backlight":
|
case "backlight":
|
||||||
widget = new Backlight (suffix, swaync_daemon, noti_daemon);
|
widget = new Backlight (suffix, swaync_daemon, noti_daemon);
|
||||||
break;
|
break;
|
||||||
|
@@ -40,12 +40,6 @@ widget_sources = [
|
|||||||
'controlCenter/widgets/menubar/menubar.vala',
|
'controlCenter/widgets/menubar/menubar.vala',
|
||||||
# Widget: Buttons Grid
|
# Widget: Buttons Grid
|
||||||
'controlCenter/widgets/buttonsGrid/buttonsGrid.vala',
|
'controlCenter/widgets/buttonsGrid/buttonsGrid.vala',
|
||||||
# Widget: Volume
|
|
||||||
'controlCenter/widgets/volume/volume.vala',
|
|
||||||
'controlCenter/widgets/volume/pulseDaemon.vala',
|
|
||||||
'controlCenter/widgets/volume/pulseDevice.vala',
|
|
||||||
'controlCenter/widgets/volume/pulseSinkInput.vala',
|
|
||||||
'controlCenter/widgets/volume/sinkInputRow.vala',
|
|
||||||
# Widget: Backlight Slider
|
# Widget: Backlight Slider
|
||||||
'controlCenter/widgets/backlight/backlight.vala',
|
'controlCenter/widgets/backlight/backlight.vala',
|
||||||
'controlCenter/widgets/backlight/backlightUtil.vala',
|
'controlCenter/widgets/backlight/backlightUtil.vala',
|
||||||
@@ -79,19 +73,34 @@ app_deps = [
|
|||||||
meson.get_compiler('c').find_library('m', required : true),
|
meson.get_compiler('c').find_library('m', required : true),
|
||||||
meson.get_compiler('vala').find_library('posix'),
|
meson.get_compiler('vala').find_library('posix'),
|
||||||
dependency('gee-0.8'),
|
dependency('gee-0.8'),
|
||||||
dependency('libpulse'),
|
|
||||||
dependency('libpulse-mainloop-glib'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Checks if the user wants scripting enabled
|
# Checks if the user wants scripting enabled
|
||||||
if get_option('scripting')
|
if get_option('scripting')
|
||||||
add_project_arguments('-D', 'WANT_SCRIPTING', language: 'vala')
|
add_project_arguments('-D', 'WANT_SCRIPTING', language: 'vala')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Checks if the user wants to compile with the PulseAudio dependency
|
||||||
|
if get_option('pulse-audio')
|
||||||
|
add_project_arguments('-D', 'HAVE_PULSE_AUDIO', language: 'vala')
|
||||||
|
app_deps += [
|
||||||
|
dependency('libpulse'),
|
||||||
|
dependency('libpulse-mainloop-glib'),
|
||||||
|
]
|
||||||
|
app_sources += [
|
||||||
|
# Widget: Volume
|
||||||
|
'controlCenter/widgets/volume/volume.vala',
|
||||||
|
'controlCenter/widgets/volume/pulseDaemon.vala',
|
||||||
|
'controlCenter/widgets/volume/pulseDevice.vala',
|
||||||
|
'controlCenter/widgets/volume/pulseSinkInput.vala',
|
||||||
|
'controlCenter/widgets/volume/sinkInputRow.vala',
|
||||||
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Detect libhandy version
|
# Detect libhandy version
|
||||||
libhandy = dependency('libhandy-1')
|
libhandy = dependency('libhandy-1')
|
||||||
if libhandy.version() >= '1.3.9'
|
if libhandy.version() >= '1.3.9'
|
||||||
add_project_arguments('-D', 'HAVE_LATEST_LIBHANDY', language: 'vala')
|
add_project_arguments('-D', 'HAVE_LATEST_LIBHANDY', language: 'vala')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Detect gtk-layer-shell version
|
# Detect gtk-layer-shell version
|
||||||
|
Reference in New Issue
Block a user