nixpkgs/pkgs/applications/gis/qgis/default.nix
Matthew Pickering ce4927f0d5 qgis: enable 3D, grass
Grass is a runtime dependency which qgis attempts to find on the path.

3D is on by default with normal distributions so we should
also enable it.
2022-01-25 23:14:33 -08:00

29 lines
777 B
Nix

{ lib, makeWrapper, symlinkJoin
, qgis-unwrapped, grass, extraPythonPackages ? (ps: [ ])
}:
with lib;
symlinkJoin rec {
inherit (qgis-unwrapped) version;
name = "qgis-${version}";
paths = [ qgis-unwrapped ];
nativeBuildInputs = [ grass makeWrapper qgis-unwrapped.python3Packages.wrapPython ];
# extend to add to the python environment of QGIS without rebuilding QGIS application.
pythonInputs = qgis-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-unwrapped.python3Packages);
postBuild = ''
# unpackPhase
buildPythonPath "$pythonInputs"
wrapProgram $out/bin/qgis \
--prefix PATH : $program_PATH \
--prefix PATH : ${lib.makeBinPath [grass]} \
--set PYTHONPATH $program_PYTHONPATH
'';
meta = qgis-unwrapped.meta;
}