project(
'c8-news',
'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')
cairo = dependency('cairo')
pango = dependency('pango')
pixbuf = dependency('gdk-pixbuf-2.0')
xml = dependency('libxml-2.0')
# What the app and the tile provider share: no window system in it
core = static_library(
'news-core',
files('src/store.c', 'src/fetch.c', 'src/feed.c', 'src/html.c',
'src/image.c', 'src/tile.c', 'src/rssnail.c'),
dependencies: [base, glib, gio, cairo, pango, pixbuf, xml],
)
core_dep = declare_dependency(link_with: core,
include_directories: include_directories('src'),
dependencies: [base, glib, gio, cairo, pango, pixbuf, xml])
# Keeps the tile fresh while the app isn't open
executable('c8-news-tile', 'src/provider.c',
dependencies: [core_dep, gio_unix], install: true)
c8ui = dependency('c8ui', required: get_option('app'))
if c8ui.found()
# The nav bar's glyphs: the icon theme has nothing like them
glyph_dir = get_option('prefix') / get_option('datadir') / 'c8-news'
executable('c8-news', 'src/main.c',
c_args: ['-DNEWS_GLYPHS="' + glyph_dir + '"'],
dependencies: [core_dep, c8ui, dependency('xkbcommon')], install: true)
install_data('data/glyphs/top-stories.svg', 'data/glyphs/sources.svg',
install_dir: glyph_dir)
app_id = 'org.cont8nuum.News'
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/news.widget',
install_dir: get_option('datadir') / 'cont8nuum/widgets')