#!/bin/bash # This script is designed to tweak the system for eselect-opengl/opengl-update. # move symlinks to a malleable /etc/opengl directory. install -d test/lib/modules/extensions # First, we remove all of the symlinks, so we can point them to our own # /etc/opengl directory rm -f /usr/lib*/libGL{,core}.{a,so}* > /dev/null 2>&1 rm -f /usr/lib*/modules/extensions/libglx* > /dev/null 2>&1 rm -f /usr/lib*/xorg/modules/extensions/libglx* > /dev/null 2>&1 # We start with the "default" libdir of /usr/lib ln -sf /etc/opengl/lib/libGL.so /usr/lib/libGL.so ln -sf /etc/opengl/lib/libGL.so.1 /usr/lib/libGL.so.1 ln -sf /etc/opengl/lib/libGLcore.so /usr/lib/libGLcore.so ln -sf /etc/opengl/lib/libGLcore.so.1 /usr/lib/libGLcore.so.1 ln -sf /etc/opengl/lib/libGL.la /usr/lib/libGL.la # We then check for /usr/lib32 if [ -d /usr/lib32 ] then ln -sf /etc/opengl/lib32/libGL.so /usr/lib32/libGL.so ln -sf /etc/opengl/lib32/libGL.so.1 /usr/lib32/libGL.so.1 ln -sf /etc/opengl/lib32/libGLcore.so /usr/lib32/libGLcore.so ln -sf /etc/opengl/lib32/libGLcore.so.1 /usr/lib32/libGLcore.so.1 ln -sf /etc/opengl/lib32/libGL.la /usr/lib32/libGL.la fi # We create symlinks fo the libglx.so and libglx.a if [ -d /usr/lib/modules/extensions ] then ln -sf /etc/opengl/lib/modules/extensions/libglx.so \ /usr/lib/modules/extensions/libglx.so ln -sf /etc/opengl/lib/modules/extensions/libglx.a \ /usr/lib/modules/extensions/libglx.a if [ -d /usr/lib32 ] then ln -sf /etc/opengl/lib32/modules/extensions/libglx.so \ /usr/lib32/modules/extensions/libglx.so ln -sf /etc/opengl/lib32/modules/extensions/libglx.a \ /usr/lib32/modules/extensions/libglx.a fi elif [ -d /usr/lib/xorg/modules/extensions ] then ln -sf /etc/opengl/lib/modules/extensions/libglx.so \ /usr/lib/xorg/modules/extensions/libglx.so ln -sf /etc/opengl/lib/modules/extensions/libglx.a \ /usr/lib/xorg/modules/extensions/libglx.a if [ -d /usr/lib32 ] then ln -sf /etc/opengl/lib32/modules/extensions/libglx.so \ /usr/lib32/xorg/modules/extensions/libglx.so ln -sf /etc/opengl/lib32/modules/extensions/libglx.a \ /usr/lib32/xorg/modules/extensions/libglx.a fi fi