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 { lib 2 , stdenv 3 , fetchFromGitHub 4 , bison 5 , cmake 6 , gtest ··· 61 , zstd 62 }: 63 64 - stdenv.mkDerivation rec { 65 pname = "gdal"; 66 - version = "3.7.0"; 67 68 src = fetchFromGitHub { 69 owner = "OSGeo"; 70 repo = "gdal"; 71 - rev = "v${version}"; 72 - hash = "sha256-hAuhftIuF9W0bQx73Mz8bAEegrX9g40ippqwv9mdstg="; 73 }; 74 75 nativeBuildInputs = [ ··· 89 "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" 90 "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" 91 "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" 92 - ] ++ lib.optionals doInstallCheck [ 93 "-DBUILD_TESTING=ON" 94 ] ++ lib.optionals (!stdenv.isDarwin) [ 95 "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so ··· 213 popd # autotest 214 ''; 215 216 __darwinAllowLocalNetworking = true; 217 218 meta = with lib; { 219 - changelog = "https://github.com/OSGeo/gdal/blob/${src.rev}/NEWS.md"; 220 description = "Translator library for raster geospatial data formats"; 221 homepage = "https://www.gdal.org/"; 222 license = licenses.mit; 223 maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ]; 224 platforms = platforms.unix; 225 }; 226 - }
··· 1 { lib 2 , stdenv 3 + , callPackage 4 , fetchFromGitHub 5 + 6 , bison 7 , cmake 8 , gtest ··· 63 , zstd 64 }: 65 66 + stdenv.mkDerivation (finalAttrs: { 67 pname = "gdal"; 68 + version = "3.7.1"; 69 70 src = fetchFromGitHub { 71 owner = "OSGeo"; 72 repo = "gdal"; 73 + rev = "v${finalAttrs.version}"; 74 + hash = "sha256-RXX21tCq0xJQli3NTertM9IweONrJfGeaFj3utMFjpM="; 75 }; 76 77 nativeBuildInputs = [ ··· 91 "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}" 92 "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql" 93 "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}" 94 + ] ++ lib.optionals finalAttrs.doInstallCheck [ 95 "-DBUILD_TESTING=ON" 96 ] ++ lib.optionals (!stdenv.isDarwin) [ 97 "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so ··· 215 popd # autotest 216 ''; 217 218 + passthru.tests = { 219 + gdal = callPackage ./tests.nix { gdal = finalAttrs.finalPackage; }; 220 + }; 221 + 222 __darwinAllowLocalNetworking = true; 223 224 meta = with lib; { 225 + changelog = "https://github.com/OSGeo/gdal/blob/v${finalAttrs.version}/NEWS.md"; 226 description = "Translator library for raster geospatial data formats"; 227 homepage = "https://www.gdal.org/"; 228 license = licenses.mit; 229 maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ]; 230 platforms = platforms.unix; 231 }; 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 + ''