From 31c64f0a199d5630cd86eb2d2258d62981a9d859 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Wed, 16 May 2018 07:25:13 +0200 Subject: [PATCH] snap: make anbox work on systems with GLVND Systems with GLVND load the actual EGL implementation in a different way when the GL driver is dlopen'ed and therefor we need to tell GLVND which vendor implementations are available on the system. As snapd is not yet exposing this to the snap we have to ship a small set of configs on our own until that is fixed. --- data/glvnd/10_nvidia.json | 6 ++++++ data/glvnd/50_mesa.json | 6 ++++++ scripts/snap-wrapper.sh | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 data/glvnd/10_nvidia.json create mode 100644 data/glvnd/50_mesa.json diff --git a/data/glvnd/10_nvidia.json b/data/glvnd/10_nvidia.json new file mode 100644 index 0000000..2bfcca0 --- /dev/null +++ b/data/glvnd/10_nvidia.json @@ -0,0 +1,6 @@ +{ + "file_format_version" : "1.0.0", + "ICD" : { + "library_path" : "libEGL_nvidia.so.0" + } +} diff --git a/data/glvnd/50_mesa.json b/data/glvnd/50_mesa.json new file mode 100644 index 0000000..8aaaa10 --- /dev/null +++ b/data/glvnd/50_mesa.json @@ -0,0 +1,6 @@ +{ + "file_format_version" : "1.0.0", + "ICD" : { + "library_path" : "libEGL_mesa.so.0" + } +} diff --git a/scripts/snap-wrapper.sh b/scripts/snap-wrapper.sh index 5cb0db0..60cb85e 100755 --- a/scripts/snap-wrapper.sh +++ b/scripts/snap-wrapper.sh @@ -22,4 +22,11 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/lib # launchers. export XDG_DATA_HOME="$SNAP_USER_COMMON/app-data" +# In order to support GLVND based systems we need to work around a bug in snapd +# as it does not yet expose the EGL vendor configurations from the host to snaps. +# As long as this isn't fixed we have to carry a set of configs on our own which +# may map to the host. GLVND will handle situation properly where a vendor is +# configured but the actual EGL implementation is missing. +export __EGL_VENDOR_LIBRARY_DIRS="$SNAP/glvnd" + exec $SNAP/usr/bin/anbox $@