Add Clapper deamon subprocess

Daemon is responsible for starting and later watching over spawned "broadwayd" and "remote" app needed for remote playback control. We cannot use systemd n Flatpak, so we make do with running optional background subprocesses.
This commit is contained in:
Rafostar
2020-12-16 19:54:30 +01:00
parent 254d1aa9db
commit 84762de76a
6 changed files with 104 additions and 30 deletions

View File

@@ -3,15 +3,15 @@
/* pkg init enforces the imports path to the folder
* named after the pkg name, but I would prefer to have
* the bundled subprocess stored in the same directory */
imports.searchPath.unshift('@datadir@/@PROJECT_NAME@');
imports.searchPath.unshift('@datadir@/@PACKAGE_NAME@');
const Package = imports.package;
Package.init({
name: '@PACKAGE_NAME@',
name: '@PACKAGE_NAME@.@ID_POSTFIX@',
version: '@PACKAGE_VERSION@',
prefix: '@prefix@',
libdir: '@libdir@',
datadir: '@datadir@',
});
Package.run(imports.clapper_src.mainRemote);
Package.run(imports.clapper_src.main@ID_POSTFIX@);

View File

@@ -1,18 +1,21 @@
clapper_apps = [ '', '.Remote' ]
clapper_apps = ['', 'Remote', 'Daemon']
foreach id_postfix : clapper_apps
app_postfix = (id_postfix != '') ? '.' + id_postfix : ''
template_type = (id_postfix != '') ? '.Subprocess' : ''
bin_conf = configuration_data()
bin_conf.set('GJS', find_program('gjs').path())
bin_conf.set('PROJECT_NAME', meson.project_name())
bin_conf.set('PACKAGE_NAME', meson.project_name() + id_postfix)
bin_conf.set('PACKAGE_NAME', meson.project_name())
bin_conf.set('PACKAGE_VERSION', meson.project_version())
bin_conf.set('ID_POSTFIX', id_postfix)
bin_conf.set('prefix', get_option('prefix'))
bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir')))
configure_file(
input: 'com.github.rafostar.Clapper' + id_postfix + '.in',
output: 'com.github.rafostar.Clapper' + id_postfix,
input: 'com.github.rafostar.Clapper' + template_type + '.in',
output: 'com.github.rafostar.Clapper' + app_postfix,
configuration: bin_conf,
install: true,
install_dir: get_option('bindir'),