#!/bin/sh

. config/options $1

mkdir -p $INSTALL/usr/lib
  cp -P $PKG_BUILD/lib/libGL.so.1.2 $INSTALL/usr/lib/libGL_mesa.so.1 # rename for cooperate with nvidia drivers
    ln -sf libGL.so.1 $INSTALL/usr/lib/libGL.so
    ln -sf /var/lib/libGL.so $INSTALL/usr/lib/libGL.so.1
  cp -P $PKG_BUILD/lib/libGLU.so* $INSTALL/usr/lib

mkdir -p $INSTALL/usr/lib/dri
  cp -P $PKG_BUILD/lib/*_dri.so $INSTALL/usr/lib/dri || true
  cp -P $PKG_BUILD/lib/gallium/*_dri.so $INSTALL/usr/lib/dri || true

mkdir -p $INSTALL/usr/lib/xorg/modules/drivers
  cp -P $PKG_BUILD/lib/gallium/*_drv.so $INSTALL/usr/lib/xorg/modules/drivers || true
