#!/bin/sh

. config/options

$SCRIPTS/install libXdamage
$SCRIPTS/install libdrm
$SCRIPTS/install expat
$SCRIPTS/install libXext
$SCRIPTS/install libXfixes
$SCRIPTS/install libXxf86vm
$SCRIPTS/install libxcb
$SCRIPTS/install libX11

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

if [ "$DEVTOOLS" = yes ]; then
  mkdir -p $INSTALL/usr/bin
    cp -P $PKG_BUILD/progs/xdemos/glxdemo $INSTALL/usr/bin
    cp -P $PKG_BUILD/progs/xdemos/glxgears $INSTALL/usr/bin
    cp -P $PKG_BUILD/progs/xdemos/glxinfo $INSTALL/usr/bin
fi
