
LIBXCBSO="`find ./ -name "libxcb.so*" | tr '\n' ' '`"
LIBXCBRENDER="`find ./ -name "libxcb-render*" | tr '\n' ' '`"
LIBXCBXV="`find ./ -name "libxcb-xv*" | tr '\n' ' '`"
#xine-lib needs these two...
LIBXCBshape="`find ./ -name "libxcb-shape*" | tr '\n' ' '`"
LIBXCBshm="`find ./ -name "libxcb-shm*" | tr '\n' ' '`"

#building wary 019 (tpup with xorg7.3) 13 april 2010, needs this...
LIBXCBXLIB="`find ./ -name "libxcb-xlib*" | tr '\n' ' '`"

#extras for spup
LIBXCBres="`find ./ -name "libxcb-res*" | tr '\n' ' '`"
LIBXCBxevie="`find ./ -name "libxcb-xevie*" | tr '\n' ' '`"
LIBXCBxvmc="`find ./ -name "libxcb-xvmc*" | tr '\n' ' '`"
LIBXCBdamage="`find ./ -name "libxcb-damage*" | tr '\n' ' '`"
LIBXCBrecord="`find ./ -name "libxcb-record*" | tr '\n' ' '`"
LIBXCBdpms="`find ./ -name "libxcb-dpms*" | tr '\n' ' '`"
LIBXCBglx="`find ./ -name "libxcb-glx*" | tr '\n' ' '`"
LIBXCBscreensaver="`find ./ -name "libxcb-screensaver*" | tr '\n' ' '`"
LIBXCBrandr="`find ./ -name "libxcb-randr*" | tr '\n' ' '`"
#LIBXCBdri2="`find ./ -name "libxcb-dri2*" | tr '\n' ' '`"
LIBXCBcomposite="`find ./ -name "libxcb-composite*" | tr '\n' ' '`"

XCBDIR="`find ./ -type f -name "libxcb.so*" | head -n 1`"
XCBDIR="`dirname $XCBDIR`"

#mesa_base pkg libegl* needs these...
LIBXCBdri="`find ./ -name "libxcb-dri*" | tr '\n' ' '`"
LIBXCBxfixes="`find ./ -name "libxcb-xfixes*" | tr '\n' ' '`"

#111204 debian squeeze needs these...
LIBXCBatom="`find ./ -name "libxcb-atom*" | tr '\n' ' '`"
LIBXCBaux="`find ./ -name "libxcb-aux*" | tr '\n' ' '`"
LIBXCBevent="`find ./ -name "libxcb-event*" | tr '\n' ' '`"

mkdir -p /tmp/libxcb
for ONEFILE in $LIBXCBSO $LIBXCBRENDER $LIBXCBXV $LIBXCBshape $LIBXCBshm $LIBXCBXLIB $LIBXCBdri $LIBXCBxfixes $LIBXCBres $LIBXCBxevie $LIBXCBxvmc $LIBXCBdamage $LIBXCBrecord $LIBXCBdpms $LIBXCBglx $LIBXCBscreensaver $LIBXCBrandr $LIBXCBcomposite $LIBXCBatom $LIBXCBaux $LIBXCBevent
do
 cp -a -f $ONEFILE /tmp/libxcb/
done

#PATHOK='no'
#[ "$XCBDIR" = "./usr/X11R7/lib" ] && PATHOK='yes'
#[ "$XCBDIR" = "./usr/lib" ] && PATHOK='yes'
#[ "$PATHOK" = "yes" ] && rm -rf ${XCBDIR}/*
rm -rf ./usr/lib/* 2>/dev/null
rm -rf ./usr/X11R7/lib/* 2>/dev/null
cp -a /tmp/libxcb/* ${XCBDIR}/

#120325 ubuntu precise pangolin. tried to run 'viewnior' pkg from wary, missing 'libxcb-xlib.so.0'...
OLDXCBLIB="`find ./usr -name libxcb-xlib.so.0`" #this is only in the old libxcb version 0.x.
[ ! "$OLDXCBLIB" ] && ln -s libX11.so.6 usr/lib/libxcb-xlib.so.0 #dummy link.
#...note, wary does this in it's zz_wary52_fixup pkg.
