6 , useMinimalFeatures ? false
7 , useTiledb ? (!useMinimalFeatures) && !(stdenv.isDarwin && stdenv.isx86_64)
8 , useLibHEIF ? (!useMinimalFeatures)
9 , useLibJXL ? (!useMinimalFeatures)
10 , useMysql ? (!useMinimalFeatures)
11 , usePostgres ? (!useMinimalFeatures)
12 , usePoppler ? (!useMinimalFeatures)
13 , useArrow ? (!useMinimalFeatures)
14 , useHDF ? (!useMinimalFeatures)
15 , useNetCDF ? (!useMinimalFeatures)
16 , useArmadillo ? (!useMinimalFeatures)
77 stdenv.mkDerivation (finalAttrs: {
81 src = fetchFromGitHub {
84 rev = "v${finalAttrs.version}";
85 hash = "sha256-+69mh1hKL1r7SNwDilaQz5UochMMWFG2lrBLYBF31JY=";
94 python3.pkgs.setuptools
95 python3.pkgs.wrapPython
100 "-DGDAL_USE_INTERNAL_LIBS=OFF"
101 "-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include"
102 "-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}"
103 "-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql"
104 "-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}"
105 ] ++ lib.optionals finalAttrs.doInstallCheck [
107 ] ++ lib.optionals (!stdenv.isDarwin) [
108 "-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so
109 ] ++ lib.optionals stdenv.isDarwin [
110 "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
111 ] ++ lib.optionals (!useTiledb) [
112 "-DGDAL_USE_TILEDB=OFF"
117 tileDbDeps = lib.optionals useTiledb [ tiledb ];
118 libHeifDeps = lib.optionals useLibHEIF [
126 libJxlDeps = lib.optionals useLibJXL [
130 mysqlDeps = lib.optionals useMysql [ libmysqlclient ];
131 postgresDeps = lib.optionals usePostgres [ postgresql ];
132 popplerDeps = lib.optionals usePoppler [ poppler ];
133 arrowDeps = lib.optionals useArrow [ arrow-cpp ];
134 hdfDeps = lib.optionals useHDF [
138 netCdfDeps = lib.optionals useNetCDF [ netcdf ];
139 armadilloDeps = lib.optionals useArmadillo [ armadillo ];
141 darwinDeps = lib.optionals stdenv.isDarwin [ libiconv ];
142 nonDarwinDeps = lib.optionals (!stdenv.isDarwin) ([
143 # tests for formats enabled by these packages fail on macos
197 enableParallelBuilding = true;
199 doInstallCheck = true;
200 # preCheck rather than preInstallCheck because this is what pytestCheckHook
201 # calls (coming from the python world)
205 export HOME=$(mktemp -d)
206 export PYTHONPATH="$out/${python3.sitePackages}:$PYTHONPATH"
207 export GDAL_DOWNLOAD_TEST_DATA=OFF
208 # allows to skip tests that fail because of file handle leak
209 # the issue was not investigated
210 # https://github.com/OSGeo/gdal/blob/v3.7.0/autotest/gdrivers/bag.py#L61
211 export BUILD_NAME=fedora
213 nativeInstallCheckInputs = with python3.pkgs; [
219 disabledTestPaths = [
220 # tests that attempt to make network requests
222 "gdrivers/gdalhttp.py"
226 # tests that attempt to make network requests
227 "test_jp2openjpeg_45"
228 # tests that require the full proj dataset which we don't package yet
229 # https://github.com/OSGeo/gdal/issues/5523
230 "test_transformer_dem_overrride_srs"
231 "test_osr_ct_options_area_of_interest"
232 # ZIP does not support timestamps before 1980
233 "test_sentinel2_zipped"
234 # tries to call unwrapped executable
235 "test_SetPROJAuxDbPaths"
236 # fixed and renamed in 3.8.0RC1
237 # https://github.com/OSGeo/gdal/commit/c8b471ca1e6318866ff668d2b57bb6f076e3ae29
239 ] ++ lib.optionals (!stdenv.isx86_64) [
240 # likely precision-related expecting x87 behaviour
241 "test_jp2openjpeg_22"
242 ] ++ lib.optionals stdenv.isDarwin [
244 "test_rda_download_queue"
245 ] ++ lib.optionals (lib.versionOlder proj.version "8") [
246 "test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members"
247 ] ++ lib.optionals (!usePoppler) [
248 "test_pdf_jpx_compression"
255 gdal = callPackage ./tests.nix { gdal = finalAttrs.finalPackage; };
258 __darwinAllowLocalNetworking = true;
261 changelog = "https://github.com/OSGeo/gdal/blob/v${finalAttrs.version}/NEWS.md";
262 description = "Translator library for raster geospatial data formats";
263 homepage = "https://www.gdal.org/";
264 license = licenses.mit;
265 maintainers = with maintainers; teams.geospatial.members ++ [ marcweber dotlambda ];
266 platforms = platforms.unix;