about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/gis/qgis/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/gis/qgis/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/gis/qgis/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/gis/qgis/default.nix b/nixpkgs/pkgs/applications/gis/qgis/default.nix
new file mode 100644
index 000000000000..f272fd04dd0d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/gis/qgis/default.nix
@@ -0,0 +1,27 @@
+{ lib, makeWrapper, symlinkJoin
+, qgis-unwrapped, extraPythonPackages ? (ps: [ ])
+}:
+with lib;
+symlinkJoin rec {
+  inherit (qgis-unwrapped) version;
+  name = "qgis-${version}";
+
+  paths = [ qgis-unwrapped ];
+
+  nativeBuildInputs = [ 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 \
+      --set PYTHONPATH $program_PYTHONPATH
+  '';
+
+  meta = qgis-unwrapped.meta;
+}