cataclysmDDA: launch the wrapped program

This commit is contained in:
Mitsuhiro Nakamura 2020-04-23 19:22:58 +09:00
parent d472eed4b5
commit bbe7b86eea

View File

@ -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
'';
}