From 7fe59dee1878df11959739bbf191f802a72ce02f Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Sun, 12 Jun 2022 20:03:18 +0200 Subject: [PATCH] x-plane: init ortho4XPWrapper --- default.nix | 2 +- x-plane/ortho4XPWrapper.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 x-plane/ortho4XPWrapper.nix diff --git a/default.nix b/default.nix index 5f0d6a5..d55f0cf 100644 --- a/default.nix +++ b/default.nix @@ -9,7 +9,7 @@ let xPlaneEnv = callPackage ./x-plane { xplanePathStr = "/home/games/xplane"; addons = [ headshake beautifulRoads samBasic samGlobalTrees flyWithLua vividSky airportEnvHD betterLights extendedNightLights toLissA321 ]; }; xPlaneSDK = callPackage ./x-plane/sdk.nix {}; - ortho4xp = callPackage ./ortho4xp.nix {}; + ortho4xp = callPackage ./x-plane/ortho4XPWrapper.nix { orthoPathStr = "/home/games/ortho4xp"; }; airportEnvHD = callPackage ./x-plane/airport-env-hd.nix {}; beautifulRoads = callPackage ./x-plane/beautiful-roads.nix {}; diff --git a/x-plane/ortho4XPWrapper.nix b/x-plane/ortho4XPWrapper.nix new file mode 100644 index 0000000..183a9a9 --- /dev/null +++ b/x-plane/ortho4XPWrapper.nix @@ -0,0 +1,12 @@ +{ writeScriptBin, lib, python3, nvidia-texture-tools, p7zip, gdal, freeglut +, orthoPathStr }: +let + myPy = (python3.withPackages (ps: with ps; [ + requests pyproj numpy gdal shapely Rtree pillow tkinter ])); +in writeScriptBin "ortho4XP" '' + : ''${ORTHOPATH:=${orthoPathStr}} + PATH="${lib.makeBinPath [ myPy nvidia-texture-tools p7zip gdal freeglut ]}:$PATH" + export ORTHOPATH PATH + cd "$ORTHOPATH" + exec python Ortho4XP_*.py "$@" +''