project(
'c8-weather',
'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')
m = meson.get_compiler('c').find_library('m', required: false)
# What the app and the tile provider share: weathersnail's API, the
# places, the account and the live tile; no window system in it
core = static_library(
'weather-core',
files('src/store.c', 'src/http.c', 'src/data.c', 'src/format.c',
'src/account.c', 'src/tile.c'),
dependencies: [base, glib, gio, m],
)
core_dep = declare_dependency(link_with: core,
include_directories: include_directories('src'),
dependencies: [base, glib, gio, m])
# Keeps the tiles fresh while the app isn't open
executable('c8-weather-tile', 'src/provider.c',
dependencies: [core_dep, gio_unix], install: true)
c8ui = dependency('c8ui', required: get_option('app'))
if c8ui.found()
# The bars' glyphs: the icon theme has nothing like them
glyph_dir = get_option('prefix') / get_option('datadir') / 'c8-weather'
executable('c8-weather', 'src/main.c', 'src/radar.c',
c_args: ['-DWEATHER_GLYPHS="' + glyph_dir + '"'],
dependencies: [core_dep, c8ui, dependency('gdk-pixbuf-2.0'),
dependency('pangocairo'), dependency('xkbcommon')], install: true)
install_data('data/glyphs/home.svg', 'data/glyphs/places.svg',
'data/glyphs/maps.svg', 'data/glyphs/units.svg', 'data/glyphs/pin.svg',
install_dir: glyph_dir)
app_id = 'org.cont8nuum.Weather'
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/c8-weather.widget',
install_dir: get_option('datadir') / 'cont8nuum/widgets')