Merge lp:~sil2100/unity/add_libunity_rpath into lp:unity

Proposed by Łukasz Zemczak on 2012-08-02
Status: Merged
Approved by: Michal Hruby on 2012-08-03
Approved revision: 2534
Merged at revision: 2537
Proposed branch: lp:~sil2100/unity/add_libunity_rpath
Merge into: lp:unity
Diff against target: 53 lines (+9/-1)
3 files modified
CMakeLists.txt (+3/-0)
UnityCore/CMakeLists.txt (+3/-1)
plugins/unityshell/CMakeLists.txt (+3/-0)
To merge this branch: bzr merge lp:~sil2100/unity/add_libunity_rpath
Reviewer Review Type Date Requested Status
Michal Hruby (community) 2012-08-02 Approve on 2012-08-03
jenkins continuous-integration Pending
Review via email: mp+117941@code.launchpad.net

Commit Message

Add the libunity private directory to unityshell.so and libunity-core-6.0.so RPATHs, so that they can easily find the libunity-protocol-private.so library on load.

Description of the Change

Attempt to fix the problem with libunity-protocol-private not found.

- Problem:
Currently unityshell.so depends on libunity-protocol-private.so from the libunity-protocol-private0 package. That's all fine and dandy, but the package actually installs libunity-protocol-private.so in a private directory (/usr/lib/<arch>/libunity) and ld.so cannot find it during unityshell.so plugin loading.

Because of this, unity staging is *broken*.

- Fix:
After some consultation with Didier, we decided to deal with it using RPATH. It's cleaner than using ld.so.conf or other magicks. This is just a proposition of a fix - if anyone has a better idea, please comment.
In this approach we're instructing CMake to add the unity-protocol-private directory to the RPATH when linking the unityshell target. Excuse my lacking CMake foo here.

- Tests:
Not applicable.

To post a comment you must log in.
Michal Hruby (mhr3) wrote :

Shouldn't the same thing be done when linking unity-core?

review: Needs Information
Łukasz Zemczak (sil2100) wrote :

Ah, shit - right about that. Will update it in a moment. Thanks for noticing!

lp:~sil2100/unity/add_libunity_rpath updated on 2012-08-03
2531. By Łukasz Zemczak on 2012-08-03

Also added the same RPATH for unity-core.

2532. By Łukasz Zemczak on 2012-08-03

Merge in latest trunk changes

2533. By Łukasz Zemczak on 2012-08-03

Fixed some build issues to incomplete merges and invalid thought process

Michal Hruby (mhr3) wrote :

26 pkg_check_modules (CORE_DEPS REQUIRED glib-2.0 gio-2.0 dee-1.0 sigc++-2.0 nux-core-3.0 gdk-pixbuf-2.0 unity-protocol-private)

The proto lib shouldn't be there I guess?

review: Needs Fixing
lp:~sil2100/unity/add_libunity_rpath updated on 2012-08-03
2534. By Łukasz Zemczak on 2012-08-03

As proposed by mhr3, we just re-add unity-protocol-private to the main deps

Michal Hruby (mhr3) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-07-27 20:20:29 +0000
3+++ CMakeLists.txt 2012-08-03 12:53:20 +0000
4@@ -133,11 +133,14 @@
5 #
6 # Compiz Plugins
7 #
8+
9 set (UNITY_PLUGIN_DEPS "compiz;nux-3.0>=3.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;gconf-2.0;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;xfixes;unity-protocol-private>=5.93.1")
10 # FIXME: unity-protocol-private shouldn't be there, but building of unityshell is just broken
11+set (UNITY_PROTOCOL_PRIVATE_DEPS "unity-protocol-private>=5.93.1")
12
13 find_package (PkgConfig)
14 pkg_check_modules (CACHED_UNITY_DEPS REQUIRED ${UNITY_PLUGIN_DEPS})
15+pkg_check_modules (CACHED_UNITY_PRIVATE_DEPS REQUIRED ${UNITY_PROTOCOL_PRIVATE_DEPS})
16 add_subdirectory(unity-shared)
17 add_subdirectory(panel)
18 add_subdirectory(dash)
19
20=== modified file 'UnityCore/CMakeLists.txt'
21--- UnityCore/CMakeLists.txt 2012-07-04 08:58:36 +0000
22+++ UnityCore/CMakeLists.txt 2012-08-03 12:53:20 +0000
23@@ -1,5 +1,6 @@
24 find_package (PkgConfig)
25 pkg_check_modules (CORE_DEPS REQUIRED glib-2.0 gio-2.0 dee-1.0 sigc++-2.0 nux-core-3.0 gdk-pixbuf-2.0 unity-protocol-private)
26+pkg_check_modules (PRIVATE_CORE_DEPS REQUIRED unity-protocol-private)
27
28 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} unity --variable lensesdir OUTPUT_VARIABLE _lensesdir OUTPUT_STRIP_TRAILING_WHITESPACE)
29
30@@ -124,7 +125,8 @@
31 add_library (${CORE_LIB_NAME} SHARED ${CORE_SOURCES})
32 set_target_properties(${CORE_LIB_NAME} PROPERTIES
33 VERSION ${CORE_LIB_LT_CURRENT}.${CORE_LIB_LT_REV}.${CORE_LIB_LT_AGE}
34- SOVERSION ${CORE_LIB_LT_CURRENT})
35+ SOVERSION ${CORE_LIB_LT_CURRENT}
36+ INSTALL_RPATH "${PRIVATE_CORE_DEPS_LIBRARY_DIRS}")
37
38 install (TARGETS ${CORE_LIB_NAME}
39 RUNTIME DESTINATION bin
40
41=== modified file 'plugins/unityshell/CMakeLists.txt'
42--- plugins/unityshell/CMakeLists.txt 2012-05-28 01:32:17 +0000
43+++ plugins/unityshell/CMakeLists.txt 2012-08-03 12:53:20 +0000
44@@ -12,6 +12,9 @@
45 )
46 add_dependencies(unityshell unity-core-${UNITY_API_VERSION} dash-lib launcher-lib switcher-lib hud-lib panel-lib shortcuts-lib unity-shared unity-shared-compiz)
47 target_link_libraries(unityshell unity-core-${UNITY_API_VERSION} launcher-lib dash-lib switcher-lib hud-lib panel-lib shortcuts-lib unity-shared unity-shared-compiz)
48+set_target_properties(unityshell
49+ PROPERTIES INSTALL_RPATH "${CACHED_UNITY_PRIVATE_DEPS_LIBRARY_DIRS}"
50+ INSTALL_RPATH_USE_LINK_PATH TRUE)
51
52 #
53 # Data