build: Make bluetooth, network and wacom mandatory on linux

The bluetooh, network and wacom panels should not be optional
on linux, except on s390 systems which lack USB support. It
should also not be built at all on other systems.

This patch makes these panels mandatory on linux.

https://bugzilla.gnome.org/show_bug.cgi?id=792641
This commit is contained in:
Iñigo Martínez 2018-01-18 16:17:08 +01:00 committed by Georges Basile Stavracas Neto
parent 503ffb540a
commit a2b20a65cb
5 changed files with 56 additions and 71 deletions

View file

@ -19,6 +19,7 @@ control_center_icondir = join_paths(control_center_datadir, 'icons')
control_center_gettext = meson.project_name() + '-2.0' control_center_gettext = meson.project_name() + '-2.0'
host_is_linux = host_machine.system().contains('linux')
host_is_s390 = host_machine.cpu().contains('s390') host_is_s390 = host_machine.cpu().contains('s390')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
@ -144,18 +145,6 @@ foreach header: check_headers
assert(cc.has_header(header[1], args: cups_cflags), 'CUPS headers not found: ' + header[1]) assert(cc.has_header(header[1], args: cups_cflags), 'CUPS headers not found: ' + header[1])
endforeach endforeach
# Check for gnome-bluetooth
enable_bluetooth = get_option('bluetooth')
if enable_bluetooth
assert(not host_is_s390, 'Bluetooth panel will not be built (no USB support on this platform). Use -Dbluetooth=false to build without it.')
gnome_bluetooth_dep = dependency('gnome-bluetooth-1.0', version: '>= 3.18.2')
endif
config_h.set('BUILD_BLUETOOTH', enable_bluetooth,
description: 'Define to 1 to build the Bluetooth panel')
config_h.set('HAVE_BLUETOOTH', enable_bluetooth,
description: 'Define to 1 if bluetooth support is available')
# Optional dependency for the user accounts panel # Optional dependency for the user accounts panel
enable_cheese = get_option('cheese') enable_cheese = get_option('cheese')
if enable_cheese if enable_cheese
@ -178,41 +167,6 @@ endif
config_h.set('HAVE_IBUS', enable_ibus, config_h.set('HAVE_IBUS', enable_ibus,
description: 'Defined if IBus support is enabled') description: 'Defined if IBus support is enabled')
# network manager
enable_network_manager = get_option('network_manager')
if enable_network_manager
network_manager_deps = [
dependency('libnm', version: '>= 1.2.0'),
dependency('libnma', version: '>= 1.2.0'),
dependency('mm-glib', version: '>= 0.7')
]
network_manager_dep = dependency('NetworkManager')
nm_vpn_config_dir = join_paths(network_manager_dep.get_pkgconfig_variable('configdir'), 'VPN')
nm_vpn_module_dir = network_manager_dep.get_pkgconfig_variable('plugindir')
endif
config_h.set('BUILD_NETWORK', enable_network_manager,
description: 'Define to 1 to build the Network panel')
config_h.set('HAVE_NETWORK_MANAGER', enable_network_manager,
description: 'Define to 1 if NetworkManager is available')
# Wacom
enable_wacom = get_option('wacom')
if enable_wacom
assert(not host_is_s390, 'Wacom panel will not be built (no USB support on this platform). Use -Dwacom=false to build without it.')
assert(clutter_gtk_dep.found(), 'wacom support requested, but clutter-gtk library is not available. Use -Dwacom=false to build without it.')
wacom_deps = [
clutter_gtk_dep,
dependency('clutter-1.0', version: '>= 1.11.3'),
dependency('libwacom', version: '>= 0.7')
]
endif
config_h.set('BUILD_WACOM', enable_wacom,
description: 'Define to 1 to build the Wacom panel')
config_h.set('HAVE_WACOM', enable_wacom,
description: 'Define to 1 if Wacom is supportted')
# wayland # wayland
enable_wayland = get_option('wayland') enable_wayland = get_option('wayland')
if enable_wayland if enable_wayland
@ -224,6 +178,48 @@ endif
config_h.set('HAVE_WAYLAND', enable_wayland, config_h.set('HAVE_WAYLAND', enable_wayland,
description: 'Define to 1 if Wayland is enabled') description: 'Define to 1 if Wayland is enabled')
if host_is_s390
message('Bluetooth, Network and Wacom panels will not be built (no USB support on this platform)')
endif
enable_linux = host_is_linux and not host_is_s390
if enable_linux
# gnome-bluetooth
gnome_bluetooth_dep = dependency('gnome-bluetooth-1.0', version: '>= 3.18.2')
# network manager
network_manager_deps = [
dependency('libnm', version: '>= 1.2.0'),
dependency('libnma', version: '>= 1.2.0'),
dependency('mm-glib', version: '>= 0.7')
]
network_manager_dep = dependency('NetworkManager')
nm_vpn_config_dir = join_paths(network_manager_dep.get_pkgconfig_variable('configdir'), 'VPN')
nm_vpn_module_dir = network_manager_dep.get_pkgconfig_variable('plugindir')
# Wacom
assert(clutter_gtk_dep.found(), 'clutter-gtk library is required for wacom support, but is not available.')
wacom_deps = [
clutter_gtk_dep,
dependency('clutter-1.0', version: '>= 1.11.3'),
dependency('libwacom', version: '>= 0.7')
]
endif
config_h.set('BUILD_BLUETOOTH', enable_linux,
description: 'Define to 1 to build the Bluetooth panel')
config_h.set('HAVE_BLUETOOTH', enable_linux,
description: 'Define to 1 if bluetooth support is available')
config_h.set('BUILD_NETWORK', enable_linux,
description: 'Define to 1 to build the Network panel')
config_h.set('HAVE_NETWORK_MANAGER', enable_linux,
description: 'Define to 1 if NetworkManager is available')
config_h.set('BUILD_WACOM', enable_linux,
description: 'Define to 1 to build the Wacom panel')
config_h.set('HAVE_WACOM', enable_linux,
description: 'Define to 1 if Wacom is supportted')
# Check for info panel # Check for info panel
gnome_session_libexecdir = get_option('gnome_session_libexecdir') gnome_session_libexecdir = get_option('gnome_session_libexecdir')
if gnome_session_libexecdir == '' if gnome_session_libexecdir == ''
@ -272,11 +268,11 @@ meson.add_install_script(
) )
output = meson.project_name() + ' was configured with the following options:\n' output = meson.project_name() + ' was configured with the following options:\n'
output += '** gnome-bluetooth (Bluetooth panel): ' + enable_bluetooth.to_string() + '\n' output += '** gnome-bluetooth (Bluetooth panel): ' + enable_linux.to_string() + '\n'
output += '** Cheese (Users panel webcam support): ' + enable_cheese.to_string() + '\n' output += '** Cheese (Users panel webcam support): ' + enable_cheese.to_string() + '\n'
output += '** IBus (Region panel IBus support): ' + enable_ibus.to_string() + '\n' output += '** IBus (Region panel IBus support): ' + enable_ibus.to_string() + '\n'
output += '** NetworkManager (Network panel): ' + enable_network_manager.to_string() + '\n' output += '** NetworkManager (Network panel): ' + enable_linux.to_string() + '\n'
output += '** wacom (Wacom tablet panel): ' + enable_wacom.to_string() + '\n' output += '** wacom (Wacom tablet panel): ' + enable_linux.to_string() + '\n'
output += '** Wayland: ' + enable_wayland.to_string() + '\n' output += '** Wayland: ' + enable_wayland.to_string() + '\n'
output += '** gnome-session libexecdir: ' + gnome_session_libexecdir + '\n' output += '** gnome-session libexecdir: ' + gnome_session_libexecdir + '\n'
output += 'End options' output += 'End options'

