summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2014-11-21 00:54:18 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2014-11-21 01:02:34 +0100
commitcf1e187aff349e4f3d440e97ff75786c0ae5deaa (patch)
treed09b9c824e40e16939e05f37b8fb70829b7c8dce
parentdb5ebf8f9de8152fc64df945bf70a34fe9309853 (diff)
debian: add support for update-alternative
In Ubuntu mesa EGL is using Debian Alternatives system, so that multiple EGL implementation can be installed simultaneously in the root file system. Once we install adreno-egl, it is configured as an 'alternative' in the group "${DEB_HOST_MULTIARCH}_egl_conf", e.g. arm-linux-gnueabihf_egl_conf in this specific case. The method consists of adding a custom load configuration file in /etc/ld.conf.so.d, which is updated when we configure the *current* alternatives. To list all registered alternatives: $ update-alternative --list arm-linux-gnueabihf_egl_conf To configure which alternative should be *current*: $ update-alternative --config arm-linux-gnueabihf_egl_conf Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r--debian/adreno-egl.postinst22
-rw-r--r--debian/adreno-egl.preinst20
-rwxr-xr-xdebian/rules7
3 files changed, 49 insertions, 0 deletions
diff --git a/debian/adreno-egl.postinst b/debian/adreno-egl.postinst
new file mode 100644
index 0000000..f96606a
--- /dev/null
+++ b/debian/adreno-egl.postinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+THIS_PACKAGE=adreno-egl
+THIS_SCRIPT=postinst
+
+case "$1" in
+ configure)
+ # Use alternatives to make it easier to switch between Mesa and 3rd party modules
+ update-alternatives --force \
+ --install /etc/ld.so.conf.d/${DEB_HOST_MULTIARCH}_EGL.conf ${DEB_HOST_MULTIARCH}_egl_conf /usr/lib/${DEB_HOST_MULTIARCH}/adreno-egl/ld.so.conf 100 \
+
+ # ldconfig needs to be run immediately as we're changing /etc/ld.so.conf.d/ with
+ # alternatives.
+ LDCONFIG_NOTRIGGER=y ldconfig
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/adreno-egl.preinst b/debian/adreno-egl.preinst
new file mode 100644
index 0000000..56fd1f3
--- /dev/null
+++ b/debian/adreno-egl.preinst
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+THIS_PACKAGE=adreno-mesa
+THIS_SCRIPT=prerm
+
+case "$1" in
+ remove)
+ # Use alternatives to make it easier to switch between Mesa and 3rd party modules
+ update-alternatives --remove ${DEB_HOST_MULTIARCH}_egl_conf /usr/lib/${DEB_HOST_MULTIARCH}/adreno-egl/ld.so.conf
+
+ # explicit ldconfig due to alternatives
+ ldconfig
+
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index c642495..50ba2c6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,6 +24,13 @@ include /usr/share/dpkg/default.mk
override_dh_auto_build:
tar -xf adreno-ubuntu.tar.gz
+override_dh_install:
+ dh_install
+
+ # Create an ld.so.conf which says where to find libEGL, libGLES{1,2}
+ echo "/usr/lib/$(DEB_HOST_MULTIARCH)/adreno-egl" \
+ > $(CURDIR)/debian/adreno-egl/usr/lib/$(DEB_HOST_MULTIARCH)/adreno-egl/ld.so.conf
+
override_dh_auto_clean:
rm -rf usr