2021-05-25 16:31:35 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2023-08-22 08:59:32 +00:00
|
|
|
, makeWrapper
|
|
|
|
, mkDerivation
|
|
|
|
, substituteAll
|
2024-04-26 20:24:03 +00:00
|
|
|
, wrapGAppsHook3
|
2023-08-22 08:59:32 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
|
|
|
|
, withGrass ? true
|
|
|
|
, withWebKit ? false
|
|
|
|
|
|
|
|
, bison
|
2021-05-25 16:31:35 +00:00
|
|
|
, cmake
|
2023-11-01 19:08:38 +00:00
|
|
|
, draco
|
2023-08-22 08:59:32 +00:00
|
|
|
, exiv2
|
|
|
|
, fcgi
|
2021-05-25 16:31:35 +00:00
|
|
|
, flex
|
|
|
|
, geos
|
2023-08-22 08:59:32 +00:00
|
|
|
, grass
|
2021-05-25 16:31:35 +00:00
|
|
|
, gsl
|
2023-08-22 08:59:32 +00:00
|
|
|
, hdf5
|
2021-05-25 16:31:35 +00:00
|
|
|
, libspatialindex
|
|
|
|
, libspatialite
|
|
|
|
, libzip
|
|
|
|
, netcdf
|
2023-08-22 08:59:32 +00:00
|
|
|
, ninja
|
|
|
|
, openssl
|
|
|
|
, pdal
|
|
|
|
, postgresql
|
|
|
|
, proj
|
2021-05-25 16:31:35 +00:00
|
|
|
, protobuf
|
2023-08-22 08:59:32 +00:00
|
|
|
, python3
|
2021-05-25 16:31:35 +00:00
|
|
|
, qca-qt5
|
|
|
|
, qscintilla
|
2023-08-22 08:59:32 +00:00
|
|
|
, qt3d
|
|
|
|
, qtbase
|
|
|
|
, qtkeychain
|
2023-01-02 00:19:03 +00:00
|
|
|
, qtlocation
|
2023-04-05 10:04:54 +00:00
|
|
|
, qtmultimedia
|
2023-08-22 08:59:32 +00:00
|
|
|
, qtsensors
|
2021-05-25 16:31:35 +00:00
|
|
|
, qtserialport
|
|
|
|
, qtwebkit
|
2023-08-22 08:59:32 +00:00
|
|
|
, qtxmlpatterns
|
|
|
|
, qwt
|
|
|
|
, sqlite
|
|
|
|
, txt2tags
|
2021-12-07 21:16:04 +00:00
|
|
|
, zstd
|
2021-05-25 16:31:35 +00:00
|
|
|
}:
|
|
|
|
|
2019-02-27 21:08:06 +00:00
|
|
|
let
|
2021-12-07 21:16:04 +00:00
|
|
|
py = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
pyqt5 = super.pyqt5.override {
|
|
|
|
withLocation = true;
|
2024-02-23 17:21:16 +00:00
|
|
|
withSerialPort = true;
|
2021-12-07 21:16:04 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
pythonBuildInputs = with py.pkgs; [
|
2023-08-22 08:59:32 +00:00
|
|
|
chardet
|
2021-04-13 20:50:04 +00:00
|
|
|
gdal
|
|
|
|
jinja2
|
|
|
|
numpy
|
2023-08-22 08:59:32 +00:00
|
|
|
owslib
|
2021-04-13 20:50:04 +00:00
|
|
|
psycopg2
|
2023-08-22 08:59:32 +00:00
|
|
|
pygments
|
|
|
|
pyqt5
|
2023-11-01 19:08:38 +00:00
|
|
|
pyqt-builder
|
2021-07-03 11:37:24 +00:00
|
|
|
python-dateutil
|
2021-04-13 20:50:04 +00:00
|
|
|
pytz
|
2023-08-22 08:59:32 +00:00
|
|
|
pyyaml
|
|
|
|
qscintilla-qt5
|
2021-04-13 20:50:04 +00:00
|
|
|
requests
|
2022-08-06 02:39:25 +00:00
|
|
|
setuptools
|
2023-08-22 08:59:32 +00:00
|
|
|
sip
|
2021-04-13 20:50:04 +00:00
|
|
|
six
|
2023-08-22 08:59:32 +00:00
|
|
|
urllib3
|
2021-04-13 20:50:04 +00:00
|
|
|
];
|
2019-09-09 18:59:38 +00:00
|
|
|
in mkDerivation rec {
|
2024-05-20 10:33:43 +00:00
|
|
|
version = "3.36.3";
|
2021-05-25 16:31:35 +00:00
|
|
|
pname = "qgis-unwrapped";
|
2019-02-27 21:08:06 +00:00
|
|
|
|
2019-07-14 01:56:44 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qgis";
|
|
|
|
repo = "QGIS";
|
2021-04-13 20:50:04 +00:00
|
|
|
rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2024-05-20 10:33:43 +00:00
|
|
|
hash = "sha256-uPyW/zzoyyd3SXvP+h9joJEv9DjRNJSaorx1rNmAaFQ=";
|
2019-02-27 21:08:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit pythonBuildInputs;
|
2021-12-07 21:16:04 +00:00
|
|
|
inherit py;
|
2019-02-27 21:08:06 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 08:59:32 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2024-04-26 20:24:03 +00:00
|
|
|
wrapGAppsHook3
|
2023-08-22 08:59:32 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
|
2024-03-15 10:29:35 +00:00
|
|
|
bison
|
2023-08-22 08:59:32 +00:00
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
ninja
|
|
|
|
];
|
|
|
|
|
2021-04-13 20:50:04 +00:00
|
|
|
buildInputs = [
|
2023-11-01 19:08:38 +00:00
|
|
|
draco
|
2021-04-13 20:50:04 +00:00
|
|
|
exiv2
|
|
|
|
fcgi
|
2023-08-22 08:59:32 +00:00
|
|
|
geos
|
|
|
|
gsl
|
|
|
|
hdf5
|
2021-04-13 20:50:04 +00:00
|
|
|
libspatialindex
|
|
|
|
libspatialite
|
|
|
|
libzip
|
|
|
|
netcdf
|
2023-08-22 08:59:32 +00:00
|
|
|
openssl
|
|
|
|
pdal
|
|
|
|
postgresql
|
|
|
|
proj
|
|
|
|
protobuf
|
2021-04-13 20:50:04 +00:00
|
|
|
qca-qt5
|
|
|
|
qscintilla
|
2023-08-22 08:59:32 +00:00
|
|
|
qt3d
|
|
|
|
qtbase
|
|
|
|
qtkeychain
|
2023-01-02 00:19:03 +00:00
|
|
|
qtlocation
|
2023-04-05 10:04:54 +00:00
|
|
|
qtmultimedia
|
2023-08-22 08:59:32 +00:00
|
|
|
qtsensors
|
2021-04-13 20:50:04 +00:00
|
|
|
qtserialport
|
|
|
|
qtxmlpatterns
|
2023-08-22 08:59:32 +00:00
|
|
|
qwt
|
|
|
|
sqlite
|
|
|
|
txt2tags
|
2021-12-07 21:16:04 +00:00
|
|
|
zstd
|
2021-04-13 20:50:04 +00:00
|
|
|
] ++ lib.optional withGrass grass
|
2020-12-22 10:13:59 +00:00
|
|
|
++ lib.optional withWebKit qtwebkit
|
|
|
|
++ pythonBuildInputs;
|
2019-02-27 21:08:06 +00:00
|
|
|
|
2022-08-06 02:39:25 +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}";
|
|
|
|
})
|
|
|
|
];
|
2019-02-27 21:08:06 +00:00
|
|
|
|
2023-08-22 08:59:32 +00:00
|
|
|
# Add path to Qt platform plugins
|
|
|
|
# (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py")
|
|
|
|
preBuild = ''
|
|
|
|
export QT_QPA_PLATFORM_PLUGIN_PATH=${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms
|
|
|
|
'';
|
|
|
|
|
2021-04-13 20:50:04 +00:00
|
|
|
cmakeFlags = [
|
2023-11-01 19:08:38 +00:00
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2021-12-07 10:14:41 +00:00
|
|
|
"-DWITH_3D=True"
|
2023-11-01 19:08:38 +00:00
|
|
|
"-DWITH_PDAL=True"
|
2023-08-26 13:12:58 +00:00
|
|
|
"-DENABLE_TESTS=False"
|
2021-04-13 20:50:04 +00:00
|
|
|
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
|
2023-01-02 00:23:58 +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}"
|
|
|
|
);
|
2019-02-27 21:08:06 +00:00
|
|
|
|
2023-08-22 08:59:32 +00:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase.bin}/lib/qt-${qtbase.version}/plugins/platforms"
|
|
|
|
];
|
|
|
|
|
2022-08-06 02:39:25 +00:00
|
|
|
dontWrapGApps = true; # wrapper params passed below
|
|
|
|
|
2021-12-07 21:16:04 +00:00
|
|
|
postFixup = lib.optionalString withGrass ''
|
2023-08-22 08:59:32 +00:00
|
|
|
# GRASS has to be availble on the command line even though we baked in
|
2022-08-06 02:39:25 +00:00
|
|
|
# the path at build time using GRASS_PREFIX.
|
2023-08-22 08:59:32 +00:00
|
|
|
# Using wrapGAppsHook also prevents file dialogs from crashing the program
|
|
|
|
# on non-NixOS.
|
2021-12-07 21:16:04 +00:00
|
|
|
wrapProgram $out/bin/qgis \
|
2022-08-06 02:39:25 +00:00
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2021-12-07 21:16:04 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ grass ]}
|
|
|
|
'';
|
|
|
|
|
2023-06-19 15:19:14 +00:00
|
|
|
meta = with lib; {
|
2024-06-07 07:46:46 +00:00
|
|
|
description = "Free and Open Source Geographic Information System";
|
2020-12-22 10:13:59 +00:00
|
|
|
homepage = "https://www.qgis.org";
|
2023-06-19 15:19:14 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; teams.geospatial.members ++ [ lsix ];
|
|
|
|
platforms = with platforms; linux;
|
2019-02-27 21:08:06 +00:00
|
|
|
};
|
|
|
|
}
|