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

45 lines
1.1 KiB
Nix
Raw Normal View History

2022-06-08 14:01:14 +02:00
{ stdenv, lib, cmake, fetchurl, fetchFromGitHub, unzip, xPlaneSDK }:
2020-10-18 14:34:40 +02:00
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";
2022-06-08 14:01:14 +02:00
license = lib.licenses.gpl3;
maintainer = [ lib.maintainers.spacefrogg ];
2020-10-18 14:34:40 +02:00
};
}