summary refs log tree commit diff
path: root/pkgs/development/libraries/gdal/default.nix
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2015-04-18 17:31:09 -0400
committerCharles Strahan <charles.c.strahan@gmail.com>2015-04-18 17:33:49 -0400
commit1645795c53807a83561479eebf25bb1adce003ce (patch)
tree3826a155ca3fd1aa3f97073d7d7029942b3f1f9b /pkgs/development/libraries/gdal/default.nix
parent165456bba21636f04056e6db69e1a6df713018d5 (diff)
downloadnixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar.gz
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar.bz2
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar.lz
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar.xz
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.tar.zst
nixpkgs-1645795c53807a83561479eebf25bb1adce003ce.zip
gdal: unbreak the python lib
Diffstat (limited to 'pkgs/development/libraries/gdal/default.nix')
-rw-r--r--pkgs/development/libraries/gdal/default.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index f6a49d61f6d..fe7d0869fbd 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -13,6 +13,12 @@ composableDerivation.composableDerivation {} (fixed: rec {
 
   buildInputs = [ unzip libjpeg libtiff libpng python pythonPackages.numpy proj openssl ];
 
+  patches = [
+    # This ensures that the python package is installed into gdal's prefix,
+    # rather than trying to install into python's prefix.
+    ./python.patch
+  ];
+
   # Don't use optimization for gcc >= 4.3. That's said to be causing segfaults.
   # Unset CC and CXX as they confuse libtool.
   preConfigure = "export CFLAGS=-O0 CXXFLAGS=-O0; unset CC CXX";
@@ -31,12 +37,23 @@ composableDerivation.composableDerivation {} (fixed: rec {
     "--with-geos=${geos}/bin/geos-config"# optional
   ];
 
+  # Prevent this:
+  #
+  #   Checking .pth file support in /nix/store/xkrmb8xnvqxzjwsdmasqmsdh1a5y2y99-gdal-1.11.2/lib/python2.7/site-packages/
+  #   /nix/store/pbi1lgank10fy0xpjckbdpgacqw34dsz-python-2.7.9/bin/python -E -c pass
+  #   TEST FAILED: /nix/store/xkrmb8xnvqxzjwsdmasqmsdh1a5y2y99-gdal-1.11.2/lib/python2.7/site-packages/ does NOT support .pth files
+  #   error: bad install directory or PYTHONPATH
+  preBuild = ''
+    pythonInstallDir=$out/lib/${python.libPrefix}/site-packages
+    mkdir -p $pythonInstallDir
+    export PYTHONPATH=''${PYTHONPATH:+''${PYTHONPATH}:}$pythonInstallDir
+  '';
+
   meta = {
     description = "Translator library for raster geospatial data formats";
     homepage = http://www.gdal.org/;
     license = stdenv.lib.licenses.mit;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
     platforms = stdenv.lib.platforms.linux;
-    broken = true; # http://hydra.nixos.org/build/21344907/nixlog/1/raw
   };
 })