nixpkgs/pkgs/applications/gis/qgis/unwrapped-ltr.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

194 lines
3.6 KiB
Nix
Raw Permalink Normal View History

{ lib
, fetchFromGitHub
, makeWrapper
, mkDerivation
, substituteAll
, wrapGAppsHook3
2024-03-15 09:46:31 +00:00
, wrapQtAppsHook
, withGrass
2024-09-16 10:51:21 +00:00
, withServer
, withWebKit
, bison
, cmake
2024-03-15 09:46:31 +00:00
, draco
, exiv2
, fcgi
, flex
, geos
, grass
, gsl
, hdf5
, libspatialindex
, libspatialite
, libzip
, netcdf
, ninja
, openssl
2024-03-15 09:46:31 +00:00
, pdal
, postgresql
, proj
, protobuf
, python311
, qca-qt5
, qscintilla
, qt3d
, qtbase
, qtkeychain
, qtlocation
2024-03-15 09:46:31 +00:00
, qtmultimedia
, qtsensors
, qtserialport
, qtwebkit
, qtxmlpatterns
, qwt
, sqlite
, txt2tags
2022-02-18 15:22:43 +00:00
, zstd
}:
let
py = python311.override {
self = py;
packageOverrides = self: super: {
pyqt5 = super.pyqt5.override {
withLocation = true;
};
};
};
pythonBuildInputs = with py.pkgs; [
chardet
gdal
jinja2
numpy
owslib
psycopg2
pygments
pyqt5
2024-03-15 09:46:31 +00:00
pyqt-builder
python-dateutil
pytz
pyyaml
qscintilla-qt5
requests
setuptools
sip
six
urllib3
];
in mkDerivation rec {
2024-09-16 09:16:09 +00:00
version = "3.34.11";
pname = "qgis-ltr-unwrapped";
src = fetchFromGitHub {
owner = "qgis";
repo = "QGIS";
rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
2024-09-16 09:16:09 +00:00
hash = "sha256-VNgUMEA7VKZXsLG1ZYUIlYvjwRrH8LsliGiVRMnXOM0=";
};
passthru = {
inherit pythonBuildInputs;
inherit py;
};
nativeBuildInputs = [
makeWrapper
wrapGAppsHook3
2024-03-15 09:46:31 +00:00
wrapQtAppsHook
bison
cmake
flex
ninja
];
buildInputs = [
2024-03-15 09:46:31 +00:00
draco
exiv2
fcgi
2024-03-15 09:46:31 +00:00
geos
gsl
hdf5
libspatialindex
libspatialite
libzip
netcdf
2024-03-15 09:46:31 +00:00
openssl
pdal
postgresql
proj
protobuf
qca-qt5
qscintilla
2024-03-15 09:46:31 +00:00
qt3d
qtbase
qtkeychain
qtlocation
2024-03-15 09:46:31 +00:00
qtmultimedia
qtsensors
qtserialport
qtxmlpatterns
2024-03-15 09:46:31 +00:00
qwt
sqlite
txt2tags
2022-02-18 15:22:43 +00:00
zstd
] ++ lib.optional withGrass grass
++ lib.optional withWebKit qtwebkit
++ pythonBuildInputs;
patches = [
(substituteAll {
2024-07-12 13:07:47 +00:00
src = ./set-pyqt-package-dirs-ltr.patch;
pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}";
qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}";
})
];
2024-03-15 09:46:31 +00:00
# Add path to Qt platform plugins
# (offscreen is needed by "${APIS_SRC_DIR}/generate_console_pap.py")
env.QT_QPA_PLATFORM_PLUGIN_PATH="${qtbase}/${qtbase.qtPluginPrefix}/platforms";
2024-03-15 09:46:31 +00:00
cmakeFlags = [
"-DWITH_3D=True"
2024-03-15 09:46:31 +00:00
"-DWITH_PDAL=True"
"-DENABLE_TESTS=False"
] ++ lib.optional (!withWebKit) "-DWITH_QTWEBKIT=OFF"
2024-09-16 10:51:21 +00:00
++ lib.optional withServer [
"-DWITH_SERVER=True"
"-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin"
] ++ lib.optional withGrass (let
2023-01-02 00:23:58 +00:00
gmajor = lib.versions.major grass.version;
gminor = lib.versions.minor grass.version;
in "-DGRASS_PREFIX${gmajor}=${grass}/grass${gmajor}${gminor}"
);
2024-03-15 09:46:31 +00:00
qtWrapperArgs = [
"--set QT_QPA_PLATFORM_PLUGIN_PATH ${qtbase}/${qtbase.qtPluginPrefix}/platforms"
2024-03-15 09:46:31 +00:00
];
dontWrapGApps = true; # wrapper params passed below
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.
# Using wrapGAppsHook also prevents file dialogs from crashing the program
# on non-NixOS.
for program in $out/bin/*; do
wrapProgram $program \
"''${gappsWrapperArgs[@]}" \
--prefix PATH : ${lib.makeBinPath [ grass ]}
done
'';
meta = with lib; {
description = "Free and Open Source Geographic Information System";
homepage = "https://www.qgis.org";
license = licenses.gpl2Plus;
maintainers = with maintainers; teams.geospatial.members ++ [ lsix ];
platforms = with platforms; linux;
};
}