diff options
author | Mitsuhiro Nakamura <m.nacamura@gmail.com> | 2020-04-23 19:22:58 +0900 |
---|---|---|
committer | Mitsuhiro Nakamura <m.nacamura@gmail.com> | 2020-07-18 14:23:24 +0900 |
commit | bbe7b86eea5cbdf119fcf5ffd82b7ad78c1f60c4 (patch) | |
tree | 2f204e8609c628f18480320cc1ff4e1b39dd6828 /pkgs/games/cataclysm-dda | |
parent | d472eed4b570f9392aad7a4f2a1bdbf2b5fd5bf8 (diff) |
cataclysmDDA: launch the wrapped program
Diffstat (limited to 'pkgs/games/cataclysm-dda')
-rw-r--r-- | pkgs/games/cataclysm-dda/wrapper.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/games/cataclysm-dda/wrapper.nix b/pkgs/games/cataclysm-dda/wrapper.nix index 0a3727c2c1c1..a73c320f9c67 100644 --- a/pkgs/games/cataclysm-dda/wrapper.nix +++ b/pkgs/games/cataclysm-dda/wrapper.nix @@ -28,5 +28,20 @@ else symlinkJoin { wrapProgram $out/bin/cataclysm-tiles \ --add-flags "--datadir $out/share/cataclysm-dda/" fi + + # Launch the wrapped program + replaceProgram() { + cp "$1" "''${1}.bk" + unlink "$1" + mv "''${1}.bk" "$1" + sed -i "$1" -e "s,/nix/store/.\+\(/bin/cataclysm-tiles\),$out\1," + } + for script in "$out/share/applications/cataclysm-dda.desktop" \ + "$out/Applications/Cataclysm.app/Contents/MacOS/Cataclysm.sh" + do + if [ -e "$script" ]; then + replaceProgram "$script" + fi + done ''; } |