Skip to content

Commit

Permalink
refactor datadir, install completions, dbus service activation
Browse files Browse the repository at this point in the history
  • Loading branch information
acrisci committed Jan 24, 2020
1 parent dea63c0 commit 1debe0e
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 19 deletions.
28 changes: 28 additions & 0 deletions data/meson.build
@@ -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
File renamed without changes.
3 changes: 3 additions & 0 deletions data/org.mpris.MediaPlayer2.playerctld.service.in
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=@application_id@
Exec=@prefix@/@bindir@/playerctld
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions meson.build
Expand Up @@ -10,6 +10,10 @@ release_date = 'March 26, 2019'
gnome = import('gnome')
pkgconfig = import('pkgconfig')

datadir = get_option('datadir')
bindir = get_option('bindir')
prefix = get_option('prefix')

version_conf = configuration_data()

playerctl_version = meson.project_version().split('-')[0]
Expand Down Expand Up @@ -40,6 +44,8 @@ version_conf.set(
gobject_dep = dependency('gobject-2.0', version: '>=2.38')
gio_dep = dependency('gio-unix-2.0')
glib_dep = dependency('glib-2.0')
bash_comp = dependency('bash-completion', required: false)

subdir('playerctl')
subdir('data')
subdir('doc')
1 change: 1 addition & 0 deletions meson_options.txt
@@ -1,2 +1,3 @@
option('gtk-doc', type: 'boolean', value: true, description: 'build docs')
option('introspection', type: 'boolean', value: true, description: 'build gir data')
option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
6 changes: 3 additions & 3 deletions playerctl/meson.build
Expand Up @@ -9,7 +9,7 @@ configuration_inc = include_directories('..')

playerctl_generated = gnome.gdbus_codegen(
'playerctl-generated',
'mpris-dbus-interface.xml',
join_paths(meson.source_root(), 'data', 'mpris-dbus-interface.xml'),
)

headers = [
Expand Down Expand Up @@ -48,8 +48,8 @@ deps = [
gio_dep,
]

symbols_file = 'playerctl.syms'
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
symbols_file = join_paths(meson.source_root(), 'data', 'playerctl.syms')
symbols_flag = '-Wl,--version-script,@0@'.format(symbols_file)

playerctl_lib = both_libraries(
'playerctl',
Expand Down
8 changes: 4 additions & 4 deletions playerctl/playerctl-daemon.c
Expand Up @@ -130,12 +130,12 @@ static void proxy_method_call_async_callback(GObject *source_object, GAsyncResul
if (g_variant_n_children(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);
g_dbus_method_invocation_return_dbus_error(invocation, g_dbus_message_get_error_name(reply),
error_message);
g_dbus_method_invocation_return_dbus_error(
invocation, g_dbus_message_get_error_name(reply), error_message);
g_variant_unref(error_message_variant);
} else {
g_dbus_method_invocation_return_dbus_error(invocation, g_dbus_message_get_error_name(reply),
"Failed to call method");
g_dbus_method_invocation_return_dbus_error(
invocation, g_dbus_message_get_error_name(reply), "Failed to call method");
}
break;
}
Expand Down
12 changes: 0 additions & 12 deletions playerctl/playerctl.pc.in

This file was deleted.

0 comments on commit 1debe0e

Please sign in to comment.