Opened 15 years ago

Closed 15 years ago

#12439 closed (wontfix)

geos and gdal libraries need to be prefixed by 'cyg' under cygwin

Reported by: kiorky <kiorky@…> Owned by: nobody
Component: GIS Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This fix is trivial and prevent cygwin errors when trying to find the geos and gdal libraries.
Its related also to:

http://trac.osgeo.org/gdal/ticket/3301

svn diff  django/contrib/gis/geos/libgeos.py django/contrib/gis/gdal/libgdal.py
Index: django/contrib/gis/geos/libgeos.py
===================================================================
--- django/contrib/gis/geos/libgeos.py  (revision 11971)
+++ django/contrib/gis/geos/libgeos.py  (working copy)
@@ -38,6 +38,9 @@
         lib_path = find_library(lib_name)
         if not lib_path is None: break

+if 'cygwin' in sys.platform:
+    lib_path = 'cyggeos_c-1.dll'
+
 # No GEOS library could be found.
 if lib_path is None:
     raise ImportError('Could not find the GEOS library (tried "%s"). '
Index: django/contrib/gis/gdal/libgdal.py
===================================================================
--- django/contrib/gis/gdal/libgdal.py  (revision 11971)
+++ django/contrib/gis/gdal/libgdal.py  (working copy)
@@ -28,6 +28,9 @@
         lib_path = find_library(lib_name)
         if not lib_path is None: break

+if 'cygwin' in sys.platform:
+    lib_path = 'cyggdal-1.dll'
+
 if lib_path is None:
     raise OGRException('Could not find the GDAL library (tried "%s"). '
                        'Try setting GDAL_LIBRARY_PATH in your settings.' %

Change History (6)

comment:1 by kiorky <kiorky@…>, 15 years ago

A better patch not to ignore settings value.

$ svn diff django-trunk/django/contrib/gis/gdal/libgdal.py     django-trunk/django/contrib/gis/geos/libgeos.py
Index: django-trunk/django/contrib/gis/gdal/libgdal.py
===================================================================
--- django-trunk/django/contrib/gis/gdal/libgdal.py     (revision 11971)
+++ django-trunk/django/contrib/gis/gdal/libgdal.py     (working copy)
@@ -10,6 +10,10 @@
 except (AttributeError, EnvironmentError, ImportError):
     lib_path = None

+if 'cygwin' in sys.platform and not lib_path:
+    lib_path = 'cyggdal-1.dll'
+
+
 if lib_path:
     lib_names = None
 elif os.name == 'nt':
Index: django-trunk/django/contrib/gis/geos/libgeos.py
===================================================================
--- django-trunk/django/contrib/gis/geos/libgeos.py     (revision 11971)
+++ django-trunk/django/contrib/gis/geos/libgeos.py     (working copy)
@@ -18,6 +18,9 @@
 except (AttributeError, EnvironmentError, ImportError):
     lib_path = None

+if 'cygwin' in sys.platform and not lib_path:
+    lib_path = 'cyggeos_c-1.dll'
+
 # Setting the appropriate names for the GEOS-C library.
 if lib_path:
     lib_names = None
@@ -38,6 +41,7 @@
         lib_path = find_library(lib_name)
         if not lib_path is None: break

+
 # No GEOS library could be found.
 if lib_path is None:
     raise ImportError('Could not find the GEOS library (tried "%s"). '

comment:2 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by jbronn, 15 years ago

Resolution: wontfix
Status: newclosed

Fixing this implies I support cygwin. I don't. This is easily worked around by utilizing the GEOS_LIBRARY_PATH and GDAL_LIBRARY_PATH settings, which were put in for exactly this purpose (e.g., manually specifying the path on a strange platform).

comment:4 by kiorky, 15 years ago

Resolution: wontfix
Status: closedreopened

comment:5 by kiorky, 15 years ago

We don't ask you to support cygwin but to commit a trivial patch to make it easy for cygwin users to run geodjango by default.

in reply to:  5 comment:6 by jbronn, 15 years ago

Resolution: wontfix
Status: reopenedclosed

Replying to kiorky:

We don't ask you to support cygwin but to commit a trivial patch to make it easy for cygwin users to run geodjango by default.

As documented in the contributing docs, do not reopen tickets marked wontfix by a core committer.

You are the only cygwin user. Putting in conditionals for cygwin implies it's supported. This is easily worked around using the built-in settings I described.

Note: See TracTickets for help on using tickets.
Back to Top