From 7d3dacbdab723f153faca711f8b3239272e87788 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 4 Apr 2015 21:19:52 +0100 Subject: [PATCH] django: add a django_gis variant which patches django to properly point at its gis libs but therefore also has them as dependencies (gdal for one can be quite big) Conflicts: pkgs/top-level/python-packages.nix --- .../django/1.7.7-gis-libs.template.patch | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 10 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/django/1.7.7-gis-libs.template.patch diff --git a/pkgs/development/python-modules/django/1.7.7-gis-libs.template.patch b/pkgs/development/python-modules/django/1.7.7-gis-libs.template.patch new file mode 100644 index 000000000000..7757691bfca1 --- /dev/null +++ b/pkgs/development/python-modules/django/1.7.7-gis-libs.template.patch @@ -0,0 +1,24 @@ +diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py +--- a/django/contrib/gis/gdal/libgdal.py ++++ b/django/contrib/gis/gdal/libgdal.py +@@ -17,7 +17,7 @@ try: + lib_path = settings.GDAL_LIBRARY_PATH + except (AttributeError, EnvironmentError, + ImportError, ImproperlyConfigured): +- lib_path = None ++ lib_path = "@gdal@/lib/libgdal.so" + + if lib_path: + lib_names = None +diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py +--- a/django/contrib/gis/geos/libgeos.py ++++ b/django/contrib/gis/geos/libgeos.py +@@ -23,7 +23,7 @@ try: + lib_path = settings.GEOS_LIBRARY_PATH + except (AttributeError, EnvironmentError, + ImportError, ImproperlyConfigured): +- lib_path = None ++ lib_path = "@geos@/lib/libgeos_c.so" + + # Setting the appropriate names for the GEOS-C library. + if lib_path: diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d386f9131dbe..26f36be4808e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6226,6 +6226,16 @@ in modules // { django = self.django_1_7; + django_gis = self.django.override rec { + patches = [ + (pkgs.substituteAll { + src = ../development/python-modules/django/1.7.7-gis-libs.template.patch; + geos = pkgs.geos; + gdal = pkgs.gdal; + }) + ]; + }; + django_1_8 = buildPythonPackage rec { name = "Django-${version}"; version = "1.8.4";