Higan: Updating builder.sh script

Now builder.sh will install a higan-config.sh script
to write auxiliary stuff on $HOME/.config/higan directory.
That way, higan searches locally and runs cleanly.

Obviously it's a hack, but the only other way is to do a huge patch on
upstream sources; personally I think it is better to work that type of
thing directly on higan sources.
This commit is contained in:
AndersonTorres 2014-08-31 09:45:44 -03:00
parent 0847250505
commit f5f4bf1a25

View File

@ -20,23 +20,16 @@ oldRPath=$(patchelf --print-rpath $out/bin/higan)
patchelf --set-rpath $oldRPath:$out/lib $out/bin/higan
# A dirty workaround, suggested by @cpages:
# we create a wrapper script to set up
# $HOME local configuration before higan runs
# we create a first-run script to populate
# the local $HOME with all the auxiliary
# stuff needed by higan at runtime
mv $out/bin/higan $out/bin/.higan-wrapped
cat <<EOF > $out/bin/higan
cat <<EOF > $out/bin/higan-config.sh
#!${shell}
#!/bin/bash
if [ ! -e \$HOME/.config/higan/.was_configured ]
then
cp --update --recursive $out/share/higan \$HOME/.config
chmod --recursive u+w \$HOME/.config/higan
touch \$HOME/.config/higan/.was_configured
fi
# LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$out/lib
$out/bin/.higan-wrapped "\$@"
cp --update --recursive $out/share/higan \$HOME/.config
chmod --recursive u+w \$HOME/.config/higan
EOF
patchShebangs $out/bin/higan
chmod +x $out/bin/higan
chmod +x $out/bin/higan-config.sh