Code

Opened 5 years ago

Closed 4 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: UI/UX:

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.' %

Attachments (0)

Change History (6)

comment:1 Changed 5 years ago by kiorky <kiorky@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 4 years ago by russellm

  • Triage Stage changed from Unreviewed to Design decision needed

comment:3 Changed 4 years ago by jbronn

  • Resolution set to wontfix
  • Status changed from new to closed

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 Changed 4 years ago by kiorky

  • Resolution wontfix deleted
  • Status changed from closed to reopened

comment:5 follow-up: Changed 4 years ago by 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.

comment:6 in reply to: ↑ 5 Changed 4 years ago by jbronn

  • Resolution set to wontfix
  • Status changed from reopened to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.