2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bison
|
|
|
|
, cmake
|
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, swig
|
|
|
|
, armadillo
|
|
|
|
, arrow-cpp
|
|
|
|
, c-blosc
|
|
|
|
, brunsli
|
|
|
|
, cfitsio
|
|
|
|
, crunch
|
|
|
|
, curl
|
|
|
|
, cryptopp
|
|
|
|
, libdeflate
|
|
|
|
, expat
|
|
|
|
, libgeotiff
|
|
|
|
, geos
|
|
|
|
, giflib
|
|
|
|
, libheif
|
|
|
|
, dav1d
|
|
|
|
, libaom
|
|
|
|
, libde265
|
|
|
|
, rav1e
|
|
|
|
, x265
|
|
|
|
, hdf4
|
|
|
|
, hdf5-cpp
|
|
|
|
, libiconv
|
|
|
|
, libjpeg
|
|
|
|
, json_c
|
|
|
|
, libjxl
|
|
|
|
, libhwy
|
|
|
|
, lerc
|
|
|
|
, xz
|
|
|
|
, libxml2
|
|
|
|
, lz4
|
|
|
|
, libmysqlclient
|
|
|
|
, netcdf
|
|
|
|
, openexr
|
|
|
|
, openjpeg
|
|
|
|
, openssl
|
|
|
|
, pcre2
|
|
|
|
, libpng
|
|
|
|
, poppler
|
|
|
|
, postgresql
|
|
|
|
, proj
|
|
|
|
, qhull
|
|
|
|
, libspatialite
|
|
|
|
, sqlite
|
|
|
|
, libtiff
|
2023-05-24 13:37:59 +00:00
|
|
|
, useTiledb ? !(stdenv.isDarwin && stdenv.isx86_64)
|
2022-11-21 17:40:18 +00:00
|
|
|
, tiledb
|
|
|
|
, libwebp
|
|
|
|
, xercesc
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "gdal";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.6.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OSGeo";
|
|
|
|
repo = "gdal";
|
2021-08-27 14:25:00 +00:00
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-pGdZmQBUuNCk9/scUvq4vduINu5gqtCRLaz7QE2e6WU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
cmake
|
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
pkg-config
|
|
|
|
python3.pkgs.setuptools
|
|
|
|
python3.pkgs.wrapPython
|
|
|
|
swig
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DGDAL_USE_INTERNAL_LIBS=OFF"
|
|
|
|
"-DGEOTIFF_INCLUDE_DIR=${lib.getDev libgeotiff}/include"
|
|
|
|
"-DGEOTIFF_LIBRARY_RELEASE=${lib.getLib libgeotiff}/lib/libgeotiff${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
|
|
"-DMYSQL_INCLUDE_DIR=${lib.getDev libmysqlclient}/include/mysql"
|
2023-02-02 18:25:31 +00:00
|
|
|
"-DMYSQL_LIBRARY=${lib.getLib libmysqlclient}/lib/${lib.optionalString (libmysqlclient.pname != "mysql") "mysql/"}libmysqlclient${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON" # without, libgdal.so can't find libmariadb.so
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
|
2023-05-24 13:37:59 +00:00
|
|
|
] ++ lib.optionals (!useTiledb) [
|
|
|
|
"-DGDAL_USE_TILEDB=OFF"
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
armadillo
|
|
|
|
c-blosc
|
|
|
|
brunsli
|
|
|
|
cfitsio
|
|
|
|
crunch
|
|
|
|
curl
|
|
|
|
cryptopp
|
|
|
|
libdeflate
|
|
|
|
expat
|
2020-04-24 23:36:52 +00:00
|
|
|
libgeotiff
|
2022-11-21 17:40:18 +00:00
|
|
|
geos
|
2020-04-24 23:36:52 +00:00
|
|
|
giflib
|
2022-11-21 17:40:18 +00:00
|
|
|
libheif
|
|
|
|
dav1d # required by libheif
|
|
|
|
libaom # required by libheif
|
|
|
|
libde265 # required by libheif
|
|
|
|
rav1e # required by libheif
|
|
|
|
x265 # required by libheif
|
|
|
|
hdf4
|
|
|
|
hdf5-cpp
|
|
|
|
libjpeg
|
|
|
|
json_c
|
|
|
|
libjxl
|
|
|
|
libhwy # required by libjxl
|
|
|
|
lerc
|
|
|
|
xz
|
2020-04-24 23:36:52 +00:00
|
|
|
libxml2
|
2022-11-21 17:40:18 +00:00
|
|
|
lz4
|
|
|
|
libmysqlclient
|
|
|
|
netcdf
|
|
|
|
openjpeg
|
|
|
|
openssl
|
|
|
|
pcre2
|
|
|
|
libpng
|
|
|
|
poppler
|
2020-04-24 23:36:52 +00:00
|
|
|
postgresql
|
2022-11-21 17:40:18 +00:00
|
|
|
proj
|
|
|
|
qhull
|
|
|
|
libspatialite
|
|
|
|
sqlite
|
|
|
|
libtiff
|
2023-05-24 13:37:59 +00:00
|
|
|
] ++ lib.optionals useTiledb [
|
2022-11-21 17:40:18 +00:00
|
|
|
tiledb
|
2023-05-24 13:37:59 +00:00
|
|
|
] ++ [
|
2022-11-21 17:40:18 +00:00
|
|
|
libwebp
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
python3
|
|
|
|
python3.pkgs.numpy
|
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
# tests for formats enabled by these packages fail on macos
|
|
|
|
arrow-cpp
|
|
|
|
openexr
|
|
|
|
xercesc
|
|
|
|
] ++ lib.optional stdenv.isDarwin libiconv;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
# preCheck rather than preInstallCheck because this is what pytestCheckHook
|
|
|
|
# calls (coming from the python world)
|
|
|
|
preCheck = ''
|
|
|
|
pushd ../autotest
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
2022-11-21 17:40:18 +00:00
|
|
|
export PYTHONPATH="$out/${python3.sitePackages}:$PYTHONPATH"
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeInstallCheckInputs = with python3.pkgs; [
|
2022-04-15 01:41:22 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-env
|
|
|
|
lxml
|
|
|
|
];
|
|
|
|
disabledTestPaths = [
|
|
|
|
# tests that attempt to make network requests
|
|
|
|
"gcore/vsis3.py"
|
|
|
|
"gdrivers/gdalhttp.py"
|
|
|
|
"gdrivers/wms.py"
|
|
|
|
];
|
|
|
|
disabledTests = [
|
|
|
|
# tests that attempt to make network requests
|
|
|
|
"test_jp2openjpeg_45"
|
|
|
|
# tests that require the full proj dataset which we don't package yet
|
|
|
|
# https://github.com/OSGeo/gdal/issues/5523
|
|
|
|
"test_transformer_dem_overrride_srs"
|
|
|
|
"test_osr_ct_options_area_of_interest"
|
2022-11-21 17:40:18 +00:00
|
|
|
# ZIP does not support timestamps before 1980
|
|
|
|
" test_sentinel2_zipped"
|
2023-03-15 16:39:30 +00:00
|
|
|
# tries to call unwrapped executable
|
|
|
|
"test_SetPROJAuxDbPaths"
|
2022-04-15 01:41:22 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isx86_64) [
|
|
|
|
# likely precision-related expecting x87 behaviour
|
|
|
|
"test_jp2openjpeg_22"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# flaky on macos
|
|
|
|
"test_rda_download_queue"
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.optionals (lib.versionOlder proj.version "8") [
|
|
|
|
"test_ogr_parquet_write_crs_without_id_in_datum_ensemble_members"
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
postCheck = ''
|
|
|
|
popd # ../autotest
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Translator library for raster geospatial data formats";
|
|
|
|
homepage = "https://www.gdal.org/";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/OSGeo/gdal/blob/${src.rev}/NEWS.md";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2022-11-21 17:40:18 +00:00
|
|
|
maintainers = with lib.maintainers; [ marcweber dotlambda ];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|