[rhythmbox/wip/sam/meson] meson: Attempt to fix -Duninstalled_build=true mode



commit 42a5efd61d5a96c137476b9f7a491b624adc3f10
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Oct 29 19:21:19 2020 +0100

    meson: Attempt to fix -Duninstalled_build=true mode
    
    Building in this mode and running ./shell/rhythmbox still fails, with
    an error like this:
    
        /usr/lib64/python3.9/site-packages/gi/module.py:163: Warning: cannot register existing type 'RBShell'
         g_type = info.get_g_type()
    
        (rhythmbox:56952): GLib-CRITICAL **: 19:19:36.617: g_once_init_leave: assertion 'result != 0' failed
    
    The problem is that libpeas has the wrong library path when loading
    plugins. It tries to load symbols from /usr/lib64/librhythmboxcore.so
    and these conflict with those from ./shell/librhythmboxcore.so which
    is already loaded.
    
    We already set rpath to $ORIGIN in the `rhythmbox` binary, so I'm not
    sure what more can be done. Setting LD_LIBRARY_PATH manually also
    doesn't get it to work.

 meson.build                       | 6 +++---
 plugins/artsearch/meson.build     | 7 +++++++
 plugins/context/meson.build       | 7 +++++++
 plugins/im-status/meson.build     | 7 +++++++
 plugins/listenbrainz/meson.build  | 7 +++++++
 plugins/lyrics/meson.build        | 7 +++++++
 plugins/magnatune/meson.build     | 7 +++++++
 plugins/pythonconsole/meson.build | 7 +++++++
 plugins/rb/meson.build            | 7 +++++++
 plugins/rbzeitgeist/meson.build   | 7 +++++++
 plugins/replaygain/meson.build    | 7 +++++++
 plugins/soundcloud/meson.build    | 7 +++++++
 plugins/webremote/meson.build     | 7 +++++++
 shell/meson.build                 | 2 +-
 14 files changed, 88 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index a8f46c57b..3f81e0107 100644
--- a/meson.build
+++ b/meson.build
@@ -198,9 +198,9 @@ cdata.set('PACKAGE', '"rhythmbox"')
 cdata.set('VERSION', '@0@'.format(meson.project_version()))
 
 cdata.set('USE_UNINSTALLED_DIRS', get_option('uninstalled_build'))
-cdata.set('SHARE_UNINSTALLED_DIR', '"@0@"'.format(meson.source_root() + '/data'))
-cdata.set('SHARE_UNINSTALLED_BUILDDIR', '"@0@"'.format(meson.build_root() + '/data'))
-cdata.set('METADATA_UNINSTALLED_DIR', '"@0@"'.format(meson.build_root() + '/metadata'))
+cdata.set('SHARE_UNINSTALLED_DIR', '"@0@"'.format(meson.current_source_dir() + '/data'))
+cdata.set('SHARE_UNINSTALLED_BUILDDIR', '"@0@"'.format(meson.current_build_dir() + '/data'))
+cdata.set('METADATA_UNINSTALLED_DIR', '"@0@"'.format(meson.current_build_dir() + '/metadata'))
 
 # Needed so that we can build static libraries and later link them into
 # shared libraries.
