Skip to content
Commits on Source (5)
python-pyproj (1.9.5.1-4) UNRELEASED; urgency=medium
python-pyproj (1.9.5.1-4) unstable; urgency=medium
[ Bas Couwenberg ]
* Update copyright-format URL to use HTTPS.
* Bump Standards-Version to 4.1.4, no changes.
* Check DEB_BUILD_PROFILES for nocheck in dh_auto_test override.
......@@ -8,8 +9,17 @@ python-pyproj (1.9.5.1-4) UNRELEASED; urgency=medium
* Add module import tests to autopkgtest configuration.
* Drop ancient X-Python{,3}-Version fields.
* Strip trailing whitespace from control & rules files.
* Use DEP-3 headers for Cython patch, specifically Origin header.
* Move _proj.c out of the way before the build and restore it afterwards.
-- Bas Couwenberg <sebastic@debian.org> Sun, 21 Jan 2018 10:39:51 +0100
[ Iain Lane ]
* debian/patches/Use-Cython-in-setup.py-to-generate-C-code-on-the-fly.patch:
Cherry-pick from upstream. This makes _proj.c get regenerated during the
build, which fixes FTBFS when it is incompatible with the current python
version (e.g. the shipped _proj.c doesn't work with python 3.7).
* debian/control: Build-Depend on cython for the above.
-- Bas Couwenberg <sebastic@debian.org> Wed, 04 Jul 2018 16:09:05 +0200
python-pyproj (1.9.5.1-3) unstable; urgency=medium
......
......@@ -6,6 +6,7 @@ Section: python
Priority: optional
Build-Depends: debhelper (>= 9),
dh-python,
cython,
python-all-dev,
python-setuptools,
python-numpy,
......
Description: Use Cython in setup.py to generate C code on the fly from _proj.pyx.
Author: Micah Cochran <micahcochran@users.noreply.github.com>
Origin: https://github.com/jswhit/pyproj/commit/fd7b5ea23d5cb0b5c45a9a9ee5bf1c0e446cf474
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
To install:
* clone github repo or download source release at http://python.org/pypi/pyproj.
+* If you clone the github repo, (Cython)[http://cython.org/] is a dependency.
* python setup.py build
* python setup.py install (with sudo if necessary).
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,15 @@ import sys, os, glob, subprocess, shutil
from distutils import ccompiler, sysconfig
from setuptools import setup, Extension
+USE_CYTHON = False
+
+# is this a repository
+if not os.path.isfile("_proj.c"):
+ # no _proj.c, repository
+ USE_CYTHON = True
+
+ext = '.pyx' if USE_CYTHON else '.c'
+
proj_dir = os.environ.get('PROJ_DIR')
# if PROJ_DIR env var is set, build against
@@ -20,7 +29,7 @@ if proj_dir is not None:
incdirs.append(os.path.join(proj_dir,'include'))
pyprojext =\
- Extension("pyproj._proj",["_proj.c"],include_dirs=incdirs,library_dirs=libdirs,\
+ Extension("pyproj._proj",["_proj"+ext],include_dirs=incdirs,library_dirs=libdirs,\
runtime_library_dirs=libdirs,libraries=libraries)
extensions = [pyprojext]
@@ -48,7 +57,7 @@ else:
#macros.append(('HAVE_STRERROR',1))
# for win32 threads
#macros.append(('MUTEX_win32',1))
- extensions = [Extension("pyproj._proj",deps+['_proj.c'],
+ extensions = [Extension("pyproj._proj",deps+['_proj'+ext],
include_dirs=['src'],define_macros=macros)]
# create binary datum shift grid files.
@@ -75,6 +84,17 @@ else:
datafiles = [os.path.join('data',os.path.basename(f)) for f in datafiles]
package_data = {'pyproj':datafiles}
+# use Cython to generate the C code (_proj.c) from _proj.pyx
+if USE_CYTHON:
+ try:
+ from Cython.Build import cythonize
+ except ImportError:
+ sys.stderr.write("\n\n_proj.c does not exist in a repository copy.\n"
+ "ImportError: Cython must be installed in order to generate _proj.c\n"
+ "\tto install Cython run `pip install cython`\n")
+ sys.exit(1)
+
+ extensions = cythonize(extensions)
packages = ['pyproj']
package_dirs = {'':'lib'}
01-use_proj-data_instead_of_embedded.patch
02-pyproj_datadir.patch
international-typo.patch
Use-Cython-in-setup.py-to-generate-C-code-on-the-fly.patch
......@@ -29,6 +29,16 @@ override_dh_clean:
nad2bin nad2bin.o \
src/pj_malloc.o
override_dh_auto_configure:
mv -v $(CURDIR)/_proj.c $(CURDIR)/_proj.c.bak
dh_auto_configure
override_dh_auto_build:
dh_auto_build
mv -v $(CURDIR)/_proj.c.bak $(CURDIR)/_proj.c
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
PYBUILD_SYSTEM=custom \
......