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:
parent
0847250505
commit
f5f4bf1a25
@ -20,23 +20,16 @@ oldRPath=$(patchelf --print-rpath $out/bin/higan)
|
|||||||
patchelf --set-rpath $oldRPath:$out/lib $out/bin/higan
|
patchelf --set-rpath $oldRPath:$out/lib $out/bin/higan
|
||||||
|
|
||||||
# A dirty workaround, suggested by @cpages:
|
# A dirty workaround, suggested by @cpages:
|
||||||
# we create a wrapper script to set up
|
# we create a first-run script to populate
|
||||||
# $HOME local configuration before higan runs
|
# 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-config.sh
|
||||||
cat <<EOF > $out/bin/higan
|
#!${shell}
|
||||||
|
|
||||||
#!/bin/bash
|
cp --update --recursive $out/share/higan \$HOME/.config
|
||||||
if [ ! -e \$HOME/.config/higan/.was_configured ]
|
chmod --recursive u+w \$HOME/.config/higan
|
||||||
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 "\$@"
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
patchShebangs $out/bin/higan
|
chmod +x $out/bin/higan-config.sh
|
||||||
chmod +x $out/bin/higan
|
|
||||||
|
Loading…
Reference in New Issue
Block a user