[rhythmbox] build: set install_rpath if it's inside the source dir



commit ce8a0ddd637530ba8d436a462a77eca171e0ce0a
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Jun 4 22:08:27 2022 +1000

    build: set install_rpath if it's inside the source dir
    
    This should avoid problems with package builds while also providing
    the right behaviour for development builds.  If you're just
    building rhythmbox and installing inside the source dir, which is
    the process documented in INSTALL, it will load libraries from your
    build rather than from system packages.  Other situations likely
    involve tools for managing the build environment (jhbuild etc.), so
    setting rpath shouldn't be needed there.

 shell/meson.build | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/shell/meson.build b/shell/meson.build
index 25e2d1830..17a615678 100644
--- a/shell/meson.build
+++ b/shell/meson.build
@@ -129,9 +129,21 @@ if enable_python
   rhythmbox_dependencies += [pygobject]
 endif
 
+# set rpath on the rhythmbox binary if we're installing inside
+# the source dir, ensuring it loads librhythmbox-core from this
+# build rather than a package installed on the system.
+# if installing elsewhere, getting the library search path right
+# is the user's responsibility.
+rpath = ''
+if get_option('prefix').startswith(meson.project_source_root())
+  rpath = get_option('prefix') / get_option('libdir')
+endif
+
 executable('rhythmbox', 'main.c',
   dependencies: [ rhythmbox_dependencies ],
   c_args: shell_c_args,
   include_directories: [ pluginsinc ],
-  install: true
+  install: true,
+
+  install_rpath: rpath
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]