43 lines
1.4 KiB
Nix
43 lines
1.4 KiB
Nix
|
{ mkXPlaneAddon }:
|
||
|
|
||
|
mkXPlaneAddon rec {
|
||
|
pname = "fly-with-lua";
|
||
|
version = "2.7.22";
|
||
|
|
||
|
fname = "FlyWithLua_NG_v${version}_Lin_Mac_Win.zip";
|
||
|
sha256 = "1vd1f3vn035jxbg7cqzciba0ibl35kp8q4yirdqvffbzs2id206f";
|
||
|
forumlink = "https://forums.x-plane.org/index.php?/files/file/38445-flywithlua-ng-next-generation-edition-for-x-plane-11-win-lin-mac/";
|
||
|
buildCommand = ''
|
||
|
mkdir -p $out
|
||
|
cd $out
|
||
|
unzip $src
|
||
|
'';
|
||
|
|
||
|
passthru = {
|
||
|
build = ''
|
||
|
ln -s $ADDONPATH/FlyWithLua $out/xplane-extra/FlyWithLua
|
||
|
'';
|
||
|
prepare = ''
|
||
|
mkdir -p "$XPLANEPATH/Resources/plugins/FlyWithLua" "$XPLANEPATH/Resources/plugins/FlyWithLua/Scripts"
|
||
|
for f in fwl_prefs.ini 64 Internals Modules "Scripts (Quarantine)" "Scripts (disabled)"; do
|
||
|
cp -r --no-preserve=mode -t "$XPLANEPATH/Resources/plugins/FlyWithLua" /xplane-extra/FlyWithLua/"$f"
|
||
|
done
|
||
|
for f in user.ini user.exit; do
|
||
|
if [ ! -f "$XPLANEPATH/Resources/plugins/FlyWithLua/$f" ]; then
|
||
|
cp --no-preserve=mode -t "$XPLANEPATH/Resources/plugins/FlyWithLua" /xplane-extra/FlyWithLua/$f
|
||
|
fi
|
||
|
done
|
||
|
touch "$XPLANEPATH/Resources/plugins/FlyWithLua/.prepared"
|
||
|
'';
|
||
|
revert = ''
|
||
|
if [ -f "$XPLANEPATH/Resources/plugins/FlyWithLua/.prepared" ]; then
|
||
|
for f in fwl_prefs.ini 64 Internals Modules "Scripts (disabled)" ; do
|
||
|
rm -r "$XPLANEPATH/Resources/plugins/FlyWithLua/$f"
|
||
|
done
|
||
|
else
|
||
|
false
|
||
|
fi
|
||
|
'';
|
||
|
};
|
||
|
}
|