summary refs log tree commit diff
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
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
-rw-r--r--pkgs/development/libraries/gdal/default.nix19
-rw-r--r--pkgs/development/libraries/gdal/python.patch17
2 files changed, 35 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
   };
 })
diff --git a/pkgs/development/libraries/gdal/python.patch b/pkgs/development/libraries/gdal/python.patch
new file mode 100644
index 00000000000..50504c62edd
--- /dev/null
+++ b/pkgs/development/libraries/gdal/python.patch
@@ -0,0 +1,17 @@
+diff --git a/swig/python/GNUmakefile.old b/swig/python/GNUmakefile
+index b4d5e90..2160b83 100644
+--- a/swig/python/GNUmakefile
++++ b/swig/python/GNUmakefile
+@@ -67,11 +67,7 @@ egg:
+ 	
+ install:
+ 
+-ifeq ($(PY_HAVE_SETUPTOOLS),1)
+-	$(PYTHON) setup.py install 
+-else
+ 	$(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
+-endif
+ 
+ 	for f in $(SCRIPTS) ; do $(INSTALL) ./scripts/$$f $(DESTDIR)$(INST_BIN) ; done
+ 
+