2021-09-28 08:13:01 +00:00
|
|
|
{ lib
|
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, proj
|
|
|
|
, geos
|
|
|
|
, sqlite
|
|
|
|
, gsl
|
|
|
|
, qwt
|
|
|
|
, fcgi
|
2022-01-27 00:19:43 +00:00
|
|
|
, python3
|
2021-09-28 08:13:01 +00:00
|
|
|
, libspatialindex
|
|
|
|
, libspatialite
|
|
|
|
, postgresql
|
|
|
|
, txt2tags
|
|
|
|
, openssl
|
|
|
|
, libzip
|
|
|
|
, hdf5
|
|
|
|
, netcdf
|
|
|
|
, exiv2
|
|
|
|
, protobuf
|
|
|
|
, qtbase
|
|
|
|
, qtsensors
|
|
|
|
, qca-qt5
|
|
|
|
, qtkeychain
|
2022-01-27 00:19:43 +00:00
|
|
|
, qt3d
|
2021-09-28 08:13:01 +00:00
|
|
|
, qscintilla
|
2023-01-11 07:51:40 +00:00
|
|
|
, qtlocation
|
2021-09-28 08:13:01 +00:00
|
|
|
, qtserialport
|
|
|
|
, qtxmlpatterns
|
|
|
|
, withGrass ? true
|
|
|
|
, grass
|
2023-01-11 07:51:40 +00:00
|
|
|
, withWebKit ? false
|
2021-09-28 08:13:01 +00:00
|
|
|
, qtwebkit
|
2022-01-27 00:19:43 +00:00
|
|
|
, pdal
|
|
|
|
, zstd
|
|
|
|
, makeWrapper
|
2022-08-12 12:06:08 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, substituteAll
|
2021-09-28 08:13:01 +00:00
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2022-01-27 00:19:43 +00:00
|
|
|
|
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
pyqt5 = super.pyqt5.override {
|
|
|
|
withLocation = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonBuildInputs = with py.pkgs; [
|
2021-04-17 00:35:05 +00:00
|
|
|
qscintilla-qt5
|
|
|
|
gdal
|
|
|
|
jinja2
|
|
|
|
numpy
|
|
|
|
psycopg2
|
|
|
|
chardet
|
2021-07-04 02:40:35 +00:00
|
|
|
python-dateutil
|
2021-04-17 00:35:05 +00:00
|
|
|
pyyaml
|
|
|
|
pytz
|
|
|
|
requests
|
|
|
|
urllib3
|
|
|
|
pygments
|
|
|
|
pyqt5
|
2022-08-12 12:06:08 +00:00
|
|
|
pyqt-builder
|
|
|
|
sip
|
|
|
|
setuptools
|
2021-04-17 00:35:05 +00:00
|
|
|
owslib
|
|
|
|
six
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
in mkDerivation rec {
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "3.28.3";
|
2021-09-28 08:13:01 +00:00
|
|
|
pname = "qgis-unwrapped";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qgis";
|
|
|
|
repo = "QGIS";
|
2021-04-17 00:35:05 +00:00
|
|
|
rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-nXauZSC78BX1fcx0SXniwQpRmdSLfoqZ5jlbXeHgRGI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit pythonBuildInputs;
|
2022-01-27 00:19:43 +00:00
|
|
|
inherit py;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
proj
|
|
|
|
geos
|
|
|
|
sqlite
|
|
|
|
gsl
|
|
|
|
qwt
|
|
|
|
exiv2
|
|
|
|
protobuf
|
|
|
|
fcgi
|
|
|
|
libspatialindex
|
|
|
|
libspatialite
|
|
|
|
postgresql
|
|
|
|
txt2tags
|
|
|
|
libzip
|
|
|
|
hdf5
|
|
|
|
netcdf
|
|
|
|
qtbase
|
|
|
|
qtsensors
|
|
|
|
qca-qt5
|
|
|
|
qtkeychain
|
|
|
|
qscintilla
|
2023-01-11 07:51:40 +00:00
|
|
|
qtlocation
|
2021-04-17 00:35:05 +00:00
|
|
|
qtserialport
|
|
|
|
qtxmlpatterns
|
2022-01-27 00:19:43 +00:00
|
|
|
qt3d
|
|
|
|
pdal
|
|
|
|
zstd
|
2021-04-17 00:35:05 +00:00
|
|
|
] ++ lib.optional withGrass grass
|
2020-12-25 13:55:36 +00:00
|
|
|
++ lib.optional withWebKit qtwebkit
|
|
|
|
++ pythonBuildInputs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook cmake flex bison ninja ];
|
2020-04-24 23:36:52 +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}";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
cmakeFlags = [
|
2022-01-27 00:19:43 +00:00
|
|
|
"-DWITH_3D=True"
|
|
|
|
"-DWITH_PDAL=TRUE"
|
2021-04-17 00:35:05 +00:00
|
|
|
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
|
2023-01-11 07:51:40 +00:00
|
|
|
++ lib.optional withGrass (let
|
|
|
|
gmajor = lib.versions.major grass.version;
|
|
|
|
gminor = lib.versions.minor grass.version;
|
|
|
|
in "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}"
|
|
|
|
);
|
2022-01-27 00:19:43 +00:00
|
|
|
|
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 ]}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A Free and Open Source Geographic Information System";
|
2020-12-25 13:55:36 +00:00
|
|
|
homepage = "https://www.qgis.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = with lib.platforms; linux;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = with lib.maintainers; [ lsix sikmir willcohen ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|