diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-12-07 21:16:04 +0000 |
---|---|---|
committer | Jonathan Ringer <jonringer@users.noreply.github.com> | 2022-01-25 23:14:33 -0800 |
commit | 85d0a94f900a281e1de3a9a7a6dd52bd09736692 (patch) | |
tree | 923e925b3d43866764b15f4afa94430f956518b7 /pkgs/applications/gis | |
parent | ce4927f0d5d7f22f8773906743b0e6f13e635337 (diff) |
qgis, pyqt: introduce qgis-ltr and update qgis
Add qtlocation to pyqt, and ensure that it is included with both qgis derivations.
Diffstat (limited to 'pkgs/applications/gis')
-rw-r--r-- | pkgs/applications/gis/qgis/default.nix | 7 | ||||
-rw-r--r-- | pkgs/applications/gis/qgis/ltr.nix | 26 | ||||
-rw-r--r-- | pkgs/applications/gis/qgis/unwrapped-ltr.nix | 148 | ||||
-rw-r--r-- | pkgs/applications/gis/qgis/unwrapped.nix | 40 |
4 files changed, 208 insertions, 13 deletions
diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index 65285c503f7d5..43598bc852f91 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,10 +8,10 @@ symlinkJoin rec { paths = [ qgis-unwrapped ]; - nativeBuildInputs = [ grass makeWrapper qgis-unwrapped.python3Packages.wrapPython ]; + nativeBuildInputs = [ makeWrapper qgis-unwrapped.py.pkgs.wrapPython ]; # extend to add to the python environment of QGIS without rebuilding QGIS application. - pythonInputs = qgis-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-unwrapped.python3Packages); + pythonInputs = qgis-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-unwrapped.py.pkgs); postBuild = '' # unpackPhase @@ -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 new file mode 100644 index 0000000000000..f6e9c881adb93 --- /dev/null +++ b/pkgs/applications/gis/qgis/ltr.nix @@ -0,0 +1,26 @@ +{ lib, makeWrapper, symlinkJoin +, qgis-ltr-unwrapped, extraPythonPackages ? (ps: [ ]) +}: +with lib; +symlinkJoin rec { + inherit (qgis-ltr-unwrapped) version; + name = "qgis-${version}"; + + paths = [ qgis-ltr-unwrapped ]; + + nativeBuildInputs = [ makeWrapper qgis-ltr-unwrapped.py.pkgs.wrapPython ]; + + # extend to add to the python environment of QGIS without rebuilding QGIS application. + pythonInputs = qgis-ltr-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-ltr-unwrapped.py.pkgs); + + postBuild = '' + + buildPythonPath "$pythonInputs" + + wrapProgram $out/bin/qgis \ + --prefix PATH : $program_PATH \ + --set PYTHONPATH $program_PYTHONPATH + ''; + + inherit (qgis-ltr-unwrapped) meta; +} diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix new file mode 100644 index 0000000000000..b916d8e7e4af5 --- /dev/null +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -0,0 +1,148 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, ninja +, flex +, bison +, proj +, geos +, xlibsWrapper +, sqlite +, gsl +, qwt +, fcgi +, python3 +, 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 +, makeWrapper +}: + +let + + py = python3.override { + packageOverrides = self: super: { + pyqt5 = super.pyqt5.override { + withLocation = true; + }; + }; + }; + + pythonBuildInputs = with py.pkgs; [ + qscintilla-qt5 + gdal + jinja2 + numpy + psycopg2 + chardet + python-dateutil + pyyaml + pytz + requests + urllib3 + pygments + pyqt5 + sip_4 + owslib + six + ]; +in mkDerivation rec { + version = "3.16.14"; + pname = "qgis-ltr-unwrapped"; + + src = fetchFromGitHub { + owner = "qgis"; + repo = "QGIS"; + rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}"; + sha256 = "sha256-3FUGSBdlhJhhpTPtYuzKOznsC7PJV3kRL9Il2Yryi1Q="; + }; + + passthru = { + inherit pythonBuildInputs; + inherit py; + }; + + 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 + ] ++ lib.optional withGrass grass + ++ lib.optional withWebKit qtwebkit + ++ pythonBuildInputs; + + nativeBuildInputs = [ makeWrapper 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 = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings"' + ''; + + cmakeFlags = [ + "-DCMAKE_SKIP_BUILD_RPATH=OFF" + "-DWITH_3D=True" + "-DPYQT5_SIP_DIR=${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings" + "-DQSCI_SIP_DIR=${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings" + ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" + ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; + + postFixup = lib.optionalString withGrass '' + # 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 [ grass ]} + ''; + + meta = with lib; { + description = "A Free and Open Source Geographic Information System"; + homepage = "https://www.qgis.org"; + 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 index 35ffbc5ba669e..9b2944c0d2500 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -12,7 +12,7 @@ , gsl , qwt , fcgi -, python3Packages +, python3 , libspatialindex , libspatialite , postgresql @@ -35,10 +35,22 @@ , grass , withWebKit ? true , qtwebkit +, pdal +, zstd +, makeWrapper }: let - pythonBuildInputs = with python3Packages; [ + + py = python3.override { + packageOverrides = self: super: { + pyqt5 = super.pyqt5.override { + withLocation = true; + }; + }; + }; + + pythonBuildInputs = with py.pkgs; [ qscintilla-qt5 gdal jinja2 @@ -57,19 +69,19 @@ let six ]; in mkDerivation rec { - version = "3.16.14"; + version = "3.22.1"; pname = "qgis-unwrapped"; src = fetchFromGitHub { owner = "qgis"; repo = "QGIS"; rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}"; - sha256 = "sha256-3FUGSBdlhJhhpTPtYuzKOznsC7PJV3kRL9Il2Yryi1Q="; + sha256 = "0hpbbv84lh1m7vrxv8d8x5kxgxcf0dydsvr3r2brgv3b40lpavd4"; }; passthru = { inherit pythonBuildInputs; - inherit python3Packages; + inherit py; }; buildInputs = [ @@ -98,11 +110,13 @@ in mkDerivation rec { qtserialport qtxmlpatterns qt3d + pdal + zstd ] ++ lib.optional withGrass grass ++ 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 # @@ -110,17 +124,25 @@ in mkDerivation rec { # build to use PYQT5_SIP_DIR consistently. postPatch = '' substituteInPlace cmake/FindPyQt5.py \ - --replace 'sip_dir = cfg.default_sip_dir' 'sip_dir = "${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"' + --replace 'sip_dir = cfg.default_sip_dir' 'sip_dir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings"' ''; 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}/${python3Packages.python.sitePackages}/PyQt5/bindings" + "-DWITH_PDAL=TRUE" + "-DPYQT5_SIP_DIR=${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings" + "-DQSCI_SIP_DIR=${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}/PyQt5/bindings" ] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF" ++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78"; + postFixup = lib.optionalString withGrass '' + # 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 [ grass ]} + ''; + meta = { description = "A Free and Open Source Geographic Information System"; homepage = "https://www.qgis.org"; |