grass: add package tests

+25 -2
+7 -2
pkgs/applications/gis/grass/default.nix
··· 1 1 { lib 2 2 , stdenv 3 + , callPackage 3 4 , fetchFromGitHub 4 5 , makeWrapper 5 6 , wrapGAppsHook ··· 31 32 , zstd 32 33 }: 33 34 34 - stdenv.mkDerivation rec { 35 + stdenv.mkDerivation (finalAttrs: rec { 35 36 pname = "grass"; 36 37 version = "8.3.0"; 37 38 ··· 140 141 141 142 enableParallelBuilding = true; 142 143 144 + passthru.tests = { 145 + grass = callPackage ./tests.nix { grass = finalAttrs.finalPackage; }; 146 + }; 147 + 143 148 meta = with lib; { 144 149 description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization"; 145 150 homepage = "https://grass.osgeo.org/"; ··· 147 152 maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ]; 148 153 platforms = platforms.all; 149 154 }; 150 - } 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 + ''