project(
'c8-settings',
'c',
version: '0.1.0',
license: 'CC0-1.0 AND HPND-sell-variant',
meson_version: '>=1.3.0',
default_options: ['c_std=c11', 'warning_level=2', 'buildtype=debugoptimized', 'werror=false'],
)
add_project_arguments(
'-D_POSIX_C_SOURCE=200809L',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
language: 'c',
)
cc = meson.get_compiler('c')
c8ui = dependency('c8ui')
# json.h, clock.h, rfkill.h: the copy every program used to carry (c8ui's repo)
base = dependency('c8-base')
c8_protocols = dependency('c8-protocols')
wayland_client = dependency('wayland-client')
glib = dependency('glib-2.0')
gio = dependency('gio-2.0')
gio_unix = dependency('gio-unix-2.0')
pulse = dependency('libpulse')
pulse_glib = dependency('libpulse-mainloop-glib')
pangocairo = dependency('pangocairo')
math = cc.find_library('m')
wayland_scanner = find_program(
dependency('wayland-scanner', native: true).get_variable('wayland_scanner'),
native: true,
)
protocols = [
c8_protocols.get_variable('pkgdatadir') / 'cont8nuum-settings-v1.xml',
meson.current_source_dir() / 'protocols/wlr-output-management-unstable-v1.xml',
]
protos_src = []
foreach xml : protocols
name = xml.split('/')[-1].replace('.xml', '')
protos_src += custom_target(
name + '_client_h',
input: xml,
output: '@BASENAME@-client-protocol.h',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
protos_src += custom_target(
name + '_code',
input: xml,
output: '@BASENAME@-protocol.c',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)
endforeach
executable(
'c8-settings',
files('src/main.c', 'src/pages.c', 'src/lists.c', 'src/display.c',
'src/powermode.c', 'src/network.c',
'src/bluetooth.c',
'src/sound.c', 'src/defaults.c', 'src/accounts.c', 'src/night.c',
'src/info.c'),
protos_src,
c_args: ['-DC8_VERSION="' + meson.project_version() + '"'],
dependencies: [c8ui, base, wayland_client, glib, gio, gio_unix, pulse, pulse_glib,
pangocairo, math],
install: true,
)
# Online accounts: the daemon holding their tokens, started by D-Bus
libsecret = dependency('libsecret-1')
provider_dir = get_option('prefix') / get_option('datadir') / 'cont8nuum/accounts'
executable(
'c8-accounts',
files('src/accounts/c8-accounts.c'),
c_args: ['-DPROVIDER_DIR="' + provider_dir + '"'],
dependencies: [base, glib, gio, gio_unix, libsecret],
install: true,
install_dir: get_option('libexecdir'),
)
configure_file(
input: 'data/org.cont8nuum.Accounts.service.in',
output: 'org.cont8nuum.Accounts.service',
configuration: {
'libexecdir': get_option('prefix') / get_option('libexecdir'),
},
install_dir: get_option('datadir') / 'dbus-1/services',
)
install_data('data/accounts/snail.zone.provider',
'data/accounts/snail.zone.svg', install_dir: provider_dir)
# Settings sync with the cont8nuum account: c8 runs it for the session,
# over the same private protocol as PC settings
executable(
'c8-sync',
files('src/sync/c8-sync.c'),
protos_src[0], protos_src[1],
dependencies: [base, wayland_client, glib, gio, gio_unix,
dependency('gdk-pixbuf-2.0')],
install: true,
)
# The cont8nuum account, at the site the account_url option names
# (none: not offered)
account_url = get_option('account_url')
if account_url != ''
configure_file(
input: 'data/accounts/cont8nuum.provider.in',
output: 'cont8nuum.provider',
configuration: {'URL': account_url.strip('/')},
install_dir: provider_dir,
)
install_data('data/accounts/cont8nuum-account.svg',
install_dir: provider_dir)
endif
install_data('data/c8-settings.desktop',
install_dir: get_option('datadir') / 'applications')