32 lines
1.2 KiB
Nix
32 lines
1.2 KiB
Nix
|
{ stdenv, mkXPlaneAddon }:
|
||
|
|
||
|
mkXPlaneAddon {
|
||
|
pname = "beautiful-roads";
|
||
|
version = "2";
|
||
|
|
||
|
fname = "ARIF-ROADS-RAILS.zip";
|
||
|
sha256 = "152150k7avnjma53b8x7d790lqd2dk35913aw8z8bkgcz5jdi1y4";
|
||
|
forumlink = "https://forums.x-plane.org/index.php?/files/file/42414-beautiful-roads-and-rails-for-xp-113/";
|
||
|
buildCommand = ''
|
||
|
unzip $src ARIF-ROADS-RAILS/textures/\*
|
||
|
mv ARIF-ROADS-RAILS/textures $out
|
||
|
'';
|
||
|
passthru = {
|
||
|
build = ''
|
||
|
ln -s $ADDONPATH $out/xplane-extra/beautiful-roads
|
||
|
'';
|
||
|
prepare = ''
|
||
|
mv "$XPLANEPATH/Resources/default scenery/1000 roads/textures" "$XPLANEPATH/Resources/default scenery/1000 roads/textures.orig"
|
||
|
ln -s /xplane-extra/beautiful-roads "$XPLANEPATH/Resources/default scenery/1000 roads/textures"
|
||
|
'';
|
||
|
revert = ''
|
||
|
if [ -L "$XPLANEPATH/Resources/default scenery/1000 roads/textures" -a -d "$XPLANEPATH/Resources/default scenery/1000 roads/textures.orig" ]; then
|
||
|
rm "$XPLANEPATH/Resources/default scenery/1000 roads/textures"
|
||
|
mv "$XPLANEPATH/Resources/default scenery/1000 roads/textures.orig" "$XPLANEPATH/Resources/default scenery/1000 roads/textures"
|
||
|
else
|
||
|
false
|
||
|
fi
|
||
|
'';
|
||
|
};
|
||
|
}
|