From 1e8312f7e3c8844f9c74fda14b71a95205cc3547 Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Wed, 22 Apr 2020 13:13:33 +0200 Subject: [PATCH] Add option to change lib dir in gamemoderun Signed-off-by: Stephan Lachnit --- data/gamemoderun.in | 2 +- data/meson.build | 8 ++++++++ meson_options.txt | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/data/gamemoderun.in b/data/gamemoderun.in index 659e33e..e0d933c 100755 --- a/data/gamemoderun.in +++ b/data/gamemoderun.in @@ -3,7 +3,7 @@ # Path to installed libgamemodeauto. ld.so will substitute "\$LIB" to get the # appropriate path depending on whether the app is 32- or 64-bit. -GAMEMODEAUTO="@GAMEMODE_PREFIX@/\$LIB/libgamemodeauto.so.0" +GAMEMODEAUTO="@GAMEMODERUN_PREFIX@libgamemodeauto.so.0" LD_PRELOAD="${GAMEMODEAUTO}${LD_PRELOAD:+:$LD_PRELOAD}" diff --git a/data/meson.build b/data/meson.build index f647e79..bb3d014 100644 --- a/data/meson.build +++ b/data/meson.build @@ -3,6 +3,14 @@ data_conf.set('BINDIR', path_bindir) data_conf.set('LIBEXECDIR', path_libexecdir) data_conf.set('GAMEMODE_PREFIX', path_prefix) +# Set gamemoderun lib dir +gamemoderun_lib_dir = get_option('with-gamemoderun-lib-dir') +if gamemoderun_lib_dir == 'default' + data_conf.set('GAMEMODERUN_PREFIX', path_prefix + '/\$LIB/') +else + data_conf.set('GAMEMODERUN_PREFIX', gamemoderun_lib_dir) +endif + # Pull in the example config config_example = run_command( 'cat', diff --git a/meson_options.txt b/meson_options.txt index ef329a3..609036b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,6 +9,9 @@ option('with-systemd-user-unit-dir', type: 'string', description: 'Explicitly se # Not using systemd option('with-dbus-service-dir', type: 'string', description: 'Explicitly set the D-BUS session directory') +# lib dir in gamemoderun +option('with-gamemoderun-lib-dir', type: 'string', value: 'default', description: 'Explicitly set lib dir in gamemoderun') + # General options option('with-examples', type: 'boolean', description: 'Build sample programs', value: 'true') option('with-daemon', type: 'boolean', description: 'Build the daemon', value: 'true')