project(
'c8-cirrus',
'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, http.h, tiles.h
base = dependency('c8-base')
glib = dependency('glib-2.0')
gio = dependency('gio-2.0')
gio_unix = dependency('gio-unix-2.0')
pixbuf = dependency('gdk-pixbuf-2.0')
cairo = dependency('cairo')
# The session's tokens are kept in the wallet
secret = dependency('libsecret-1')
m = meson.get_compiler('c').find_library('m', required: false)
# What the app and the tile provider share: the account, the calls to
# its server, posts as structs, pictures and the live tile; no window
# system in it
core = static_library(
'cirrus-core',
files('src/store.c', 'src/session.c', 'src/model.c', 'src/image.c',
'src/tile.c', 'src/shown.c'),
dependencies: [base, glib, gio, pixbuf, cairo, secret, m],
)
core_dep = declare_dependency(link_with: core,
include_directories: include_directories('src'),
dependencies: [base, glib, gio, pixbuf, cairo, secret, m])
# Keeps the tile fresh, and tells of notifications, while the app isn't open
executable('c8-cirrus-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-cirrus'
executable('c8-cirrus', 'src/main.c', 'src/home.c', 'src/cards.c', 'src/feeds.c',
'src/pages.c', 'src/compose.c',
c_args: ['-DSKY_GLYPHS="' + glyph_dir + '"'],
dependencies: [core_dep, c8ui, dependency('xkbcommon')], install: true)
foreach glyph : ['home', 'notifications', 'search', 'feeds', 'profile',
'reply', 'repost', 'like', 'quote', 'compose', 'accounts']
install_data('data/glyphs' / glyph + '.svg', install_dir: glyph_dir)
endforeach
app_id = 'org.cont8nuum.Cirrus'
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-cirrus.widget',
install_dir: get_option('datadir') / 'cont8nuum/widgets')