[Nix-dev] [PATCH] qgis enable python support

Marc Weber marco-oweber at gmx.de
Wed Jul 21 04:56:29 CEST 2010


---
 pkgs/applications/misc/qgis/default.nix |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pkgs/applications/misc/qgis/default.nix b/pkgs/applications/misc/qgis/default.nix
index b49275a..3d450d4 100644
--- a/pkgs/applications/misc/qgis/default.nix
+++ b/pkgs/applications/misc/qgis/default.nix
@@ -6,7 +6,7 @@ let inherit (builtins) getAttr;
 in
 composableDerivation.composableDerivation {} {
 
-  buildInputs = [ gdal cmake qt flex bison proj geos x11 sqlite gsl pyqt4];
+  buildInputs = [ gdal cmake qt flex bison proj geos x11 sqlite gsl pyqt4 makeWrapper sip];
     cfgOption = [
                   # without this option it can't find sqlite libs yet (missing symbols..) (TODO)
                   "-DWITH_INTERNAL_SQLITE3=TRUE"
@@ -28,9 +28,17 @@ composableDerivation.composableDerivation {} {
     license = [ "GPL" ];
   };
 
+  pythonLibs = "${lib.concatStringsSep ":" (map (l: "${l}/lib/${python.libPrefix}/site-packages") [sip pyqt4])}";
+
   phases = "unpackPhase buildPhase installPhase";
   buildPhase = ''pwd; mkdir build; cd build;  VERBOSE=1 cmake -DCMAKE_INSTALL_PREFIX=$out ''${cfgOption} ..'';
 
+  postInstall = ''
+    wrapProgram "$out/bin/qgis" \
+      --prefix PYTHONPATH ":" $pythonLibs \
+      --prefix LD_LIBRARY_PATH ":" $out/lib:${python}/lib
+  '';
+
   postUnpack = ''
     export CMAKE_SYSTEM_LIBRARY_PATH=
     for i in $buildInputs $propagatedBuildInputs; do
-- 
1.7.1




More information about the nix-dev mailing list