diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2021-11-10 20:27:02 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2021-11-24 17:00:33 +0000 |
commit | 27f3f4018fbe293d3a12dd2fd8212a93c4619b9a (patch) | |
tree | 19c0ec84ea81254973933eb712e0477717a10dbe | |
parent | d6f568cf8a0c57c1280efb31b1b2ab850a87267f (diff) | |
download | ports-27f3f4018fbe293d3a12dd2fd8212a93c4619b9a.tar.gz ports-27f3f4018fbe293d3a12dd2fd8212a93c4619b9a.zip |
databases/py-sqlite3: fix build with python 3.11
PR: 259745
Approved by: python
-rw-r--r-- | databases/py-sqlite3/files/setup3.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/databases/py-sqlite3/files/setup3.py b/databases/py-sqlite3/files/setup3.py index 4a5bf6bb5ef6..7407503ceb54 100644 --- a/databases/py-sqlite3/files/setup3.py +++ b/databases/py-sqlite3/files/setup3.py @@ -3,6 +3,8 @@ # python setup.py install # +import platform + try: import distutils from distutils import sysconfig @@ -19,7 +21,6 @@ lib_dirs = [prefix + "/lib"] libs = ["sqlite3"] macros = [('MODULE_NAME', '"sqlite3"')] sqlite_srcs = [ -'_sqlite/cache.c', '_sqlite/connection.c', '_sqlite/cursor.c', '_sqlite/microprotocols.c', @@ -29,6 +30,11 @@ sqlite_srcs = [ '_sqlite/statement.c', '_sqlite/util.c'] +major, minor = map(int, platform.python_version_tuple()[:2]) + +if (major, minor) <= (3, 10): + sqlite_srcs.append('_sqlite/cache.c',) + try: import ctypes ctypes.CDLL('libsqlite3.so').sqlite3_load_extension |