diff --git a/plugins/artsearch/meson.build b/plugins/artsearch/meson.build
index 1bba92056..153904201 100644
--- a/plugins/artsearch/meson.build
+++ b/plugins/artsearch/meson.build
@@ -18,3 +18,10 @@ artsearch_plugin_descriptor = custom_target('artsearch-plugin-descriptor',
   command: [intltool_merge, '--quiet', '--desktop-style', meson.source_root() + '/po', '@INPUT@', 
'@OUTPUT@'],
   install: true,
   install_dir: artsearch_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/context/meson.build b/plugins/context/meson.build
index 1e05726c2..539fb8ce3 100644
--- a/plugins/context/meson.build
+++ b/plugins/context/meson.build
@@ -37,3 +37,10 @@ install_data([
   'img/links/Discogs16x16.png',
   'img/links/Wikipedia16x16.png'],
   install_dir: context_plugin_data_dir + '/img')
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp -a ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/* ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', 
check: true)
+endif
diff --git a/plugins/im-status/meson.build b/plugins/im-status/meson.build
index 9ae65e42e..46b109acb 100644
--- a/plugins/im-status/meson.build
+++ b/plugins/im-status/meson.build
@@ -12,3 +12,10 @@ im_status_plugin_descriptor = custom_target('im-status-plugin-descriptor',
   command: [intltool_merge, '--quiet', '--desktop-style', meson.source_root() + '/po', '@INPUT@', 
'@OUTPUT@'],
   install: true,
   install_dir: im_status_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/listenbrainz/meson.build b/plugins/listenbrainz/meson.build
index 91ccfcd96..e78c763d7 100644
--- a/plugins/listenbrainz/meson.build
+++ b/plugins/listenbrainz/meson.build
@@ -17,3 +17,10 @@ listenbrainz_plugin_descriptor = custom_target('listenbrainz-plugin-descriptor',
   command: [intltool_merge, '--quiet', '--desktop-style', meson.source_root() + '/po', '@INPUT@', 
'@OUTPUT@'],
   install: true,
   install_dir: listenbrainz_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/lyrics/meson.build b/plugins/lyrics/meson.build
index a3652969f..39bba07b8 100644
--- a/plugins/lyrics/meson.build
+++ b/plugins/lyrics/meson.build
@@ -26,3 +26,10 @@ lyrics_plugin_descriptor = custom_target('lyrics-plugin-descriptor',
 
 install_data('lyrics-prefs.ui',
   install_dir: lyrics_plugin_data_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/magnatune/meson.build b/plugins/magnatune/meson.build
index d1768692e..121d06f33 100644
--- a/plugins/magnatune/meson.build
+++ b/plugins/magnatune/meson.build
@@ -28,3 +28,10 @@ install_data([
   install_dir: magnatune_plugin_data_dir)
 
 subdir('icons/hicolor/scalable/places/')
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/pythonconsole/meson.build b/plugins/pythonconsole/meson.build
index 345faa774..d89e10105 100644
--- a/plugins/pythonconsole/meson.build
+++ b/plugins/pythonconsole/meson.build
@@ -12,3 +12,10 @@ pythonconsole_plugin_descriptor = custom_target('pythonconsole-plugin-descriptor
   command: [intltool_merge, '--quiet', '--desktop-style', meson.source_root() + '/po', '@INPUT@', 
'@OUTPUT@'],
   install: true,
   install_dir: pythonconsole_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/rb/meson.build b/plugins/rb/meson.build
index 4f576c80f..267ed6f93 100644
--- a/plugins/rb/meson.build
+++ b/plugins/rb/meson.build
@@ -16,3 +16,10 @@ rb_plugin_files = [
 
 install_data(rb_plugin_files,
   install_dir: rb_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/rbzeitgeist/meson.build b/plugins/rbzeitgeist/meson.build
index 4c26e6273..997dcdd18 100644
--- a/plugins/rbzeitgeist/meson.build
+++ b/plugins/rbzeitgeist/meson.build
@@ -12,3 +12,10 @@ rbzeitgeist_plugin_descriptor = custom_target('rbzeitgeist-plugin-descriptor',
   command: [intltool_merge, '--quiet', '--desktop-style', meson.source_root() + '/po', '@INPUT@', 
'@OUTPUT@'],
   install: true,
   install_dir: rbzeitgeist_plugin_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/replaygain/meson.build b/plugins/replaygain/meson.build
index 38b92f917..48a089ec3 100644
--- a/plugins/replaygain/meson.build
+++ b/plugins/replaygain/meson.build
@@ -18,3 +18,10 @@ replaygain_plugin_descriptor = custom_target('replaygain-plugin-descriptor',
 
 install_data('replaygain-prefs.ui',
   install_dir: replaygain_plugin_data_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.ui ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin 
${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/soundcloud/meson.build b/plugins/soundcloud/meson.build
index 1e6e8df1f..6bbe52620 100644
--- a/plugins/soundcloud/meson.build
+++ b/plugins/soundcloud/meson.build
@@ -19,3 +19,10 @@ install_data(['soundcloud.ui', 'powered-by-soundcloud.png'],
 
 install_data(['icons/hicolor/scalable/places/soundcloud-symbolic.svg'],
   install_dir: soundcloud_plugin_data_dir + '/icons/hicolor/scalable/places')
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.py 
${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.ui ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/*.plugin 
${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', check: true)
+endif
diff --git a/plugins/webremote/meson.build b/plugins/webremote/meson.build
index 532b5bfc6..58092c064 100644
--- a/plugins/webremote/meson.build
+++ b/plugins/webremote/meson.build
@@ -29,3 +29,10 @@ install_data('webremote.html',
 
 install_data('webremote-config.ui',
   install_dir: webremote_plugin_data_dir)
+
+if get_option('uninstalled_build')
+  # This is a hack to collect all Python source files for this plugin
+  # in the build tree, so uninstalled Rhythmbox can load it.
+  sh = find_program('sh')
+  run_command(sh, '-c', 'cp -a ${MESON_SOURCE_ROOT}/${MESON_SUBDIR}/* ${MESON_BUILD_ROOT}/${MESON_SUBDIR}/', 
check: true)
+endif
diff --git a/shell/meson.build b/shell/meson.build
index 846136f64..7e316ad89 100644
--- a/shell/meson.build
+++ b/shell/meson.build
@@ -95,7 +95,7 @@ librhythmbox_core = shared_library('rhythmbox_core',
   include_directories: rhythmbox_core_include_directories,
   dependencies: [rhythmbox_core_dependencies,  mediaplayerid_dep, rhythmdb_dep,
     rbbackends_dep, rbpodcast_dep, rbwidgets_dep, sources_dep],
-  install: 'true',
+  install: true,
   link_args: ['-export-dynamic'],
   link_whole: [librb, rbwidgets_lib, sources_lib],
   version: '@0@.@1@.@2@'.format(RHYTHMBOX_CORE_CURRENT, RHYTHMBOX_CORE_REVISION, RHYTHMBOX_CORE_AGE)


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