gentoo/dev-python/psycopg/files/psycopg-2.7.3-avoid-mxdatetime.patch
Aaron W. Swenson 4eeca29c1c
dev-python/psycopg: Bump to 2.7.3.2 and many fixes
Apply a couple patches. One for building documentation (634730) and
another to avoid building against mxdatetime from the antiquated
dev-python/egenix-mx-base (452028, 629430).

This version knows how to parse the new PostgreSQL version scheme
(625540).

Docs build again (540996).

Bug: https://bugs.gentoo.org/452028
Bug: https://bugs.gentoo.org/540996
Bug: https://bugs.gentoo.org/625540
Bug: https://bugs.gentoo.org/629430
Bug: https://bugs.gentoo.org/634730
Package-Manager: Portage-2.3.13, Repoman-2.3.3
2018-01-12 16:01:04 -05:00

41 lines
1.8 KiB
Diff

Index: psycopg2-2.7.3/setup.py
===================================================================
--- psycopg2-2.7.3.orig/setup.py
+++ psycopg2-2.7.3/setup.py
@@ -527,20 +527,21 @@ have_pydatetime = True
have_mxdatetime = False
use_pydatetime = int(parser.get('build_ext', 'use_pydatetime'))
-# check for mx package
-mxincludedir = ''
-if parser.has_option('build_ext', 'mx_include_dir'):
- mxincludedir = parser.get('build_ext', 'mx_include_dir')
-if not mxincludedir:
- mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
-if mxincludedir.strip() and os.path.exists(mxincludedir):
- # Build the support for mx: we will check at runtime if it can be imported
- include_dirs.append(mxincludedir)
- define_macros.append(('HAVE_MXDATETIME', '1'))
- sources.append('adapter_mxdatetime.c')
- depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
- have_mxdatetime = True
- version_flags.append('mx')
+if not use_pydatetime:
+ # check for mx package
+ mxincludedir = ''
+ if parser.has_option('build_ext', 'mx_include_dir'):
+ mxincludedir = parser.get('build_ext', 'mx_include_dir')
+ if not mxincludedir:
+ mxincludedir = os.path.join(get_python_inc(plat_specific=1), "mx")
+ if mxincludedir.strip() and os.path.exists(mxincludedir):
+ # Build the support for mx: we will check at runtime if it can be imported
+ include_dirs.append(mxincludedir)
+ define_macros.append(('HAVE_MXDATETIME', '1'))
+ sources.append('adapter_mxdatetime.c')
+ depends.extend(['adapter_mxdatetime.h', 'typecast_mxdatetime.c'])
+ have_mxdatetime = True
+ version_flags.append('mx')
# now decide which package will be the default for date/time typecasts
if have_pydatetime and (use_pydatetime or not have_mxdatetime):