~popey/+junk/kodi

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash

set -x

case "$SNAP_ARCH" in
    "amd64") ARCH='x86_64-linux-gnu'
    ;;
    "i386") ARCH='i386-linux-gnu'
    ;;
    *)
        echo "Unsupported architecture for this app build"
        exit 1
    ;;
esac

VENDOR=$(glxinfo | grep "OpenGL vendor")
echo "VENDOR:" $VENDOR

if [[ $VENDOR == *"Intel"* ]]; then
  export VDPAU_DRIVER_PATH="$SNAP/usr/lib/$ARCH/dri"
  export LIBVA_DRIVERS_PATH="$SNAP/usr/lib/$ARCH/dri"
fi

if [[ $VENDOR == *"NVIDIA"* ]]; then
  export VDPAU_DRIVER_PATH="/var/lib/snapd/lib/gl/vdpau"
elif [[ $VENDOR == *"X.Org"* ]]; then
  export VDPAU_DRIVER_PATH="/usr/lib/$ARCH/vdpau/"
fi

exec "$@"