mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
54444b5892
Add NixOS test for QGIS and QGIS-LTR. This test creates QGIS vector memory layer containing Nix snowflake. This proves that application can successfully start and Python bindings are working. By default, Python script is executed in non-interactive mode and QGIS is closed after script is finished. This script can be also executed interactively by running following command: ``` nix-build -A qgis QGIS_TEST_INTERACTIVE=True ./result/bin/qgis --code pkgs/applications/gis/qgis/test.py ``` In this case, QGIS is not automatically closed.
44 lines
917 B
Nix
44 lines
917 B
Nix
{ lib
|
|
, makeWrapper
|
|
, nixosTests
|
|
, symlinkJoin
|
|
|
|
, extraPythonPackages ? (ps: [ ])
|
|
|
|
, libsForQt5
|
|
}:
|
|
let
|
|
qgis-ltr-unwrapped = libsForQt5.callPackage ./unwrapped-ltr.nix { };
|
|
in symlinkJoin rec {
|
|
|
|
inherit (qgis-ltr-unwrapped) version;
|
|
name = "qgis-${version}";
|
|
|
|
paths = [ qgis-ltr-unwrapped ];
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
qgis-ltr-unwrapped.py.pkgs.wrapPython
|
|
];
|
|
|
|
# extend to add to the python environment of QGIS without rebuilding QGIS application.
|
|
pythonInputs = qgis-ltr-unwrapped.pythonBuildInputs ++ (extraPythonPackages qgis-ltr-unwrapped.py.pkgs);
|
|
|
|
postBuild = ''
|
|
# unpackPhase
|
|
|
|
buildPythonPath "$pythonInputs"
|
|
|
|
wrapProgram $out/bin/qgis \
|
|
--prefix PATH : $program_PATH \
|
|
--set PYTHONPATH $program_PYTHONPATH
|
|
'';
|
|
|
|
passthru = {
|
|
unwrapped = qgis-ltr-unwrapped;
|
|
tests.qgis-ltr = nixosTests.qgis-ltr;
|
|
};
|
|
|
|
inherit (qgis-ltr-unwrapped) meta;
|
|
}
|