mirror of
https://git.freebsd.org/ports.git
synced 2025-05-05 07:57:38 -04:00
databases/py-sqlite3: convert to USE_PYTHON=pep517
PR: 268283
This commit is contained in:
parent
7a5f12ca6a
commit
b7e75ada7e
3 changed files with 30 additions and 29 deletions
|
@ -1,6 +1,6 @@
|
||||||
PORTNAME= sqlite3
|
PORTNAME= sqlite3
|
||||||
DISTVERSION= ${PYTHON_DISTVERSION}
|
DISTVERSION= ${PYTHON_DISTVERSION}
|
||||||
PORTREVISION= 9
|
PORTREVISION= 10
|
||||||
CATEGORIES= databases python
|
CATEGORIES= databases python
|
||||||
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
|
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
|
||||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||||
|
@ -13,29 +13,33 @@ COMMENT= Standard Python binding to the SQLite3 library (Python ${PYTHON_VER})
|
||||||
LICENSE= PSFL
|
LICENSE= PSFL
|
||||||
LICENSE_FILE= ${WRKDIR}/Python-${DISTVERSION}/LICENSE
|
LICENSE_FILE= ${WRKDIR}/Python-${DISTVERSION}/LICENSE
|
||||||
|
|
||||||
|
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \
|
||||||
|
${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
|
||||||
LIB_DEPENDS= libsqlite3.so:databases/sqlite3
|
LIB_DEPENDS= libsqlite3.so:databases/sqlite3
|
||||||
|
|
||||||
PORTSCOUT= ignore:1
|
|
||||||
|
|
||||||
USES= compiler:c11 python tar:xz
|
USES= compiler:c11 python tar:xz
|
||||||
USE_PYTHON= autoplist distutils allflavors
|
USE_PYTHON= allflavors autoplist pep517
|
||||||
|
|
||||||
DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
|
DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
|
||||||
WRKSRC_SUBDIR= Modules
|
WRKSRC_SUBDIR= Modules
|
||||||
|
|
||||||
PYDISTUTILS_INSTALLARGS+= --install-lib ${PYTHON_LIBDIR}/lib-dynload
|
SUB_LIST+= DISTVERSION=${DISTVERSION}
|
||||||
|
SUB_FILES= pyproject.toml
|
||||||
|
PLIST_FILES= ${PYTHONPREFIX_LIBDIR:S;${PREFIX}/;;}/lib-dynload/_sqlite3${PYTHON_EXT_SUFFIX}.so
|
||||||
|
|
||||||
TESTING_UNSAFE= ModuleNotFoundError: No module named '_sqlite3'
|
PORTSCOUT= ignore:1
|
||||||
|
|
||||||
.include <bsd.port.pre.mk>
|
pre-configure:
|
||||||
|
|
||||||
post-extract:
|
|
||||||
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
|
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
|
||||||
|
@${MV} ${WRKDIR}/pyproject.toml ${WRKSRC}
|
||||||
|
|
||||||
post-install:
|
post-install:
|
||||||
@${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_sqlite3*.so
|
@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_sqlite3${PYTHON_EXT_SUFFIX}.so
|
||||||
|
# lib-dynload is the expected location
|
||||||
|
@${MKDIR} ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload
|
||||||
|
@(cd ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload && ${LN} -s ../site-packages/_sqlite3${PYTHON_EXT_SUFFIX}.so)
|
||||||
|
|
||||||
do-test:
|
do-test:
|
||||||
@${PYTHON_CMD} -c 'import sqlite3' # minimal smoke test
|
@${PYTHON_CMD} -c 'import sqlite3' # minimal smoke test
|
||||||
|
|
||||||
.include <bsd.port.post.mk>
|
.include <bsd.port.mk>
|
||||||
|
|
11
databases/py-sqlite3/files/pyproject.toml.in
Normal file
11
databases/py-sqlite3/files/pyproject.toml.in
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "sqlite3"
|
||||||
|
version = "%%DISTVERSION%%"
|
||||||
|
description = "SQLite 3 extension to Python"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = []
|
|
@ -1,21 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# To use:
|
|
||||||
# python setup.py install
|
|
||||||
#
|
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
|
import sysconfig
|
||||||
|
from setuptools import setup, Extension
|
||||||
|
|
||||||
try:
|
prefix = sysconfig.get_config_var('prefix')
|
||||||
import distutils
|
|
||||||
from distutils import sysconfig
|
|
||||||
from distutils.command.install import install
|
|
||||||
from distutils.core import setup, Extension
|
|
||||||
except:
|
|
||||||
raise SystemExit("Distutils problem")
|
|
||||||
|
|
||||||
install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]
|
|
||||||
|
|
||||||
prefix = sysconfig.PREFIX
|
|
||||||
inc_dirs = [prefix + "/include", "Modules/_sqlite"]
|
inc_dirs = [prefix + "/include", "Modules/_sqlite"]
|
||||||
lib_dirs = [prefix + "/lib"]
|
lib_dirs = [prefix + "/lib"]
|
||||||
libs = ["sqlite3"]
|
libs = ["sqlite3"]
|
||||||
|
@ -44,10 +33,7 @@ try:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1'))
|
macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1'))
|
||||||
|
|
||||||
setup(name = "sqlite3",
|
setup(ext_modules = [Extension('_sqlite3', sqlite_srcs,
|
||||||
description = "SQLite 3 extension to Python",
|
|
||||||
|
|
||||||
ext_modules = [Extension('_sqlite3', sqlite_srcs,
|
|
||||||
include_dirs = inc_dirs,
|
include_dirs = inc_dirs,
|
||||||
libraries = libs,
|
libraries = libs,
|
||||||
library_dirs = lib_dirs,
|
library_dirs = lib_dirs,
|
||||||
|
|
Loading…
Add table
Reference in a new issue