fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv, fetchurl, fetchpatch, unzip, libjpeg, libtiff, zlib
2, postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl
3, libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
4, libiconv
5, netcdfSupport ? true, netcdf, hdf5, curl
6}:
7
8with stdenv.lib;
9
10stdenv.mkDerivation rec {
11 name = "gdal-${version}";
12 version = "2.3.1";
13
14 src = fetchurl {
15 url = "https://download.osgeo.org/gdal/${version}/${name}.tar.xz";
16 sha256 = "0nkjnznrp7dr41zsh8j923c9zpc3i5vj3wjfc2df9rrybb22ailw";
17 };
18
19 buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite
20 libspatialite poppler hdf4 qhull giflib expat ]
21 ++ (with pythonPackages; [ python numpy wrapPython ])
22 ++ stdenv.lib.optional stdenv.isDarwin libiconv
23 ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ];
24
25 configureFlags = [
26 "--with-expat=${expat.dev}"
27 "--with-jpeg=${libjpeg.dev}"
28 "--with-libtiff=${libtiff.dev}" # optional (without largetiff support)
29 "--with-png=${libpng.dev}" # optional
30 "--with-poppler=${poppler.dev}" # optional
31 "--with-libz=${zlib.dev}" # optional
32 "--with-pg=${postgresql}/bin/pg_config"
33 "--with-mysql=${mysql.connector-c or mysql}/bin/mysql_config"
34 "--with-geotiff=${libgeotiff}"
35 "--with-sqlite3=${sqlite.dev}"
36 "--with-spatialite=${libspatialite}"
37 "--with-python" # optional
38 "--with-proj=${proj}" # optional
39 "--with-geos=${geos}/bin/geos-config"# optional
40 "--with-hdf4=${hdf4.dev}" # optional
41 (if netcdfSupport then "--with-netcdf=${netcdf}" else "")
42 ];
43
44 hardeningDisable = [ "format" ];
45
46 CXXFLAGS = "-fpermissive";
47
48 postPatch = ''
49 sed -i '/ifdef bool/i\
50 #ifdef swap\
51 #undef swap\
52 #endif' ogr/ogrsf_frmts/mysql/ogr_mysql.h
53 '';
54
55 # - Unset CC and CXX as they confuse libtool.
56 # - teach gdal that libdf is the legacy name for libhdf
57 preConfigure = ''
58 unset CC CXX
59 substituteInPlace configure \
60 --replace "-lmfhdf -ldf" "-lmfhdf -lhdf"
61 '';
62
63 preBuild = ''
64 substituteInPlace swig/python/GNUmakefile \
65 --replace "ifeq (\$(STD_UNIX_LAYOUT),\"TRUE\")" "ifeq (1,1)"
66 '';
67
68 postInstall = ''
69 wrapPythonPrograms
70 '';
71
72 enableParallelBuilding = true;
73
74 meta = {
75 description = "Translator library for raster geospatial data formats";
76 homepage = http://www.gdal.org/;
77 license = stdenv.lib.licenses.mit;
78 maintainers = [ stdenv.lib.maintainers.marcweber ];
79 platforms = with stdenv.lib.platforms; linux ++ darwin;
80 };
81}