spacefrogg-overlay/x-plane/headshake/default.nix

45 lines
1.1 KiB
Nix

{ stdenv, cmake, fetchurl, fetchFromGitHub, unzip, xPlaneSDK }:
let
in stdenv.mkDerivation rec {
pname = "headshake";
version = "1.12.10";
src = fetchFromGitHub {
repo = pname;
rev = "v${version}";
owner = "simcodersdotcom";
sha256 = "139kwg28arfrb2z51hpv6dzjs45js5rpp3rrjskjalvd2rkn38zs";
};
patches = [ ./src-path.diff ];
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DCMP_LIN=ON" "-DSDK_PATH=${xPlaneSDK}" ];
installPhase = ''
mkdir -p $out
cp -r ../bin/Release/HeadShake/* $out
'';
passthru = {
# $out is the output path of the FHS environment
build = ''
ln -s $ADDONPATH $out/xplane-extra/HeadShake
'';
prepare = ''
ln -s /xplane-extra/HeadShake "$XPLANEPATH/Resources/plugins/HeadShake"
'';
revert = ''
if [ -L "$XPLANEPATH/Resources/plugins/HeadShake" ]; then
rm "$XPLANEPATH/Resources/plugins/HeadShake"
else
false
fi
'';
};
meta = {
description = "Headshake plugin for X-Plane 11";
license = stdenv.lib.licenses.gpl3;
maintainer = [ stdenv.lib.maintainers.spacefrogg ];
};
}