refactor datadir, install completions, dbus service activation
This commit is contained in:
28
data/meson.build
Normal file
28
data/meson.build
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
application_id = 'org.mpris.MediaPlayer2.playerctld'
|
||||||
|
|
||||||
|
service_conf = configuration_data()
|
||||||
|
service_conf.set('application_id', application_id)
|
||||||
|
service_conf.set('bindir', bindir)
|
||||||
|
service_conf.set('prefix', prefix)
|
||||||
|
service = application_id + '.service'
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: service + '.in',
|
||||||
|
output: service,
|
||||||
|
install: true,
|
||||||
|
install_dir: join_paths(datadir, 'dbus-1', 'services'),
|
||||||
|
configuration: service_conf
|
||||||
|
)
|
||||||
|
|
||||||
|
if get_option('bash-completions')
|
||||||
|
bash_files = files(
|
||||||
|
'playerctl.bash',
|
||||||
|
)
|
||||||
|
if bash_comp.found()
|
||||||
|
bash_install_dir = bash_comp.get_pkgconfig_variable('completionsdir')
|
||||||
|
else
|
||||||
|
bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
|
||||||
|
endif
|
||||||
|
|
||||||
|
install_data(bash_files, install_dir: bash_install_dir)
|
||||||
|
endif
|
3
data/org.mpris.MediaPlayer2.playerctld.service.in
Normal file
3
data/org.mpris.MediaPlayer2.playerctld.service.in
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[D-BUS Service]
|
||||||
|
Name=@application_id@
|
||||||
|
Exec=@prefix@/@bindir@/playerctld
|
@@ -10,6 +10,10 @@ release_date = 'March 26, 2019'
|
|||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
pkgconfig = import('pkgconfig')
|
pkgconfig = import('pkgconfig')
|
||||||
|
|
||||||
|
datadir = get_option('datadir')
|
||||||
|
bindir = get_option('bindir')
|
||||||
|
prefix = get_option('prefix')
|
||||||
|
|
||||||
version_conf = configuration_data()
|
version_conf = configuration_data()
|
||||||
|
|
||||||
playerctl_version = meson.project_version().split('-')[0]
|
playerctl_version = meson.project_version().split('-')[0]
|
||||||
@@ -40,6 +44,8 @@ version_conf.set(
|
|||||||
gobject_dep = dependency('gobject-2.0', version: '>=2.38')
|
gobject_dep = dependency('gobject-2.0', version: '>=2.38')
|
||||||
gio_dep = dependency('gio-unix-2.0')
|
gio_dep = dependency('gio-unix-2.0')
|
||||||
glib_dep = dependency('glib-2.0')
|
glib_dep = dependency('glib-2.0')
|
||||||
|
bash_comp = dependency('bash-completion', required: false)
|
||||||
|
|
||||||
subdir('playerctl')
|
subdir('playerctl')
|
||||||
|
subdir('data')
|
||||||
subdir('doc')
|
subdir('doc')
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
option('gtk-doc', type: 'boolean', value: true, description: 'build docs')
|
option('gtk-doc', type: 'boolean', value: true, description: 'build docs')
|
||||||
option('introspection', type: 'boolean', value: true, description: 'build gir data')
|
option('introspection', type: 'boolean', value: true, description: 'build gir data')
|
||||||
|
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
|
||||||
|
@@ -9,7 +9,7 @@ configuration_inc = include_directories('..')
|
|||||||
|
|
||||||
playerctl_generated = gnome.gdbus_codegen(
|
playerctl_generated = gnome.gdbus_codegen(
|
||||||
'playerctl-generated',
|
'playerctl-generated',
|
||||||
'mpris-dbus-interface.xml',
|
join_paths(meson.source_root(), 'data', 'mpris-dbus-interface.xml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
headers = [
|
headers = [
|
||||||
@@ -48,8 +48,8 @@ deps = [
|
|||||||
gio_dep,
|
gio_dep,
|
||||||
]
|
]
|
||||||
|
|
||||||
symbols_file = 'playerctl.syms'
|
symbols_file = join_paths(meson.source_root(), 'data', 'playerctl.syms')
|
||||||
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
|
symbols_flag = '-Wl,--version-script,@0@'.format(symbols_file)
|
||||||
|
|
||||||
playerctl_lib = both_libraries(
|
playerctl_lib = both_libraries(
|
||||||
'playerctl',
|
'playerctl',
|
||||||
|
@@ -130,12 +130,12 @@ static void proxy_method_call_async_callback(GObject *source_object, GAsyncResul
|
|||||||
if (g_variant_n_children(body) > 1) {
|
if (g_variant_n_children(body) > 1) {
|
||||||
GVariant *error_message_variant = g_variant_get_child_value(body, 1);
|
GVariant *error_message_variant = g_variant_get_child_value(body, 1);
|
||||||
const char *error_message = g_variant_get_string(error_message_variant, 0);
|
const char *error_message = g_variant_get_string(error_message_variant, 0);
|
||||||
g_dbus_method_invocation_return_dbus_error(invocation, g_dbus_message_get_error_name(reply),
|
g_dbus_method_invocation_return_dbus_error(
|
||||||
error_message);
|
invocation, g_dbus_message_get_error_name(reply), error_message);
|
||||||
g_variant_unref(error_message_variant);
|
g_variant_unref(error_message_variant);
|
||||||
} else {
|
} else {
|
||||||
g_dbus_method_invocation_return_dbus_error(invocation, g_dbus_message_get_error_name(reply),
|
g_dbus_method_invocation_return_dbus_error(
|
||||||
"Failed to call method");
|
invocation, g_dbus_message_get_error_name(reply), "Failed to call method");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
prefix=@prefix@
|
|
||||||
exec_prefix=@exec_prefix@
|
|
||||||
libdir=@libdir@
|
|
||||||
includedir=@includedir@
|
|
||||||
|
|
||||||
Name: Playerctl
|
|
||||||
Description: A C library for MPRIS players
|
|
||||||
Version: @VERSION@
|
|
||||||
Libs: -L${libdir} -lplayerctl-1.0
|
|
||||||
Cflags: -I${includedir}/playerctl
|
|
||||||
Requires: gobject-2.0
|
|
||||||
Requires.private: gio-2.0
|
|
Reference in New Issue
Block a user