git.iko.soy/typeable/nixpkgs
on master help sign in
gdal: unbreak the python lib
commit1645795c53807a83561479eebf25bb1adce003ce authorCharles Strahan <charles.c.strahan@gmail.com> dateSat 18 Apr 2015, 17:31 (12 years ago) parent165456b
2 files changed+35−1
pkgs/development/libraries/gdal/default.nix+18−1 pkgs/development/libraries/gdal/python.patch+17
pkgs/development/libraries/gdal/default.nix+18−1
@@ -13,6 +13,12 @@ composableDerivation.composableDerivation {} (fixed: rec {
1313
1414 buildInputs = [ unzip libjpeg libtiff libpng python pythonPackages.numpy proj openssl ];
1515
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+
1622 # Don't use optimization for gcc >= 4.3. That's said to be causing segfaults.
1723 # Unset CC and CXX as they confuse libtool.
1824 preConfigure = "export CFLAGS=-O0 CXXFLAGS=-O0; unset CC CXX";
@@ -31,12 +37,23 @@ composableDerivation.composableDerivation {} (fixed: rec {
3137 "--with-geos=${geos}/bin/geos-config"# optional
3238 ];
3339
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+
3452 meta = {
3553 description = "Translator library for raster geospatial data formats";
3654 homepage = http://www.gdal.org/;
3755 license = stdenv.lib.licenses.mit;
3856 maintainers = [ stdenv.lib.maintainers.marcweber ];
3957 platforms = stdenv.lib.platforms.linux;
40− broken = true; # http://hydra.nixos.org/build/21344907/nixlog/1/raw
4158 };
4259})
pkgs/development/libraries/gdal/python.patchnew file+17
@@ -0,0 +1,17 @@
1+diff --git a/swig/python/GNUmakefile.old b/swig/python/GNUmakefile
2+index b4d5e90..2160b83 100644
3+--- a/swig/python/GNUmakefile
4++++ b/swig/python/GNUmakefile
5+@@ -67,11 +67,7 @@ egg:
6+
7+ install:
8+
9+-ifeq ($(PY_HAVE_SETUPTOOLS),1)
10+- $(PYTHON) setup.py install
11+-else
12+ $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
13+-endif
14+
15+ for f in $(SCRIPTS) ; do $(INSTALL) ./scripts/$$f $(DESTDIR)$(INST_BIN) ; done
16+
17+