2022-01-27 00:19:43 +00:00
|
|
|
{ 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
|
2022-03-05 16:20:37 +00:00
|
|
|
, pdal
|
|
|
|
, zstd
|
2022-01-27 00:19:43 +00:00
|
|
|
, makeWrapper
|
2022-08-12 12:06:08 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, substituteAll
|
2022-01-27 00:19:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
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
|
2022-08-12 12:06:08 +00:00
|
|
|
pyqt-builder
|
|
|
|
sip
|
|
|
|
setuptools
|
2022-01-27 00:19:43 +00:00
|
|
|
owslib
|
|
|
|
six
|
|
|
|
];
|
|
|
|
in mkDerivation rec {
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "3.22.9";
|
2022-01-27 00:19:43 +00:00
|
|
|
pname = "qgis-ltr-unwrapped";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qgis";
|
|
|
|
repo = "QGIS";
|
|
|
|
rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2022-07-18 16:21:45 +00:00
|
|
|
sha256 = "sha256-QHdcK34e7tC0AUstE8pbsBHzHXbmOd3gI2/zqsxb6X4=";
|
2022-01-27 00:19:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2022-03-05 16:20:37 +00:00
|
|
|
pdal
|
|
|
|
zstd
|
2022-01-27 00:19:43 +00:00
|
|
|
] ++ lib.optional withGrass grass
|
|
|
|
++ lib.optional withWebKit qtwebkit
|
|
|
|
++ pythonBuildInputs;
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook cmake flex bison ninja ];
|
2022-01-27 00:19:43 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./set-pyqt-package-dirs.patch;
|
|
|
|
pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}";
|
|
|
|
qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}";
|
|
|
|
})
|
|
|
|
];
|
2022-01-27 00:19:43 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DWITH_3D=True"
|
2022-03-05 16:20:37 +00:00
|
|
|
"-DWITH_PDAL=TRUE"
|
2022-01-27 00:19:43 +00:00
|
|
|
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
|
|
|
|
++ lib.optional withGrass "-DGRASS_PREFIX7=${grass}/grass78";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
dontWrapGApps = true; # wrapper params passed below
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
postFixup = lib.optionalString withGrass ''
|
|
|
|
# grass has to be availble on the command line even though we baked in
|
2022-08-12 12:06:08 +00:00
|
|
|
# the path at build time using GRASS_PREFIX.
|
|
|
|
# using wrapGAppsHook also prevents file dialogs from crashing the program
|
|
|
|
# on non-NixOS
|
2022-01-27 00:19:43 +00:00
|
|
|
wrapProgram $out/bin/qgis \
|
2022-08-12 12:06:08 +00:00
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2022-01-27 00:19:43 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ grass ]}
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
meta = {
|
2022-01-27 00:19:43 +00:00
|
|
|
description = "A Free and Open Source Geographic Information System";
|
|
|
|
homepage = "https://www.qgis.org";
|
2022-03-05 16:20:37 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = with lib.platforms; linux;
|
|
|
|
maintainers = with lib.maintainers; [ lsix sikmir erictapen willcohen ];
|
2022-01-27 00:19:43 +00:00
|
|
|
};
|
|
|
|
}
|