3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/misc/screensavers/rss-glx/builder.sh
Eelco Dolstra c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00

32 lines
607 B
Bash

source $stdenv/setup
# This is a very dirty hack to prevent the binaries from putting the
# Mesa libraries in their RPATHs.
mkdir -p $out/tmp
ln -s $mesa/lib/* $out/tmp/
mkdir -p $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.
mkdir -p $out/bin/.orig
for i in $(cd $out/bin && ls); do
mv $out/bin/$i $out/bin/.orig/$i
cat >$out/bin/$i <<EOF
#! $SHELL -e
mesa=$mesa
$(cat $mesaSwitch)
exec $out/bin/.orig/$i "\$@"
EOF
chmod +x $out/bin/$i
done