167 lines
6.6 KiB
Diff
167 lines
6.6 KiB
Diff
diff -rupN Cartopy-0.19.0rc1/lib/cartopy/_proj4.pxd Cartopy-0.19.0rc1-new/lib/cartopy/_proj4.pxd
|
|
--- Cartopy-0.19.0rc1/lib/cartopy/_proj4.pxd 2021-03-12 16:14:24.000000000 +0100
|
|
+++ Cartopy-0.19.0rc1-new/lib/cartopy/_proj4.pxd 2021-03-23 01:17:48.195109606 +0100
|
|
@@ -23,6 +23,6 @@ cdef extern from "proj_api.h":
|
|
int pj_is_latlong(projPJ) nogil
|
|
char *pj_strerrno(int) nogil
|
|
int *pj_get_errno_ref() nogil
|
|
- char *pj_get_release() nogil
|
|
+ const char *pj_get_release() nogil
|
|
cdef double DEG_TO_RAD
|
|
cdef double RAD_TO_DEG
|
|
diff -rupN Cartopy-0.19.0rc1/setup.py Cartopy-0.19.0rc1-new/setup.py
|
|
--- Cartopy-0.19.0rc1/setup.py 2021-03-12 16:14:24.000000000 +0100
|
|
+++ Cartopy-0.19.0rc1-new/setup.py 2021-03-23 01:29:31.342127777 +0100
|
|
@@ -141,109 +141,11 @@ else:
|
|
|
|
|
|
# Proj
|
|
-def find_proj_version_by_program(conda=None):
|
|
- proj = find_executable('proj')
|
|
- if proj is None:
|
|
- print(
|
|
- 'Proj {} must be installed.'.format(
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION)),
|
|
- file=sys.stderr)
|
|
- exit(1)
|
|
-
|
|
- if conda is not None and conda not in proj:
|
|
- print(
|
|
- 'Proj {} must be installed in Conda environment "{}".'.format(
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION), conda),
|
|
- file=sys.stderr)
|
|
- exit(1)
|
|
-
|
|
- try:
|
|
- proj_version = subprocess.check_output([proj],
|
|
- stderr=subprocess.STDOUT)
|
|
- proj_version = proj_version.split()[1].split(b'.')
|
|
- proj_version = tuple(int(v.strip(b',')) for v in proj_version)
|
|
- except (OSError, IndexError, ValueError, subprocess.CalledProcessError):
|
|
- warnings.warn(
|
|
- 'Unable to determine Proj version. Ensure you have %s or later '
|
|
- 'installed, or installation may fail.' % (
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION), ))
|
|
- proj_version = (0, 0, 0)
|
|
-
|
|
- return proj_version
|
|
-
|
|
-
|
|
-def get_proj_libraries():
|
|
- """
|
|
- This function gets the PROJ libraries to cythonize with
|
|
- """
|
|
- proj_libraries = ["proj"]
|
|
- if os.name == "nt" and (6, 0, 0) <= proj_version < (6, 3, 0):
|
|
- proj_libraries = [
|
|
- "proj_{}_{}".format(proj_version[0], proj_version[1])
|
|
- ]
|
|
- return proj_libraries
|
|
-
|
|
-
|
|
-conda = os.getenv('CONDA_DEFAULT_ENV')
|
|
-if conda is not None and conda in sys.prefix:
|
|
- # Conda does not provide pkg-config compatibility, but the search paths
|
|
- # should be set up so that nothing extra is required. We'll still check
|
|
- # the version, though.
|
|
- proj_version = find_proj_version_by_program(conda)
|
|
- if proj_version < PROJ_MIN_VERSION:
|
|
- print(
|
|
- 'Proj version %s is installed, but cartopy requires at least '
|
|
- 'version %s.' % ('.'.join(str(v) for v in proj_version),
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION)),
|
|
- file=sys.stderr)
|
|
- exit(1)
|
|
-
|
|
- proj_includes = []
|
|
- proj_libraries = get_proj_libraries()
|
|
- proj_library_dirs = []
|
|
-
|
|
-else:
|
|
- try:
|
|
- proj_version = subprocess.check_output(['pkg-config', '--modversion',
|
|
- 'proj'],
|
|
- stderr=subprocess.STDOUT)
|
|
- proj_version = tuple(int(v) for v in proj_version.split(b'.'))
|
|
- proj_includes = subprocess.check_output(['pkg-config', '--cflags',
|
|
- 'proj'])
|
|
- proj_clibs = subprocess.check_output(['pkg-config', '--libs', 'proj'])
|
|
- except (OSError, ValueError, subprocess.CalledProcessError):
|
|
- proj_version = find_proj_version_by_program()
|
|
- if proj_version < PROJ_MIN_VERSION:
|
|
- print(
|
|
- 'Proj version %s is installed, but cartopy requires at least '
|
|
- 'version %s.' % ('.'.join(str(v) for v in proj_version),
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION)),
|
|
- file=sys.stderr)
|
|
- exit(1)
|
|
-
|
|
- proj_includes = []
|
|
- proj_libraries = get_proj_libraries()
|
|
- proj_library_dirs = []
|
|
- else:
|
|
- if proj_version < PROJ_MIN_VERSION:
|
|
- print(
|
|
- 'Proj version %s is installed, but cartopy requires at least '
|
|
- 'version %s.' % ('.'.join(str(v) for v in proj_version),
|
|
- '.'.join(str(v) for v in PROJ_MIN_VERSION)),
|
|
- file=sys.stderr)
|
|
- exit(1)
|
|
-
|
|
- proj_includes = [
|
|
- proj_include[2:] if proj_include.startswith('-I') else
|
|
- proj_include for proj_include in proj_includes.decode().split()]
|
|
-
|
|
- proj_libraries = []
|
|
- proj_library_dirs = []
|
|
- for entry in proj_clibs.decode().split():
|
|
- if entry.startswith('-L'):
|
|
- proj_library_dirs.append(entry[2:])
|
|
- elif entry.startswith('-l'):
|
|
- proj_libraries.append(entry[2:])
|
|
+proj_version = tuple(map(int, os.getenv("PROJ_VERSION").split(".")) )
|
|
+proj_includes = [os.getenv("PROJ_INCLUDE_DIRS")]
|
|
+proj_libraries = [os.getenv("PROJ_LIBRARIES")]
|
|
+proj_library_dirs = []
|
|
+
|
|
|
|
# Python dependencies
|
|
extras_require = {}
|
|
@@ -295,24 +197,31 @@ extensions = [
|
|
['lib/cartopy/trace.pyx'],
|
|
include_dirs=([include_dir, './lib/cartopy', np.get_include()] +
|
|
proj_includes + geos_includes),
|
|
- libraries=proj_libraries + geos_libraries,
|
|
- library_dirs=[library_dir] + proj_library_dirs + geos_library_dirs,
|
|
+ libraries=geos_libraries + ["curl", "sqlite3", "tiff"],
|
|
+ extra_objects=proj_libraries,
|
|
+ extra_link_args=["-fPIC"],
|
|
+ library_dirs=[library_dir] + geos_library_dirs,
|
|
language='c++',
|
|
**extra_extension_args),
|
|
Extension(
|
|
'cartopy._crs',
|
|
['lib/cartopy/_crs.pyx'],
|
|
include_dirs=[include_dir, np.get_include()] + proj_includes,
|
|
- libraries=proj_libraries,
|
|
- library_dirs=[library_dir] + proj_library_dirs,
|
|
+ libraries=["curl", "sqlite3", "tiff"],
|
|
+ library_dirs=[library_dir],
|
|
+ extra_objects=proj_libraries,
|
|
+ extra_link_args=["-fPIC"],
|
|
+ language='c++',
|
|
**extra_extension_args),
|
|
# Requires proj v4.9
|
|
Extension(
|
|
'cartopy.geodesic._geodesic',
|
|
['lib/cartopy/geodesic/_geodesic.pyx'],
|
|
include_dirs=[include_dir, np.get_include()] + proj_includes,
|
|
- libraries=proj_libraries,
|
|
- library_dirs=[library_dir] + proj_library_dirs,
|
|
+ libraries=["curl", "sqlite3", "tiff"],
|
|
+ library_dirs=[library_dir],
|
|
+ extra_objects=proj_libraries,
|
|
+ extra_link_args=["-fPIC"],
|
|
**extra_extension_args),
|
|
]
|
|
|