diff options
Diffstat (limited to 'pkgs/development/libraries/gdal/default.nix')
-rw-r--r-- | pkgs/development/libraries/gdal/default.nix | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index 07f370b42100..0bb91951a28d 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -7,13 +7,13 @@ with stdenv.lib; -composableDerivation.composableDerivation {} (fixed: rec { - version = "2.1.3"; +stdenv.mkDerivation rec { + version = "2.2.1"; name = "gdal-${version}"; src = fetchurl { - url = "http://download.osgeo.org/gdal/${version}/${name}.tar.gz"; - sha256 = "0jh7filpf5dk5iz5acj7y3y49ihnzqypxckdlj0sjigbqq6hlsmf"; + url = "http://download.osgeo.org/gdal/${version}/${name}.tar.xz"; + sha256 = "0rk0p0k787whzzdl8m1f9wcrm7h9bf1pny3z96d93b4383arhw4j"; }; buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite @@ -22,16 +22,6 @@ composableDerivation.composableDerivation {} (fixed: rec { ++ stdenv.lib.optional stdenv.isDarwin libiconv ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ]; - hardeningDisable = [ "format" ]; - - # - Unset CC and CXX as they confuse libtool. - # - teach gdal that libdf is the legacy name for libhdf - preConfigure = '' - unset CC CXX - substituteInPlace configure \ - --replace "-lmfhdf -ldf" "-lmfhdf -lhdf" - ''; - configureFlags = [ "--with-jpeg=${libjpeg.dev}" "--with-libtiff=${libtiff.dev}" # optional (without largetiff support) @@ -50,6 +40,25 @@ composableDerivation.composableDerivation {} (fixed: rec { (if netcdfSupport then "--with-netcdf=${netcdf}" else "") ]; + hardeningDisable = [ "format" ]; + + CXXFLAGS = "-fpermissive"; + + postPatch = '' + sed -i '/ifdef bool/i\ + #ifdef swap\ + #undef swap\ + #endif' ogr/ogrsf_frmts/mysql/ogr_mysql.h + ''; + + # - Unset CC and CXX as they confuse libtool. + # - teach gdal that libdf is the legacy name for libhdf + preConfigure = '' + unset CC CXX + substituteInPlace configure \ + --replace "-lmfhdf -ldf" "-lmfhdf -lhdf" + ''; + preBuild = '' substituteInPlace swig/python/GNUmakefile \ --replace "ifeq (\$(STD_UNIX_LAYOUT),\"TRUE\")" "ifeq (1,1)" @@ -59,6 +68,8 @@ composableDerivation.composableDerivation {} (fixed: rec { wrapPythonPrograms ''; + enableParallelBuilding = true; + meta = { description = "Translator library for raster geospatial data formats"; homepage = http://www.gdal.org/; @@ -66,4 +77,4 @@ composableDerivation.composableDerivation {} (fixed: rec { maintainers = [ stdenv.lib.maintainers.marcweber ]; platforms = with stdenv.lib.platforms; linux ++ darwin; }; -}) +} |