Merge pull request #243422 from imincik/gdal-3.7.1

gdal: 3.7.0 -> 3.7.1 and add package tests

authored by

Sandro and committed by
GitHub
82951ca7 139259a3

+59 -7
+13 -7
pkgs/development/libraries/gdal/default.nix
··· 1 1 { lib 2 2 , stdenv 3 + , callPackage 3 4 , fetchFromGitHub 5 + 4 6 , bison 5 7 , cmake 6 8 , gtest ··· 61 63 , zstd 62 64 }: 63 65 64 - stdenv.mkDerivation rec { 66 + stdenv.mkDerivation (finalAttrs: { 65 67 pname = "gdal"; 66 - version = "3.7.0"; 68 + version = "3.7.1"; 67 69 68 70 src = fetchFromGitHub { 69 71 owner = "OSGeo"; 70 72 repo = "gdal"; 71 - rev = "v${version}"; 72 - hash = "sha256-hAuhftIuF9W0bQx73Mz8bAEegrX9g40ippqwv9mdstg="; 73 + rev = "v${finalAttrs.version}"; 74 + hash = "sha256-RXX21tCq0xJQli3NTertM9IweONrJfGeaFj3utMFjpM="; 73 75 }; 74 76 75 77 nativeBuildInputs = [ ··· 89 91 "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" 90 92 "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" 91 93 "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" 92 - ] ++ lib.optionals doInstallCheck [ 94 + ] ++ lib.optionals finalAttrs.doInstallCheck [ 93 95 "-DBUILD_TESTING=ON" 94 96 ] ++ lib.optionals (!stdenv.isDarwin) [ 95 97 "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so ··· 213 215 popd # autotest 214 216 ''; 215 217 218 + passthru.tests = { 219 + gdal = callPackage ./tests.nix { gdal = finalAttrs.finalPackage; }; 220 + }; 221 + 216 222 __darwinAllowLocalNetworking = true; 217 223 218 224 meta = with lib; { 219 - changelog = "https://github.com/OSGeo/gdal/blob/${src.rev}/NEWS.md"; 225 + changelog = "https://github.com/OSGeo/gdal/blob/v${finalAttrs.version}/NEWS.md"; 220 226 description = "Translator library for raster geospatial data formats"; 221 227 homepage = "https://www.gdal.org/"; 222 228 license = licenses.mit; 223 229 maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ]; 224 230 platforms = platforms.unix; 225 231 }; 226 - } 232 + })
+46
pkgs/development/libraries/gdal/tests.nix
··· 1 + { runCommand, gdal }: 2 + 3 + let 4 + inherit (gdal) pname version; 5 + 6 + in 7 + runCommand "${pname}-tests" { 8 + nativeBuildInputs = [ gdal ]; 9 + meta.timeout = 60; 10 + } '' 11 + # test version 12 + ogrinfo --version \ 13 + | grep 'GDAL ${version}' 14 + 15 + gdalinfo --version \ 16 + | grep 'GDAL ${version}' 17 + 18 + 19 + # test formats 20 + ogrinfo --formats \ 21 + | grep 'GPKG.*GeoPackage' 22 + 23 + gdalinfo --formats \ 24 + | grep 'GTiff.*GeoTIFF' 25 + 26 + 27 + # test vector file 28 + echo -e "Latitude,Longitude,Name\n48.1,0.25,'Test point'" > test.csv 29 + ogrinfo ./test.csv 30 + 31 + 32 + # test raster file 33 + gdal_create \ 34 + -a_srs "EPSG:4326" \ 35 + -of GTiff \ 36 + -ot UInt16 \ 37 + -a_nodata 255 \ 38 + -burn 0 \ 39 + -outsize 800 600 \ 40 + -co COMPRESS=LZW \ 41 + test.tif 42 + 43 + gdalinfo ./test.tif 44 + 45 + touch $out 46 + ''