View | Details | Raw Unified | Return to bug 268283
Collapse All | Expand All

(-)b/databases/py-sqlite3/Makefile (-1 / +21 lines)
Lines 18-24 LIB_DEPENDS= libsqlite3.so:databases/sqlite3 Link Here
18
PORTSCOUT=	ignore:1
18
PORTSCOUT=	ignore:1
19
19
20
USES=		compiler:c11 python:2.7+ tar:xz
20
USES=		compiler:c11 python:2.7+ tar:xz
21
USE_PYTHON=	autoplist distutils allflavors
21
USE_PYTHON=	autoplist allflavors
22
.if ${FLAVOR:U} == py27
23
USE_PYTHON+=	distutils
24
.else
25
USE_PYTHON+=	cython pep517
26
BUILD_DEPENDS+=	${UNZIP_CMD}:archivers/unzip \
27
		${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
28
		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
29
.endif
22
30
23
DISTINFO_FILE=	${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
31
DISTINFO_FILE=	${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
24
WRKSRC_SUBDIR=	Modules
32
WRKSRC_SUBDIR=	Modules
Lines 34-39 post-extract: Link Here
34
	@${CP} ${FILESDIR}/setup.py ${WRKSRC}
42
	@${CP} ${FILESDIR}/setup.py ${WRKSRC}
35
.else
43
.else
36
	@${CP} ${FILESDIR}/setup3.py ${WRKSRC}/setup.py
44
	@${CP} ${FILESDIR}/setup3.py ${WRKSRC}/setup.py
45
	@${SED} -e 's|PY_VERSION|${PYTHON_DISTVERSION}|' ${FILESDIR}/pyproject.toml.in >>  ${WRKSRC}/pyproject.toml
46
	${TOUCH} ${WRKSRC}/__init__.py
47
.endif
48
49
.if ${FLAVOR:U} != py27
50
do-install:
51
	@${MKDIR} ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload
52
	@cd ${INSTALL_WRKSRC} \
53
	    && ${UNZIP_CMD} -d ${STAGEDIR}${PYTHONPREFIX_LIBDIR}/lib-dynload ${BUILD_WRKSRC}/dist/${PORTNAME:C|[-_]+|_|g}-${DISTVERSION}*.whl
54
	@${PYTHON_CMD} -B ${PORTSDIR}/Mk/Scripts/strip_RECORD.py \
55
		${STAGEDIR}/${PYTHONPREFIX_LIBDIR}/lib-dynload/${PORTNAME:C|[-_]+|_|g}-${DISTVERSION}*.dist-info/RECORD | \
56
		${SED} -e 's|^|${PYTHONPREFIX_LIBDIR}/lib-dynload/|' >> ${_PYTHONPKGLIST}
37
.endif
57
.endif
38
58
39
post-install:
59
post-install:
(-)b/databases/py-sqlite3/files/pyproject.toml.in (+14 lines)
Added Link Here
1
[build-system]
2
requires = ["setuptools", "cython", "wheel"]
3
build-backend = "setuptools.build_meta"
4
5
[project]
6
name = "sqlite3"
7
version = "PY_VERSION"
8
9
[tool.setuptools.packages.find]
10
exclude=["*"]
11
12
[tool.setuptools.package-data]
13
"*" = ["_sqlite3.cpython-*.so"]
14
(-)b/databases/py-sqlite3/files/setup3.py (-27 / +26 lines)
Lines 4-34 Link Here
4
#
4
#
5
5
6
import platform
6
import platform
7
import sysconfig
7
8
8
try:
9
try:
9
    import distutils
10
    from setuptools import Extension, setup
10
    from distutils import sysconfig
11
except Exception as e:
11
    from distutils.command.install import install
12
    raise SystemExit("Setuptools problem", e)
12
    from distutils.core import setup, Extension
13
except:
14
    raise SystemExit("Distutils problem")
15
13
16
install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]
17
14
18
prefix = sysconfig.PREFIX
15
prefix = sysconfig.get_config_var('base')
19
inc_dirs = [prefix + "/include", "Modules/_sqlite"]
16
inc_dirs = [prefix + "/include", "Modules/_sqlite"]
20
lib_dirs = [prefix + "/lib"]
17
lib_dirs = [prefix + "/lib"]
21
libs = ["sqlite3"]
18
libs = ["sqlite3"]
22
macros = [('MODULE_NAME', '"sqlite3"')]
19
macros = [('MODULE_NAME', '"sqlite3"')]
23
sqlite_srcs = [
20
sqlite_srcs = [
24
'_sqlite/connection.c',
21
    '_sqlite/connection.c',
25
'_sqlite/cursor.c',
22
    '_sqlite/cursor.c',
26
'_sqlite/microprotocols.c',
23
    '_sqlite/microprotocols.c',
27
'_sqlite/module.c',
24
    '_sqlite/module.c',
28
'_sqlite/prepare_protocol.c',
25
    '_sqlite/prepare_protocol.c',
29
'_sqlite/row.c',
26
    '_sqlite/row.c',
30
'_sqlite/statement.c',
27
    '_sqlite/statement.c',
31
'_sqlite/util.c']
28
    '_sqlite/util.c'
29
]
32
30
33
major, minor = map(int, platform.python_version_tuple()[:2])
31
major, minor = map(int, platform.python_version_tuple()[:2])
34
32
Lines 44-56 try: Link Here
44
except AttributeError:
42
except AttributeError:
45
    macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1'))
43
    macros.append(('SQLITE_OMIT_LOAD_EXTENSION', '1'))
46
44
47
setup(name = "sqlite3",
45
setup(
48
      description = "SQLite 3 extension to Python",
46
    ext_modules=[
49
47
        Extension(
50
      ext_modules = [Extension('_sqlite3', sqlite_srcs,
48
            "_sqlite3",
51
                               include_dirs = inc_dirs,
49
            sources = sqlite_srcs,
52
                               libraries = libs,
50
            include_dirs = inc_dirs,
53
                               library_dirs = lib_dirs,
51
            libraries = libs,
54
                               runtime_library_dirs = lib_dirs,
52
            runtime_library_dirs = lib_dirs,
55
                               define_macros = macros)]
53
            define_macros = macros
56
      )
54
        )
55
    ]
56
)
57
- 

Return to bug 268283