about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@gmail.com>2014-08-31 09:45:44 -0300
committerAndersonTorres <torres.anderson.85@gmail.com>2014-08-31 09:47:49 -0300
commitf5f4bf1a25464e03441c852c791f7ee8780536a1 (patch)
treea65bb346741c9d55700d24a839b4f28482088d7a /pkgs/misc
parent0847250505aab535ecdc35c6b8f3c87d8f9dd0fe (diff)
downloadnixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar.gz
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar.bz2
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar.lz
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar.xz
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.tar.zst
nixlib-f5f4bf1a25464e03441c852c791f7ee8780536a1.zip
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.
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/emulators/higan/builder.sh27
1 files changed, 10 insertions, 17 deletions
diff --git a/pkgs/misc/emulators/higan/builder.sh b/pkgs/misc/emulators/higan/builder.sh
index a99ccf26dbbd..0d01f7dc971f 100644
--- a/pkgs/misc/emulators/higan/builder.sh
+++ b/pkgs/misc/emulators/higan/builder.sh
@@ -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
-
-mv $out/bin/higan $out/bin/.higan-wrapped
-cat <<EOF > $out/bin/higan 
-
-#!/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 "\$@"
+# we create a first-run script to populate
+# the local $HOME with all the auxiliary
+# stuff needed by higan at runtime
+
+cat <<EOF > $out/bin/higan-config.sh
+#!${shell}
+
+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