2006-01-28 02:10:26 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
# This is a very dirty hack to prevent the binaries from putting the
|
|
|
|
# Mesa libraries in their RPATHs.
|
|
|
|
ensureDir $out/tmp
|
|
|
|
ln -s $mesa/lib/* $out/tmp/
|
|
|
|
ensureDir $out/lib
|
|
|
|
ln -s $mesa/lib/libGLU* $out/lib/
|
|
|
|
export NIX_LDFLAGS="-L$out/tmp $NIX_LDFLAGS"
|
|
|
|
|
|
|
|
genericBuild
|
|
|
|
|
|
|
|
rm -rf $out/tmp
|
|
|
|
|
|
|
|
|
|
|
|
# Add a wrapper around each program to use the appropriate OpenGL driver.
|
|
|
|
ensureDir $out/bin/.orig
|
|
|
|
|
|
|
|
for i in $(cd $out/bin && ls); do
|
|
|
|
mv $out/bin/$i $out/bin/.orig/$i
|
|
|
|
cat >$out/bin/$i <<EOF
|
2006-01-30 11:44:39 +00:00
|
|
|
#! $SHELL -e
|
|
|
|
|
2006-01-28 02:10:26 +00:00
|
|
|
mesa=$mesa
|
|
|
|
|
|
|
|
$(cat $mesaSwitch)
|
|
|
|
|
|
|
|
exec $out/bin/.orig/$i "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/$i
|
|
|
|
done
|