project(
'c8-video',
'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',
)
app_id = 'org.cont8nuum.Video'
# The video's own surface under the window: a viewport for its size, and
# the screens kept on while it plays
wayland_scanner = find_program(
dependency('wayland-scanner', native: true).get_variable('wayland_scanner'),
native: true,
)
wp_dir = dependency('wayland-protocols').get_variable('pkgdatadir')
c8_dir = dependency('c8-protocols').get_variable('pkgdatadir')
protocols = []
foreach xml : [
wp_dir / 'stable/viewporter/viewporter.xml',
wp_dir / 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml',
# 3D and all-round videos in XR glasses: the compositor shows those
c8_dir / 'cont8nuum-stereo-v1.xml',
]
protocols += custom_target(
input: xml,
output: '@BASENAME@-client-protocol.h',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
protocols += custom_target(
input: xml,
output: '@BASENAME@-protocol.c',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)
endforeach
executable('c8-video',
files('src/main.c', 'src/player.c', 'src/stage.c', 'src/views.c', 'src/tile.c',
'src/bitsubs.c',
'src/folder.c', 'src/browse.c', 'src/mpris.c', 'src/prefs.c'),
protocols,
dependencies: [
dependency('c8ui'),
dependency('c8-base'), # tiles.h
dependency('glib-2.0'),
dependency('gio-2.0'),
dependency('mpv', version: '>=2.1'),
# picture subtitles (bitsubs.c): mpv's own FFmpeg
dependency('libavformat'),
dependency('libavcodec'),
dependency('libavutil'),
dependency('egl'),
dependency('glesv2'),
dependency('wayland-client'),
dependency('wayland-egl'),
dependency('xkbcommon'),
meson.get_compiler('c').find_library('m'),
],
install: true,
)
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)