spacefrogg-overlay/x-plane/sam-suite/default.nix

37 lines
1.2 KiB
Nix

{ stdenv, lib, requireFile, openssl, qt5, p7zip, unzip }:
let
fname = "LINUX_-_SAM_Suite.zip";
sha256 = "0qf7n910kqsiqcbwvgf87hfhiz4c87pi5xfhw02j4qpcvr2x3ca1";
forumlink = "https://forums.x-plane.org/index.php?/files/file/59782-scenery-animation-manager-suite/";
in qt5.mkDerivation {
pname = "sam";
version = "1.0";
src = requireFile {
message = ''
Download the Beautiful Roads Addon from:
${forumlink}
Then add it to your nix store, e.g., by using
"nix-prefetch-url file://\$PWD/${fname}" from the directory where you saved it.
'';
name = fname;
inherit sha256;
};
nativeBuildInputs = [ unzip ];
phases = [ "buildPhase" "patchPhase" "configurePhase" "fixupPhase" ];
nativeBuildInptus = [ unzip ];
libPath = lib.makeLibraryPath [ qt5.qtbase p7zip openssl stdenv.cc.cc ];
buildPhase = ''
unzip $src others/samsuite.zip
unzip others/samsuite.zip
tar xf samsuite.tar.gz
mkdir -p $out/bin
cp usr/bin/SamSuite $out/bin
cp -r usr/share $out
patchelf --set-rpath "$libPath" --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/bin/SamSuite
wrapProgram $out/bin/SamSuite --prefix PATH : ${lib.getBin p7zip}/bin
'';
}