Support mir-libs content snap #54

Merged
merged 3 commits into from Feb 22, 2017
View
@@ -30,12 +30,26 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBGL_DRIVERS_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/var/lib/snapd/lib/gl
# Mir
-export MIR_CLIENT_PLATFORM_PATH=$RUNTIME/usr/lib/$ARCH/mir/client-platform
-export MIR_SOCKET=/run/user/$(id -u)/mir_socket
-if [ ! -S "$MIR_SOCKET" -a -S /run/mir_socket ]; then
+if [ -S /run/user/$(id -u)/mir_socket ]; then
+ export MIR_SOCKET=/run/user/$(id -u)/mir_socket
+elif [ -S /run/mir_socket ]; then
# Fall back to global location if there is no user server (e.g. on a kiosk)
export MIR_SOCKET=/run/mir_socket
fi
+if [ -d $SNAP/mir-libs/$ARCH ]; then
+ export MIR_CLIENT_PLATFORM_PATH=$SNAP/mir-libs/$ARCH/mir/client-platform
+ # Put mir-libs first because it's easy to end up with a snap-internal copy
+ export LD_LIBRARY_PATH=$SNAP/mir-libs/$ARCH:$LD_LIBRARY_PATH
+elif [ -d $RUNTIME/usr/lib/$ARCH/mir ]; then
+ # As of this writing, ubuntu-app-platform holds a copy of the Mir libraries,
+ # but may remove them in favor of mir-libs. Use them if present.
+ # We check both RUNTIME and SNAP (below) because if the SDK does drop the
+ # libraries, we want to fall back to an internal copy transparently.
+ export MIR_CLIENT_PLATFORM_PATH=$RUNTIME/usr/lib/$ARCH/mir/client-platform
+else
+ # Fall back to internal copy.
+ export MIR_CLIENT_PLATFORM_PATH=$SNAP/usr/lib/$ARCH/mir/client-platform
+fi
# Unity7 export (workaround for https://launchpad.net/bugs/1638405)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUNTIME/usr/lib/$ARCH/libunity
View
@@ -41,6 +41,13 @@ description: |
target: ubuntu-app-platform
and then make your apps use it:
plugs: [platform]
+ - access to Mir:
+ plugs:
+ mir:
+ mir-libs:
+ default-provider: mir-libs
+ interface: content
+ target: mir-libs
- similarly for the gnome platform based apps
plugs:
gnome318-platform:
@@ -76,6 +83,9 @@ parts:
- libgtk2.0-bin
- unity-gtk2-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
gtk3:
source: .
source-subdir: gtk
@@ -95,6 +105,9 @@ parts:
- libgtk-3-bin
- unity-gtk3-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
qt4:
source: .
source-subdir: qt
@@ -114,6 +127,9 @@ parts:
- libqt4-svg # for loading icon themes which are svg
- appmenu-qt
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
qt5:
source: .
source-subdir: qt
@@ -133,6 +149,9 @@ parts:
- libqt5svg5 # for loading icon themes which are svg
- appmenu-qt5
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
glib-only:
source: .
source-subdir: glib-only
@@ -160,6 +179,9 @@ parts:
- libgtk2.0-bin
- unity-gtk2-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop/gtk3:
source: .
source-subdir: gtk
@@ -179,6 +201,9 @@ parts:
- libgtk-3-bin
- unity-gtk3-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop/qt4:
source: .
source-subdir: qt
@@ -198,6 +223,9 @@ parts:
- libqt4-svg # for loading icon themes which are svg
- appmenu-qt
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop/qt5:
source: .
source-subdir: qt
@@ -217,6 +245,9 @@ parts:
- libqt5svg5 # for loading icon themes which are svg
- appmenu-qt5
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop/glib-only:
source: .
source-subdir: glib-only
@@ -244,6 +275,9 @@ parts:
- libgtk2.0-bin
- unity-gtk2-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop-gtk3:
source: .
source-subdir: gtk
@@ -263,6 +297,9 @@ parts:
- libgtk-3-bin
- unity-gtk3-module
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop-qt4:
source: .
source-subdir: qt
@@ -282,6 +319,9 @@ parts:
- libqt4-svg # for loading icon themes which are svg
- appmenu-qt
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop-qt5:
source: .
source-subdir: qt
@@ -301,6 +341,9 @@ parts:
- libqt5svg5 # for loading icon themes which are svg
- appmenu-qt5
- locales-all
+ prime:
+ - -usr/lib/*/libmir*
+ - -usr/share/doc/libmir*
desktop-glib-only:
source: .
source-subdir: glib-only