View file

@ -1,8 +1,5 @@
option('bluetooth', type: 'boolean', value: true, description: 'build with Bluetooth support')
option('cheese', type: 'boolean', value: true, description: 'build with cheese webcam support') option('cheese', type: 'boolean', value: true, description: 'build with cheese webcam support')
option('documentation', type: 'boolean', value: false, description: 'build documentation') option('documentation', type: 'boolean', value: false, description: 'build documentation')
option('gnome_session_libexecdir', type: 'string', value: '', description: 'Directory for gnome-session\'s libexecdir') option('gnome_session_libexecdir', type: 'string', value: '', description: 'Directory for gnome-session\'s libexecdir')
option('ibus', type: 'boolean', value: true, description: 'build with IBus support') option('ibus', type: 'boolean', value: true, description: 'build with IBus support')
option('network_manager', type: 'boolean', value: true, description: 'build with NetworkManager support')
option('wacom', type: 'boolean', value: true, description: 'build with Wacom support')
option('wayland', type: 'boolean', value: true, description: 'build with Wayland support') option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')

View file

@ -21,16 +21,12 @@ panels = [
'user-accounts' 'user-accounts'
] ]
if enable_bluetooth if enable_linux
panels += 'bluetooth' panels += [
endif 'bluetooth',
'network',
if enable_network_manager 'wacom'
panels += 'network' ]
endif
if enable_wacom
panels += 'wacom'
endif endif
panels_list = [] panels_list = []

View file

@ -35,12 +35,8 @@ deps = common_deps + [
cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir) cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
if enable_bluetooth if enable_linux
deps += gnome_bluetooth_dep deps += network_manager_deps + [gnome_bluetooth_dep]
endif
if enable_network_manager
deps += network_manager_deps
endif endif
panels_libs += static_library( panels_libs += static_library(

View file

@ -86,7 +86,7 @@ if enable_cheese
shell_deps += cheese_deps shell_deps += cheese_deps
endif endif
if enable_wacom if enable_linux
shell_deps += wacom_deps shell_deps += wacom_deps
endif endif