lol
1{ stdenv, fetchurl, composableDerivation, unzip, libjpeg, libtiff, zlib
2, postgresql, mysql, libgeotiff, python, pythonPackages, proj, geos, openssl
3, libpng }:
4
5composableDerivation.composableDerivation {} (fixed: rec {
6 version = "1.11.3";
7 name = "gdal-${version}";
8
9 src = fetchurl {
10 url = "http://download.osgeo.org/gdal/${version}/${name}.tar.gz";
11 sha256 = "561588bdfd9ca91919d4679a77a2b44214b158934ee8b425295ca5be33a1014d";
12 };
13
14 buildInputs = [ unzip libjpeg libtiff libpng python pythonPackages.numpy proj openssl ];
15
16 patches = [
17 # This ensures that the python package is installed into gdal's prefix,
18 # rather than trying to install into python's prefix.
19 ./python.patch
20 ];
21
22 # Don't use optimization for gcc >= 4.3. That's said to be causing segfaults.
23 # Unset CC and CXX as they confuse libtool.
24 preConfigure = "export CFLAGS=-O0 CXXFLAGS=-O0; unset CC CXX";
25
26 configureFlags = [
27 "--with-jpeg=${libjpeg}"
28 "--with-libtiff=${libtiff}" # optional (without largetiff support)
29 "--with-libpng=${libpng}" # optional
30 "--with-libz=${zlib}" # optional
31
32 "--with-pg=${postgresql}/bin/pg_config"
33 "--with-mysql=${mysql.lib}/bin/mysql_config"
34 "--with-geotiff=${libgeotiff}"
35 "--with-python" # optional
36 "--with-static-proj4=${proj}" # optional
37 "--with-geos=${geos}/bin/geos-config"# optional
38 ];
39
40 # Prevent this:
41 #
42 # Checking .pth file support in /nix/store/xkrmb8xnvqxzjwsdmasqmsdh1a5y2y99-gdal-1.11.2/lib/python2.7/site-packages/
43 # /nix/store/pbi1lgank10fy0xpjckbdpgacqw34dsz-python-2.7.9/bin/python -E -c pass
44 # TEST FAILED: /nix/store/xkrmb8xnvqxzjwsdmasqmsdh1a5y2y99-gdal-1.11.2/lib/python2.7/site-packages/ does NOT support .pth files
45 # error: bad install directory or PYTHONPATH
46 preBuild = ''
47 pythonInstallDir=$out/lib/${python.libPrefix}/site-packages
48 mkdir -p $pythonInstallDir
49 export PYTHONPATH=''${PYTHONPATH:+''${PYTHONPATH}:}$pythonInstallDir
50 '';
51
52 meta = {
53 description = "Translator library for raster geospatial data formats";
54 homepage = http://www.gdal.org/;
55 license = stdenv.lib.licenses.mit;
56 maintainers = [ stdenv.lib.maintainers.marcweber ];
57 platforms = stdenv.lib.platforms.linux;
58 };
59})