2021-09-28 08:13:01 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
, makeWrapper
|
|
|
|
, mkDerivation
|
|
|
|
, substituteAll
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2023-10-09 19:29:22 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
, withGrass ? true
|
|
|
|
, withWebKit ? false
|
|
|
|
|
|
|
|
, bison
|
2021-09-28 08:13:01 +00:00
|
|
|
, cmake
|
2023-11-16 04:20:00 +00:00
|
|
|
, draco
|
2023-10-09 19:29:22 +00:00
|
|
|
, exiv2
|
|
|
|
, fcgi
|
2021-09-28 08:13:01 +00:00
|
|
|
, flex
|
|
|
|
, geos
|
2023-10-09 19:29:22 +00:00
|
|
|
, grass
|
2021-09-28 08:13:01 +00:00
|
|
|
, gsl
|
2023-10-09 19:29:22 +00:00
|
|
|
, hdf5
|
2021-09-28 08:13:01 +00:00
|
|
|
, libspatialindex
|
|
|
|
, libspatialite
|
|
|
|
, libzip
|
|
|
|
, netcdf
|
2023-10-09 19:29:22 +00:00
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, pdal
|
|
|
|
, postgresql
|
|
|
|
, proj
|
2021-09-28 08:13:01 +00:00
|
|
|
, protobuf
|
2024-07-27 06:49:29 +00:00
|
|
|
, python311
|
2021-09-28 08:13:01 +00:00
|
|
|
, qca-qt5
|
|
|
|
, qscintilla
|
2023-10-09 19:29:22 +00:00
|
|
|
, qt3d
|
|
|
|
, qtbase
|
|
|
|
, qtkeychain
|
2023-01-11 07:51:40 +00:00
|
|
|
, qtlocation
|
2023-10-09 19:29:22 +00:00
|
|
|
, qtmultimedia
|
|
|
|
, qtsensors
|
2021-09-28 08:13:01 +00:00
|
|
|
, qtserialport
|
|
|
|
, qtwebkit
|
2023-10-09 19:29:22 +00:00
|
|
|
, qtxmlpatterns
|
|
|
|
, qwt
|
|
|
|
, sqlite
|
|
|
|
, txt2tags
|
2022-01-27 00:19:43 +00:00
|
|
|
, zstd
|
2021-09-28 08:13:01 +00:00
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
py = python311.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = py;
|
2022-01-27 00:19:43 +00:00
|
|
|
packageOverrides = self: super: {
|
|
|
|
pyqt5 = super.pyqt5.override {
|
|
|
|
withLocation = true;
|
2024-02-29 20:09:43 +00:00
|
|
|
withSerialPort = true;
|
2022-01-27 00:19:43 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonBuildInputs = with py.pkgs; [
|
2023-10-09 19:29:22 +00:00
|
|
|
chardet
|
2021-04-17 00:35:05 +00:00
|
|
|
gdal
|
|
|
|
jinja2
|
|
|
|
numpy
|
2023-10-09 19:29:22 +00:00
|
|
|
owslib
|
2021-04-17 00:35:05 +00:00
|
|
|
psycopg2
|
2023-10-09 19:29:22 +00:00
|
|
|
pygments
|
|
|
|
pyqt5
|
2023-11-16 04:20:00 +00:00
|
|
|
pyqt-builder
|
2021-07-04 02:40:35 +00:00
|
|
|
python-dateutil
|
2021-04-17 00:35:05 +00:00
|
|
|
pytz
|
2023-10-09 19:29:22 +00:00
|
|
|
pyyaml
|
|
|
|
qscintilla-qt5
|
2021-04-17 00:35:05 +00:00
|
|
|
requests
|
2022-08-12 12:06:08 +00:00
|
|
|
setuptools
|
2023-10-09 19:29:22 +00:00
|
|
|
sip
|
2021-04-17 00:35:05 +00:00
|
|
|
six
|
2023-10-09 19:29:22 +00:00
|
|
|
urllib3
|
2021-04-17 00:35:05 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
in mkDerivation rec {
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.38.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}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-yJFYq4t0LzBr+O2bmtBSeehQ2vfUaZIQfOY68WZcHG4=";
|
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
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2023-10-09 19:29:22 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
bison
|
2023-10-09 19:29:22 +00:00
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
ninja
|
|
|
|
];
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
buildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
draco
|
2021-04-17 00:35:05 +00:00
|
|
|
exiv2
|
|
|
|
fcgi
|
2023-10-09 19:29:22 +00:00
|
|
|
geos
|
|
|
|
gsl
|
|
|
|
hdf5
|
2021-04-17 00:35:05 +00:00
|
|
|
libspatialindex
|
|
|
|
libspatialite
|
|
|
|
libzip
|
|
|
|
netcdf
|
2023-10-09 19:29:22 +00:00
|
|
|
openssl
|
|
|
|
pdal
|
|
|
|
postgresql
|
|
|
|
proj
|
|
|
|
protobuf
|
2021-04-17 00:35:05 +00:00
|
|
|
qca-qt5
|
|
|
|
qscintilla
|
2023-10-09 19:29:22 +00:00
|
|
|
qt3d
|
|
|
|
qtbase
|
|
|
|
qtkeychain
|
2023-01-11 07:51:40 +00:00
|
|
|
qtlocation
|
2023-10-09 19:29:22 +00:00
|
|
|
qtmultimedia
|
|
|
|
qtsensors
|
2021-04-17 00:35:05 +00:00
|
|
|
qtserialport
|
|
|
|
qtxmlpatterns
|
2023-10-09 19:29:22 +00:00
|
|
|
qwt
|
|
|
|
sqlite
|
|
|
|
txt2tags
|
2022-01-27 00:19:43 +00:00
|
|
|
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
|
|
|
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
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# Add path to Qt platform plugins
|
|
|
|
# (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py")
|
2024-07-01 15:47:52 +00:00
|
|
|
env.QT_QPA_PLATFORM_PLUGIN_PATH="${qtbase}/${qtbase.qtPluginPrefix}/platforms";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
cmakeFlags = [
|
2022-01-27 00:19:43 +00:00
|
|
|
"-DWITH_3D=True"
|
2023-11-16 04:20:00 +00:00
|
|
|
"-DWITH_PDAL=True"
|
2023-10-09 19:29:22 +00:00
|
|
|
"-DENABLE_TESTS=False"
|
2024-07-01 15:47:52 +00:00
|
|
|
"-DQT_PLUGINS_DIR=${qtbase}/${qtbase.qtPluginPrefix}"
|
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
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
qtWrapperArgs = [
|
2024-07-01 15:47:52 +00:00
|
|
|
"--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix}/platforms"
|
2023-10-09 19:29:22 +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 ''
|
2023-10-09 19:29:22 +00:00
|
|
|
# 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.
|
2023-10-09 19:29:22 +00:00
|
|
|
# Using wrapGAppsHook also prevents file dialogs from crashing the program
|
|
|
|
# on non-NixOS.
|
2024-09-19 14:19:46 +00:00
|
|
|
for program in $out/bin/*; do
|
|
|
|
wrapProgram $program \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ grass ]}
|
|
|
|
done
|
2022-01-27 00:19:43 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Free and Open Source Geographic Information System";
|
2020-12-25 13:55:36 +00:00
|
|
|
homepage = "https://www.qgis.org";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; teams.geospatial.members ++ [ lsix ];
|
|
|
|
platforms = with platforms; linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|