Commit a2b20a65 authored by Iñigo Martínez's avatar Iñigo Martínez Committed by Georges Basile Stavracas Neto

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
parent 503ffb54
......@@ -19,6 +19,7 @@ control_center_icondir = join_paths(control_center_datadir, 'icons')
control_center_gettext = meson.project_name() + '-2.0'
host_is_linux = host_machine.system().contains('linux')
host_is_s390 = host_machine.cpu().contains('s390')
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])
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
enable_cheese = get_option('cheese')
if enable_cheese
......@@ -178,9 +167,27 @@ endif
config_h.set('HAVE_IBUS', enable_ibus,
description: 'Defined if IBus support is enabled')
# network manager
enable_network_manager = get_option('network_manager')
if enable_network_manager
# wayland
enable_wayland = get_option('wayland')
if enable_wayland
wayland_deps = [
dependency('gdk-wayland-3.0'),
dependency('gudev-1.0')
]
endif
config_h.set('HAVE_WAYLAND', enable_wayland,
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'),
......@@ -190,17 +197,9 @@ if enable_network_manager
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
assert(clutter_gtk_dep.found(), 'clutter-gtk library is required for wacom support, but is not available.')
wacom_deps = [
clutter_gtk_dep,
......@@ -208,22 +207,19 @@ if enable_wacom
dependency('libwacom', version: '>= 0.7')
]
endif
config_h.set('BUILD_WACOM', enable_wacom,
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_wacom,
config_h.set('HAVE_WACOM', enable_linux,
description: 'Define to 1 if Wacom is supportted')
# wayland
enable_wayland = get_option('wayland')
if enable_wayland
wayland_deps = [
dependency('gdk-wayland-3.0'),
dependency('gudev-1.0')
]
endif
config_h.set('HAVE_WAYLAND', enable_wayland,
description: 'Define to 1 if Wayland is enabled')
# Check for info panel
gnome_session_libexecdir = get_option('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 += '** 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 += '** IBus (Region panel IBus support): ' + enable_ibus.to_string() + '\n'
output += '** NetworkManager (Network panel): ' + enable_network_manager.to_string() + '\n'
output += '** wacom (Wacom tablet panel): ' + enable_wacom.to_string() + '\n'
output += '** NetworkManager (Network panel): ' + enable_linux.to_string() + '\n'
output += '** wacom (Wacom tablet panel): ' + enable_linux.to_string() + '\n'
output += '** Wayland: ' + enable_wayland.to_string() + '\n'
output += '** gnome-session libexecdir: ' + gnome_session_libexecdir + '\n'
output += 'End options'
......
option('bluetooth', type: 'boolean', value: true, description: 'build with Bluetooth support')
option('cheese', type: 'boolean', value: true, description: 'build with cheese webcam support')
option('documentation', type: 'boolean', value: false, description: 'build documentation')
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('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')
\ No newline at end of file
option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')
......@@ -21,16 +21,12 @@ panels = [
'user-accounts'
]
if enable_bluetooth
panels += 'bluetooth'
endif
if enable_network_manager
panels += 'network'
endif
if enable_wacom
panels += 'wacom'
if enable_linux
panels += [
'bluetooth',
'network',
'wacom'
]
endif
panels_list = []
......
......@@ -35,12 +35,8 @@ deps = common_deps + [
cflags += '-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)
if enable_bluetooth
deps += gnome_bluetooth_dep
endif
if enable_network_manager
deps += network_manager_deps
if enable_linux
deps += network_manager_deps + [gnome_bluetooth_dep]
endif
panels_libs += static_library(
......
......@@ -86,7 +86,7 @@ if enable_cheese
shell_deps += cheese_deps
endif
if enable_wacom
if enable_linux
shell_deps += wacom_deps
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment