project(
'c8-tailscale',
'c',
version: '0.1.0',
license: 'CC0-1.0',
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',
'-D_GNU_SOURCE',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
language: 'c',
)
# json.h, clock.h, rfkill.h: the copy every program used to carry (c8ui's repo)
base = dependency('c8-base')
glib = dependency('glib-2.0')
gio = dependency('gio-2.0')
gio_unix = dependency('gio-unix-2.0')
# What the app and the tile provider share: talking to the tailscale
# command and the live tile; no window system in it
core = static_library(
'tailscale-core',
files('src/status.c', 'src/tile.c', 'src/shown.c'),
dependencies: [base, glib, gio],
)
core_dep = declare_dependency(link_with: core,
include_directories: include_directories('src'),
dependencies: [base, glib, gio])
# Keeps the tile fresh while the app isn't open
executable('c8-tailscale-tile', 'src/provider.c',
dependencies: [core_dep, gio_unix], install: true)
c8ui = dependency('c8ui', required: get_option('app'))
if c8ui.found()
executable('c8-tailscale', 'src/main.c',
dependencies: [core_dep, c8ui, dependency('xkbcommon')], install: true)
app_id = 'org.cont8nuum.Tailscale'
desktop = configure_file(
input: 'data' / app_id + '.desktop.in',
output: app_id + '.desktop',
configuration: {'bindir': get_option('prefix') / get_option('bindir')},
)
install_data(desktop, install_dir: get_option('datadir') / 'applications')
install_data('data' / app_id + '.svg',
install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps')
gnome = import('gnome')
gnome.post_install(update_desktop_database: true)
endif
# The tile in Start's Live tiles tab
install_data('data/tailscale.widget',
install_dir: get_option('datadir') / 'cont8nuum/widgets')