summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@gmail.com>2014-08-30 23:48:45 -0300
committerAndersonTorres <torres.anderson.85@gmail.com>2014-08-30 23:59:49 -0300
commit0847250505aab535ecdc35c6b8f3c87d8f9dd0fe (patch)
tree27faa93773d2da5876ae9cf8c3993d4053efe94d /pkgs/misc
parentefdb6ecb0cf5be0c340a2abca949db59e9c4ac79 (diff)
downloadnixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar.gz
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar.bz2
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar.lz
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar.xz
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.tar.zst
nixlib-0847250505aab535ecdc35c6b8f3c87d8f9dd0fe.zip
Higan - a quick&dirty workaround
Higan uses a lot of hardcoded paths when it looks for runtime files
as shaders, icons and mainly BIOS files. So, we made a q&d wrapper
script: it copies all these files to $HOME/.config/higan in the 1st
invocation.
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/emulators/higan/builder.sh22
-rw-r--r--pkgs/misc/emulators/higan/default.nix3
2 files changed, 24 insertions, 1 deletions
diff --git a/pkgs/misc/emulators/higan/builder.sh b/pkgs/misc/emulators/higan/builder.sh
index 144c23d39de5..a99ccf26dbbd 100644
--- a/pkgs/misc/emulators/higan/builder.sh
+++ b/pkgs/misc/emulators/higan/builder.sh
@@ -18,3 +18,25 @@ install -m 644 ananke/libananke.so $out/lib/libananke.so.1
 (cd $out/lib && ln -s libananke.so.1 libananke.so)
 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 "\$@"
+
+EOF
+
+patchShebangs $out/bin/higan
+chmod +x $out/bin/higan
diff --git a/pkgs/misc/emulators/higan/default.nix b/pkgs/misc/emulators/higan/default.nix
index aceb55b13967..532eeef2280f 100644
--- a/pkgs/misc/emulators/higan/default.nix
+++ b/pkgs/misc/emulators/higan/default.nix
@@ -44,5 +44,6 @@ stdenv.mkDerivation rec {
 # TODO:
 #   - options to choose profiles (accuracy, balanced, performance)
 #     and different GUIs (gtk2, qt4)
-#   - fix the BML and BIOS paths - maybe a custom patch to Higan project?
+#   - fix the BML and BIOS paths - maybe submitting
+#     a custom patch to Higan project would not be a bad idea...
 #