grass: add package tests

+25 -2
+7 -2
pkgs/applications/gis/grass/default.nix
··· 1 { lib 2 , stdenv 3 , fetchFromGitHub 4 , makeWrapper 5 , wrapGAppsHook ··· 31 , zstd 32 }: 33 34 - stdenv.mkDerivation rec { 35 pname = "grass"; 36 version = "8.3.0"; 37 ··· 140 141 enableParallelBuilding = true; 142 143 meta = with lib; { 144 description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization"; 145 homepage = "https://grass.osgeo.org/"; ··· 147 maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ]; 148 platforms = platforms.all; 149 }; 150 - }
··· 1 { lib 2 , stdenv 3 + , callPackage 4 , fetchFromGitHub 5 , makeWrapper 6 , wrapGAppsHook ··· 32 , zstd 33 }: 34 35 + stdenv.mkDerivation (finalAttrs: rec { 36 pname = "grass"; 37 version = "8.3.0"; 38 ··· 141 142 enableParallelBuilding = true; 143 144 + passthru.tests = { 145 + grass = callPackage ./tests.nix { grass = finalAttrs.finalPackage; }; 146 + }; 147 + 148 meta = with lib; { 149 description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization"; 150 homepage = "https://grass.osgeo.org/"; ··· 152 maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ]; 153 platforms = platforms.all; 154 }; 155 + })
+18
pkgs/applications/gis/grass/tests.nix
···
··· 1 + { runCommand, grass }: 2 + 3 + let 4 + inherit (grass) pname version; 5 + 6 + in 7 + runCommand "${pname}-tests" { meta.timeout = 60; } 8 + '' 9 + HOME=$(mktemp -d) 10 + 11 + ${grass}/bin/grass --tmp-location EPSG:3857 --exec g.version \ 12 + | grep 'GRASS ${version}' 13 + 14 + ${grass}/bin/grass --tmp-location EPSG:3857 --exec g.mapset -l \ 15 + | grep 'PERMANENT' 16 + 17 + touch $out 18 + ''