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

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

163 lines
3.0 KiB
Nix
Raw Normal View History

{ lib
, mkDerivation
, fetchFromGitHub
, cmake
, ninja
, flex
, bison
, proj
, geos
, sqlite
, gsl
, qwt
, fcgi
, python3
, libspatialindex
, libspatialite
, postgresql
, txt2tags
, openssl
, libzip
, hdf5
, netcdf
, exiv2
, protobuf
, qtbase
, qtsensors
, qca-qt5
, qtkeychain
, qt3d
, qscintilla
, qtlocation
, qtserialport
, qtxmlpatterns
, withGrass ? true
, grass
, withWebKit ? false
, qtwebkit
, pdal
, zstd
, makeWrapper
, wrapGAppsHook
, substituteAll
}:
2019-02-27 21:08:06 +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
pyqt-builder
sip
setuptools
owslib
six
];
2019-09-09 18:59:38 +00:00
in mkDerivation rec {
2023-01-30 09:22:01 +00:00
version = "3.28.3";
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";
rev = "final-${lib.replaceStrings [ "." ] [ "_" ] version}";
2023-01-30 09:22:01 +00:00
hash = "sha256-nXauZSC78BX1fcx0SXniwQpRmdSLfoqZ5jlbXeHgRGI=";
2019-02-27 21:08:06 +00:00
};
passthru = {
inherit pythonBuildInputs;
inherit py;
2019-02-27 21:08:06 +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
qtlocation
qtserialport
qtxmlpatterns
qt3d
pdal
zstd
] ++ lib.optional withGrass grass
++ lib.optional withWebKit qtwebkit
++ pythonBuildInputs;
2019-02-27 21:08:06 +00:00
nativeBuildInputs = [ makeWrapper wrapGAppsHook cmake flex bison ninja ];
2019-02-27 21:08:06 +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
cmakeFlags = [
"-DWITH_3D=True"
"-DWITH_PDAL=TRUE"
] ++ 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
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
wrapProgram $out/bin/qgis \
"''${gappsWrapperArgs[@]}" \
--prefix PATH : ${lib.makeBinPath [ grass ]}
'';
2019-02-27 21:08:06 +00:00
meta = {
description = "A Free and Open Source Geographic Information System";
homepage = "https://www.qgis.org";
2019-09-09 18:59:38 +00:00
license = lib.licenses.gpl2Plus;
platforms = with lib.platforms; linux;
maintainers = with lib.maintainers; [ lsix sikmir willcohen ];
2019-02-27 21:08:06 +00:00
};
}