From 24696cec16cbc01ed1bfd76a184de447e96b97ea Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Mon, 6 Dec 2021 22:50:18 +0000 Subject: [PATCH 01/10] grass: 7.6.1 -> 7.8.6 --- pkgs/applications/gis/grass/default.nix | 27 +++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 09c1fddbda21e..842772ed31b88 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -1,24 +1,25 @@ { lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw -, cairo, readline, ffmpeg_3, makeWrapper, wxGTK30, netcdf, blas -, proj, gdal, geos, sqlite, postgresql, libmysqlclient, python2Packages, libLAS, proj-datumgrid +, cairo, readline, ffmpeg, makeWrapper, wxGTK30, netcdf, blas +, proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid +, zstd }: stdenv.mkDerivation rec { name = "grass"; - version = "7.6.1"; + version = "7.8.6"; src = with lib; fetchFromGitHub { owner = "OSGeo"; repo = "grass"; - rev = "${name}_${replaceStrings ["."] ["_"] version}"; - sha256 = "1amjk9rz7vw5ha7nyl5j2bfwj5if9w62nlwx5qbp1x7spldimlll"; + rev = version; + sha256 = "sha256-zvZqFWuxNyA+hu+NMiRbQVdzzrQPsZrdGdfVB17+SbM="; }; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo proj - readline ffmpeg_3 makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas - libLAS proj-datumgrid ] - ++ (with python2Packages; [ python python-dateutil wxPython30 numpy ]); + buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo + readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas + libLAS proj-datumgrid zstd ] + ++ (with python3Packages; [ python python-dateutil wxPython_4_1 numpy ]); # On Darwin the installer tries to symlink the help files into a system # directory @@ -62,6 +63,7 @@ stdenv.mkDerivation rec { scripts/g.extension.all/g.extension.all.py \ scripts/r.drain/r.drain.py \ scripts/r.pack/r.pack.py \ + scripts/r.import/r.import.py \ scripts/r.tileset/r.tileset.py \ scripts/r.unpack/r.unpack.py \ scripts/v.clip/v.clip.py \ @@ -79,18 +81,17 @@ stdenv.mkDerivation rec { temporal/t.rast.algebra/t.rast.algebra.py \ temporal/t.rast3d.algebra/t.rast3d.algebra.py \ temporal/t.vect.algebra/t.vect.algebra.py \ + temporal/t.downgrade/t.downgrade.py \ temporal/t.select/t.select.py for d in gui lib scripts temporal tools; do patchShebangs $d done ''; - NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"; - postInstall = '' - wrapProgram $out/bin/grass76 \ + wrapProgram $out/bin/grass78 \ --set PYTHONPATH $PYTHONPATH \ - --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \ + --set GRASS_PYTHON ${python3Packages.python}/bin/${python3Packages.python.executable} \ --suffix LD_LIBRARY_PATH ':' '${gdal}/lib' ln -s $out/grass*/lib $out/lib ln -s $out/grass*/include $out/include From 90b748fdd31a7bc48aa24c332cb833ce851c1a96 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Mon, 6 Dec 2021 22:59:45 +0000 Subject: [PATCH 02/10] grass: Add pdal dependency This is used for processing lidar point clouds. --- pkgs/applications/gis/grass/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 842772ed31b88..6b33dc073f1ed 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw , cairo, readline, ffmpeg, makeWrapper, wxGTK30, netcdf, blas , proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid -, zstd +, zstd, pdal }: stdenv.mkDerivation rec { @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas - libLAS proj-datumgrid zstd ] + libLAS proj-datumgrid zstd pdal ] ++ (with python3Packages; [ python python-dateutil wxPython_4_1 numpy ]); # On Darwin the installer tries to symlink the help files into a system @@ -38,6 +38,7 @@ stdenv.mkDerivation rec { "--with-readline" "--with-wxwidgets" "--with-netcdf" + "--with-pdal" "--with-geos" "--with-postgres" "--with-postgres-libs=${postgresql.lib}/lib/" From a0cdf4d14fdc39a986e9bd583d9185eae790b3d8 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Mon, 6 Dec 2021 23:00:10 +0000 Subject: [PATCH 03/10] grass: Add missing feature flags --- pkgs/applications/gis/grass/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 6b33dc073f1ed..87f5686d019ce 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -48,6 +48,9 @@ stdenv.mkDerivation rec { "--with-mysql-libs=${libmysqlclient}/lib/mysql" "--with-blas" "--with-liblas=${libLAS}/bin/liblas-config" + "--with-zstd" + "--with-fftw" + "--with-pthread" ]; # Otherwise a very confusing "Can't load GDAL library" error From 5c7230dae32ba74ea4afc640bddf898822234404 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 10:14:11 +0000 Subject: [PATCH 04/10] grass: wrap grass with wrapGAppsHook --- pkgs/applications/gis/grass/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 87f5686d019ce..7ba2dc5c8ff4f 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw , cairo, readline, ffmpeg, makeWrapper, wxGTK30, netcdf, blas , proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid -, zstd, pdal +, zstd, pdal, wrapGAppsHook }: stdenv.mkDerivation rec { @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas - libLAS proj-datumgrid zstd pdal ] + libLAS proj-datumgrid zstd pdal wrapGAppsHook ] ++ (with python3Packages; [ python python-dateutil wxPython_4_1 numpy ]); # On Darwin the installer tries to symlink the help files into a system From 3f24658ee0afd3bdd0ec5fc50060c2008b3b86c3 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 10:14:41 +0000 Subject: [PATCH 05/10] qgis: add grass to wrapper Grass is a runtime dependency which qgis attempts to find on the path. --- pkgs/applications/gis/qgis/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index f272fd04dd0df..65285c503f7d5 100644 --- a/pkgs/applications/gis/qgis/default.nix +++ b/pkgs/applications/gis/qgis/default.nix @@ -1,5 +1,5 @@ { lib, makeWrapper, symlinkJoin -, qgis-unwrapped, extraPythonPackages ? (ps: [ ]) +, qgis-unwrapped, grass, extraPythonPackages ? (ps: [ ]) }: with lib; symlinkJoin rec { @@ -8,7 +8,7 @@ symlinkJoin rec { paths = [ qgis-unwrapped ]; - nativeBuildInputs = [ makeWrapper qgis-unwrapped.python3Packages.wrapPython ]; + 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); @@ -20,6 +20,7 @@ symlinkJoin rec { wrapProgram $out/bin/qgis \ --prefix PATH : $program_PATH \ + --prefix PATH : ${lib.makeBinPath [grass]} \ --set PYTHONPATH $program_PYTHONPATH ''; From dbb14ec1f63a7cedfbdd9a0e8c01e64ad6abb0ad Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 10:14:59 +0000 Subject: [PATCH 06/10] qgis: Enable 3D viewer This feature is on by default with normal distributions so we should also enable it. --- pkgs/applications/gis/qgis/unwrapped.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 0ec81c785b4b8..5bbe2b958cd64 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -27,6 +27,7 @@ , qtsensors , qca-qt5 , qtkeychain +, qt3d , qscintilla , qtserialport , qtxmlpatterns @@ -96,6 +97,7 @@ in mkDerivation rec { qscintilla qtserialport qtxmlpatterns + qt3d ] ++ lib.optional withGrass grass ++ lib.optional withWebKit qtwebkit ++ pythonBuildInputs; @@ -113,6 +115,7 @@ in mkDerivation rec { cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" + "-DWITH_3D=True" "-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings" "-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/share/sip/PyQt5" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" From b4cb8c26427aaebd2eecb87df3ed6339be82b408 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 10:15:13 +0000 Subject: [PATCH 07/10] qgis: Enable grass --- pkgs/applications/gis/qgis/unwrapped.nix | 2 +- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 5bbe2b958cd64..e68233b6ad82d 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -119,7 +119,7 @@ in mkDerivation rec { "-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings" "-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/share/sip/PyQt5" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" - ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/${grass.name}"; + ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; meta = { description = "A Free and Open Source Geographic Information System"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7674300b4e59b..9e4601e6e82b0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27779,7 +27779,7 @@ with pkgs; qemu-utils = callPackage ../applications/virtualization/qemu/utils.nix {}; qgis-unwrapped = libsForQt5.callPackage ../applications/gis/qgis/unwrapped.nix { - withGrass = false; + withGrass = true; }; qgis = callPackage ../applications/gis/qgis { }; From 848981643c1fe3a82dbbd08a57ae88671022e1ab Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 21:16:04 +0000 Subject: [PATCH 08/10] Add qtlocation to pyqt --- pkgs/applications/gis/qgis/{default.nix => ltr.nix} | 0 .../gis/qgis/{unwrapped.nix => unwrapped-ltr.nix} | 0 pkgs/development/python-modules/pyqt/5.x.nix | 4 ++++ pkgs/top-level/python-packages.nix | 4 ++++ 4 files changed, 8 insertions(+) rename pkgs/applications/gis/qgis/{default.nix => ltr.nix} (100%) rename pkgs/applications/gis/qgis/{unwrapped.nix => unwrapped-ltr.nix} (100%) diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/ltr.nix similarity index 100% rename from pkgs/applications/gis/qgis/default.nix rename to pkgs/applications/gis/qgis/ltr.nix diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix similarity index 100% rename from pkgs/applications/gis/qgis/unwrapped.nix rename to pkgs/applications/gis/qgis/unwrapped-ltr.nix diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 3b98b5738825f..f6b84972324b4 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -13,6 +13,7 @@ , withMultimedia ? false , withWebKit ? false , withWebSockets ? false +, withLocation ? false }: let @@ -59,6 +60,7 @@ in buildPythonPackage rec { ++ lib.optional withMultimedia qtmultimedia ++ lib.optional withWebKit qtwebkit ++ lib.optional withWebSockets qtwebsockets + ++ lib.optional withLocation qtlocation ; buildInputs = with libsForQt5; [ @@ -71,6 +73,7 @@ in buildPythonPackage rec { ++ lib.optional withConnectivity qtconnectivity ++ lib.optional withWebKit qtwebkit ++ lib.optional withWebSockets qtwebsockets + ++ lib.optional withLocation qtlocation ; propagatedBuildInputs = [ @@ -107,6 +110,7 @@ in buildPythonPackage rec { ++ lib.optional withWebKit "PyQt5.QtWebKit" ++ lib.optional withMultimedia "PyQt5.QtMultimedia" ++ lib.optional withConnectivity "PyQt5.QtConnectivity" + ++ lib.optional withLocation "PyQt5.QtPositioning" ; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2f415e50f96fb..a2b23a590db20 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6999,6 +6999,10 @@ in { withMultimedia = true; }; + pyqt5_with_qtlocation = self.pyqt5.override { + withLocation = true; + }; + /* `pyqt5_with_qtwebkit` should not be used by python libraries in pkgs/development/python-modules/*. Putting this attribute in From f707c481eea5d899e65a40a2793027510c0d72fd Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 7 Dec 2021 21:20:53 +0000 Subject: [PATCH 09/10] qgis: Introduce qgis-ltr and add up to date qgis Closes #148213 --- pkgs/applications/gis/qgis/default.nix | 28 ++++ pkgs/applications/gis/qgis/ltr.nix | 12 +- pkgs/applications/gis/qgis/unwrapped-ltr.nix | 10 +- pkgs/applications/gis/qgis/unwrapped.nix | 137 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 8 +- 5 files changed, 181 insertions(+), 14 deletions(-) create mode 100644 pkgs/applications/gis/qgis/default.nix create mode 100644 pkgs/applications/gis/qgis/unwrapped.nix diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix new file mode 100644 index 0000000000000..65285c503f7d5 --- /dev/null +++ b/pkgs/applications/gis/qgis/default.nix @@ -0,0 +1,28 @@ +{ 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; +} diff --git a/pkgs/applications/gis/qgis/ltr.nix b/pkgs/applications/gis/qgis/ltr.nix index 65285c503f7d5..7db4300fea51f 100644 --- a/pkgs/applications/gis/qgis/ltr.nix +++ b/pkgs/applications/gis/qgis/ltr.nix @@ -1,17 +1,17 @@ { lib, makeWrapper, symlinkJoin -, qgis-unwrapped, grass, extraPythonPackages ? (ps: [ ]) +, qgis-ltr-unwrapped, grass, extraPythonPackages ? (ps: [ ]) }: with lib; symlinkJoin rec { - inherit (qgis-unwrapped) version; + inherit (qgis-ltr-unwrapped) version; name = "qgis-${version}"; - paths = [ qgis-unwrapped ]; + paths = [ qgis-ltr-unwrapped ]; - nativeBuildInputs = [ grass makeWrapper qgis-unwrapped.python3Packages.wrapPython ]; + nativeBuildInputs = [ grass makeWrapper qgis-ltr-unwrapped.python3Packages.wrapPython ]; # extend to add to the python environment of QGIS without rebuilding QGIS application. - pythonInputs = qgis-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-unwrapped.python3Packages); + pythonInputs = qgis-ltr-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-ltr-unwrapped.python3Packages); postBuild = '' # unpackPhase @@ -24,5 +24,5 @@ symlinkJoin rec { --set PYTHONPATH $program_PYTHONPATH ''; - meta = qgis-unwrapped.meta; + meta = qgis-ltr-unwrapped.meta; } diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix index e68233b6ad82d..afa05f8b17ee8 100644 --- a/pkgs/applications/gis/qgis/unwrapped-ltr.nix +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -58,7 +58,7 @@ let ]; in mkDerivation rec { version = "3.16.14"; - pname = "qgis-unwrapped"; + pname = "qgis-ltr-unwrapped"; src = fetchFromGitHub { owner = "qgis"; @@ -121,11 +121,11 @@ in mkDerivation rec { ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; - meta = { + meta = with lib; { description = "A Free and Open Source Geographic Information System"; homepage = "https://www.qgis.org"; - license = lib.licenses.gpl2Plus; - platforms = with lib.platforms; linux; - maintainers = with lib.maintainers; [ lsix sikmir erictapen ]; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ lsix sikmir erictapen ]; }; } diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix new file mode 100644 index 0000000000000..14109d284305b --- /dev/null +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -0,0 +1,137 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, ninja +, flex +, bison +, proj +, geos +, xlibsWrapper +, sqlite +, gsl +, qwt +, fcgi +, python3Packages +, libspatialindex +, libspatialite +, postgresql +, txt2tags +, openssl +, libzip +, hdf5 +, netcdf +, exiv2 +, protobuf +, qtbase +, qtsensors +, qca-qt5 +, qtkeychain +, qt3d +, qscintilla +, qtserialport +, qtxmlpatterns +, withGrass ? true +, grass +, withWebKit ? true +, qtwebkit +, pdal +, zstd +}: + +let + + pythonBuildInputs = with python3Packages; [ + qscintilla-qt5 + gdal + jinja2 + numpy + psycopg2 + chardet + python-dateutil + pyyaml + pytz + requests + urllib3 + pygments + pyqt5_with_qtlocation + sip_4 + owslib + six + ]; +in mkDerivation rec { + version = "3.22.1"; + pname = "qgis-unwrapped"; + + src = fetchFromGitHub { + owner = "qgis"; + repo = "QGIS"; + rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}"; + sha256 = "sha256:0hpbbv84lh1m7vrxv8d8x5kxgxcf0dydsvr3r2brgv3b40lpavd4"; + }; + + passthru = { + inherit pythonBuildInputs; + inherit python3Packages; + }; + + buildInputs = [ + openssl + proj + geos + xlibsWrapper + sqlite + gsl + qwt + exiv2 + protobuf + fcgi + libspatialindex + libspatialite + postgresql + txt2tags + libzip + hdf5 + netcdf + qtbase + qtsensors + qca-qt5 + qtkeychain + qscintilla + qtserialport + qtxmlpatterns + qt3d + pdal + zstd + ] ++ lib.optional withGrass grass + ++ lib.optional withWebKit qtwebkit + ++ pythonBuildInputs; + + nativeBuildInputs = [ cmake flex bison ninja ]; + + # Force this pyqt_sip_dir variable to point to the sip dir in PyQt5 + # + # TODO: Correct PyQt5 to provide the expected directory and fix + # build to use PYQT5_SIP_DIR consistently. + postPatch = '' + substituteInPlace cmake/FindPyQt5.py \ + --replace 'sip_dir = cfg.default_sip_dir' 'sip_dir = "${python3Packages.pyqt5_with_qtlocation}/${python3Packages.python.sitePackages}/PyQt5/bindings"' + ''; + + cmakeFlags = [ + "-DCMAKE_SKIP_BUILD_RPATH=OFF" + "-DWITH_3D=True" + "-DWITH_PDAL=TRUE" + "-DPYQT5_SIP_DIR=${python3Packages.pyqt5_with_qtlocation}/${python3Packages.python.sitePackages}/PyQt5/bindings" + "-DQSCI_SIP_DIR=${python3Packages.qscintilla-qt5}/share/sip/PyQt5" + ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" + ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; + + meta = { + description = "A Free and Open Source Geographic Information System"; + homepage = "https://www.qgis.org"; + license = lib.licenses.gpl2Plus; + platforms = with lib.platforms; linux; + maintainers = with lib.maintainers; [ lsix sikmir erictapen ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9e4601e6e82b0..27367529d9dfb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27778,9 +27778,11 @@ with pkgs; qemu-utils = callPackage ../applications/virtualization/qemu/utils.nix {}; - qgis-unwrapped = libsForQt5.callPackage ../applications/gis/qgis/unwrapped.nix { - withGrass = true; - }; + qgis-ltr-unwrapped = libsForQt5.callPackage ../applications/gis/qgis/unwrapped-ltr.nix { }; + + qgis-ltr = callPackage ../applications/gis/qgis/ltr.nix { }; + + qgis-unwrapped = libsForQt5.callPackage ../applications/gis/qgis/unwrapped.nix { }; qgis = callPackage ../applications/gis/qgis { }; From ca2311b625c6893a045d76292d2f8347019e8434 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Thu, 9 Dec 2021 22:08:53 +0000 Subject: [PATCH 10/10] qgis: apply grass wrapper in unwrapped derivation --- pkgs/applications/gis/qgis/default.nix | 5 ++--- pkgs/applications/gis/qgis/ltr.nix | 5 ++--- pkgs/applications/gis/qgis/unwrapped-ltr.nix | 11 ++++++++++- pkgs/applications/gis/qgis/unwrapped.nix | 11 ++++++++++- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index 65285c503f7d5..f272fd04dd0df 100644 --- a/pkgs/applications/gis/qgis/default.nix +++ b/pkgs/applications/gis/qgis/default.nix @@ -1,5 +1,5 @@ { lib, makeWrapper, symlinkJoin -, qgis-unwrapped, grass, extraPythonPackages ? (ps: [ ]) +, qgis-unwrapped, extraPythonPackages ? (ps: [ ]) }: with lib; symlinkJoin rec { @@ -8,7 +8,7 @@ symlinkJoin rec { paths = [ qgis-unwrapped ]; - nativeBuildInputs = [ grass makeWrapper qgis-unwrapped.python3Packages.wrapPython ]; + 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); @@ -20,7 +20,6 @@ symlinkJoin rec { wrapProgram $out/bin/qgis \ --prefix PATH : $program_PATH \ - --prefix PATH : ${lib.makeBinPath [grass]} \ --set PYTHONPATH $program_PYTHONPATH ''; diff --git a/pkgs/applications/gis/qgis/ltr.nix b/pkgs/applications/gis/qgis/ltr.nix index 7db4300fea51f..750feacc819ab 100644 --- a/pkgs/applications/gis/qgis/ltr.nix +++ b/pkgs/applications/gis/qgis/ltr.nix @@ -1,5 +1,5 @@ { lib, makeWrapper, symlinkJoin -, qgis-ltr-unwrapped, grass, extraPythonPackages ? (ps: [ ]) +, qgis-ltr-unwrapped, extraPythonPackages ? (ps: [ ]) }: with lib; symlinkJoin rec { @@ -8,7 +8,7 @@ symlinkJoin rec { paths = [ qgis-ltr-unwrapped ]; - nativeBuildInputs = [ grass makeWrapper qgis-ltr-unwrapped.python3Packages.wrapPython ]; + nativeBuildInputs = [ makeWrapper qgis-ltr-unwrapped.python3Packages.wrapPython ]; # extend to add to the python environment of QGIS without rebuilding QGIS application. pythonInputs = qgis-ltr-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-ltr-unwrapped.python3Packages); @@ -20,7 +20,6 @@ symlinkJoin rec { wrapProgram $out/bin/qgis \ --prefix PATH : $program_PATH \ - --prefix PATH : ${lib.makeBinPath [grass]} \ --set PYTHONPATH $program_PYTHONPATH ''; diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix index afa05f8b17ee8..dc311a3e12929 100644 --- a/pkgs/applications/gis/qgis/unwrapped-ltr.nix +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -35,6 +35,7 @@ , grass , withWebKit ? true , qtwebkit +, makeWrapper }: let @@ -102,7 +103,7 @@ in mkDerivation rec { ++ lib.optional withWebKit qtwebkit ++ pythonBuildInputs; - nativeBuildInputs = [ cmake flex bison ninja ]; + nativeBuildInputs = [ makeWrapper cmake flex bison ninja ]; # Force this pyqt_sip_dir variable to point to the sip dir in PyQt5 # @@ -121,6 +122,14 @@ in mkDerivation rec { ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; + postFixup = '' + # unpackPhase + # grass has to be availble on the command line even though we baked in + # the path at build time using GRASS_PREFIX + wrapProgram $out/bin/qgis \ + --prefix PATH : ${lib.makeBinPath (lib.optional withGrass grass)} + ''; + meta = with lib; { description = "A Free and Open Source Geographic Information System"; homepage = "https://www.qgis.org"; diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 14109d284305b..141a7f2063a47 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -37,6 +37,7 @@ , qtwebkit , pdal , zstd +, makeWrapper }: let @@ -107,7 +108,7 @@ in mkDerivation rec { ++ lib.optional withWebKit qtwebkit ++ pythonBuildInputs; - nativeBuildInputs = [ cmake flex bison ninja ]; + nativeBuildInputs = [ makeWrapper cmake flex bison ninja ]; # Force this pyqt_sip_dir variable to point to the sip dir in PyQt5 # @@ -127,6 +128,14 @@ in mkDerivation rec { ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; + postFixup = '' + # unpackPhase + # grass has to be availble on the command line even though we baked in + # the path at build time using GRASS_PREFIX + wrapProgram $out/bin/qgis \ + --prefix PATH : ${lib.makeBinPath (lib.optional withGrass grass)} + ''; + meta = { description = "A Free and Open Source Geographic Information System"; homepage = "https://www.qgis.org";