databases/py-sqlite3: fix build with python 3.11

While here, add a simple smoke test which catches this kind of
problems and silence stripping.

PR:		265537
Submitted by:	loader@FreeBSD.org
Approved by:	maintainer timeout (2+ months)
This commit is contained in:
Dmitry Marakasov 2022-11-01 14:20:26 +03:00
parent b510ed883d
commit 561c2dbebb
2 changed files with 7 additions and 1 deletions

View file

@ -35,6 +35,9 @@ post-extract:
.endif
post-install:
${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_sqlite3*.so
@${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_sqlite3*.so
do-test:
@${PYTHON_CMD} -c 'import sqlite3' # minimal smoke test
.include <bsd.port.post.mk>

View file

@ -35,6 +35,9 @@ major, minor = map(int, platform.python_version_tuple()[:2])
if (major, minor) <= (3, 10):
sqlite_srcs.append('_sqlite/cache.c',)
if (major, minor) >= (3, 11):
sqlite_srcs.append('_sqlite/blob.c',)
try:
import ctypes
ctypes.CDLL('libsqlite3.so').sqlite3_load_extension