about summary refs log tree commit diff
path: root/pkgs/applications/gis/qgis
diff options
context:
space:
mode:
authorIvan Mincik <ivan.mincik@gmail.com>2023-08-22 10:59:32 +0200
committerIvan Mincik <ivan.mincik@gmail.com>2023-08-23 10:52:22 +0200
commit85cf505bdfb43edf835c8b9d24a3b9bcce033ed2 (patch)
tree64a617df03f2da297564395ea11cfc6d3170a927 /pkgs/applications/gis/qgis
parente831daaf4d2e77d3f58bef3f3ddf83bd7dd2be3b (diff)
qgis: alphabetical sorting of dependencies
Diffstat (limited to 'pkgs/applications/gis/qgis')
-rw-r--r--pkgs/applications/gis/qgis/unwrapped.nix135
1 files changed, 78 insertions, 57 deletions
diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix
index c1b68f6654882..f388284240bf0 100644
--- a/pkgs/applications/gis/qgis/unwrapped.nix
+++ b/pkgs/applications/gis/qgis/unwrapped.nix
@@ -1,50 +1,52 @@
 { lib
-, mkDerivation
 , fetchFromGitHub
+, makeWrapper
+, mkDerivation
+, substituteAll
+, wrapGAppsHook
+, wrapQtAppsHook
+
+, withGrass ? true
+, withWebKit ? false
+
+, bison
 , cmake
-, ninja
+, exiv2
+, fcgi
 , flex
-, bison
-, proj
 , geos
-, sqlite
+, grass
 , gsl
-, qwt
-, fcgi
-, python3
+, hdf5
 , libspatialindex
 , libspatialite
-, postgresql
-, txt2tags
-, openssl
 , libzip
-, hdf5
 , netcdf
-, exiv2
+, ninja
+, openssl
+, pdal
+, postgresql
+, proj
 , protobuf
-, qtbase
-, qtsensors
+, python3
 , qca-qt5
-, qtkeychain
-, qt3d
 , qscintilla
+, qt3d
+, qtbase
+, qtkeychain
 , qtlocation
 , qtmultimedia
+, qtsensors
 , qtserialport
-, qtxmlpatterns
-, withGrass ? true
-, grass
-, withWebKit ? false
 , qtwebkit
-, pdal
+, qtxmlpatterns
+, qwt
+, sqlite
+, txt2tags
 , zstd
-, makeWrapper
-, wrapGAppsHook
-, substituteAll
 }:
 
 let
-
   py = python3.override {
     packageOverrides = self: super: {
       pyqt5 = super.pyqt5.override {
@@ -54,34 +56,34 @@ let
   };
 
   pythonBuildInputs = with py.pkgs; [
-    qscintilla-qt5
+    chardet
     gdal
     jinja2
     numpy
+    owslib
     psycopg2
-    chardet
+    pygments
+    pyqt-builder
+    pyqt5
     python-dateutil
-    pyyaml
     pytz
+    pyyaml
+    qscintilla-qt5
     requests
-    urllib3
-    pygments
-    pyqt5
-    pyqt-builder
-    sip
     setuptools
-    owslib
+    sip
     six
+    urllib3
   ];
 in mkDerivation rec {
-  version = "3.30.1";
+  version = "3.32.2";
   pname = "qgis-unwrapped";
 
   src = fetchFromGitHub {
     owner = "qgis";
     repo = "QGIS";
     rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
-    hash = "sha256-MB0EQVJO5WLgqjdh8A7X45CpNvf7239wkZWciNfY3gY=";
+    hash = "sha256-4Hcppzgst6v7SR/06ZICSujC4Gfckd/X5Mj40fh9OOU=";
   };
 
   passthru = {
@@ -89,41 +91,50 @@ in mkDerivation rec {
     inherit py;
   };
 
+  nativeBuildInputs = [
+    makeWrapper
+    wrapGAppsHook
+    wrapQtAppsHook
+
+    cmake
+    flex
+    bison
+    ninja
+  ];
+
   buildInputs = [
-    openssl
-    proj
-    geos
-    sqlite
-    gsl
-    qwt
     exiv2
-    protobuf
     fcgi
+    geos
+    gsl
+    hdf5
     libspatialindex
     libspatialite
-    postgresql
-    txt2tags
     libzip
-    hdf5
     netcdf
-    qtbase
-    qtsensors
+    openssl
+    pdal
+    postgresql
+    proj
+    protobuf
     qca-qt5
-    qtkeychain
     qscintilla
+    qt3d
+    qtbase
+    qtkeychain
     qtlocation
     qtmultimedia
+    qtsensors
     qtserialport
     qtxmlpatterns
-    qt3d
-    pdal
+    qwt
+    sqlite
+    txt2tags
     zstd
   ] ++ lib.optional withGrass grass
     ++ lib.optional withWebKit qtwebkit
     ++ pythonBuildInputs;
 
-  nativeBuildInputs = [ makeWrapper wrapGAppsHook cmake flex bison ninja ];
-
   patches = [
     (substituteAll {
       src = ./set-pyqt-package-dirs.patch;
@@ -132,6 +143,12 @@ in mkDerivation rec {
     })
   ];
 
+  # Add path to Qt platform plugins
+  # (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py")
+  preBuild = ''
+    export QT_QPA_PLATFORM_PLUGIN_PATH=${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms
+  '';
+
   cmakeFlags = [
     "-DWITH_3D=True"
     "-DWITH_PDAL=TRUE"
@@ -142,13 +159,17 @@ in mkDerivation rec {
       in "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}"
     );
 
+  qtWrapperArgs = [
+    "--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms"
+  ];
+
   dontWrapGApps = true; # wrapper params passed below
 
   postFixup = lib.optionalString withGrass ''
-    # grass has to be availble on the command line even though we baked in
+    # GRASS has to be availble on the command line even though we baked in
     # the path at build time using GRASS_PREFIX.
-    # using wrapGAppsHook also prevents file dialogs from crashing the program
-    # on non-NixOS
+    # Using wrapGAppsHook also prevents file dialogs from crashing the program
+    # on non-NixOS.
     wrapProgram $out/bin/qgis \
       "''${gappsWrapperArgs[@]}" \
       --prefix PATH : ${lib.makeBinPath [ grass ]}