mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
databases/py-gdbm: convert to USE_PYTHON=pep517
PR: 268283
This commit is contained in:
parent
c80aa929f5
commit
7a5f12ca6a
3 changed files with 35 additions and 24 deletions
|
@ -1,6 +1,6 @@
|
|||
PORTNAME= gdbm
|
||||
DISTVERSION= ${PYTHON_DISTVERSION}
|
||||
PORTREVISION= 8
|
||||
PORTREVISION= 9
|
||||
CATEGORIES= databases python
|
||||
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
@ -11,22 +11,35 @@ MAINTAINER= python@FreeBSD.org
|
|||
COMMENT= Python bindings to the GNU dbm library (Python ${PYTHON_VER})
|
||||
|
||||
LICENSE= PSFL
|
||||
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= libgdbm.so:databases/gdbm
|
||||
|
||||
USES= compiler:c11 python tar:xz
|
||||
USE_PYTHON= allflavors autoplist distutils
|
||||
USE_PYTHON= allflavors autoplist pep517
|
||||
|
||||
DISTINFO_FILE= ${.CURDIR}/../../lang/python${PYTHON_SUFFIX}/distinfo
|
||||
PYDISTUTILS_INSTALLARGS+= --install-lib ${PYTHONPREFIX_LIBDIR}/lib-dynload
|
||||
DISTINFO_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo
|
||||
WRKSRC_SUBDIR= Modules
|
||||
|
||||
SUB_LIST+= DISTVERSION=${DISTVERSION}
|
||||
SUB_FILES= pyproject.toml
|
||||
PLIST_FILES= ${PYTHONPREFIX_LIBDIR:S;${PREFIX}/;;}/lib-dynload/_gdbm${PYTHON_EXT_SUFFIX}.so
|
||||
|
||||
PORTSCOUT= ignore:1
|
||||
|
||||
post-extract:
|
||||
@${CP} ${FILESDIR}/setup.py ${WRKSRC}/setup.py
|
||||
pre-configure:
|
||||
@${CP} ${FILESDIR}/setup.py ${WRKSRC}
|
||||
@${MV} ${WRKDIR}/pyproject.toml ${WRKSRC}
|
||||
|
||||
post-install:
|
||||
${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/lib-dynload/_gdbm.cpython-${PYTHON_SUFFIX}.so
|
||||
@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/_gdbm${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/_gdbm${PYTHON_EXT_SUFFIX}.so)
|
||||
|
||||
do-test:
|
||||
@${PYTHON_CMD} -c 'import dbm' # minimal smoke test
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
11
databases/py-gdbm/files/pyproject.toml.in
Normal file
11
databases/py-gdbm/files/pyproject.toml.in
Normal file
|
@ -0,0 +1,11 @@
|
|||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "gdbm"
|
||||
version = "%%DISTVERSION%%"
|
||||
description = "GNU dbm extension to Python"
|
||||
|
||||
[tool.setuptools]
|
||||
packages = []
|
|
@ -1,27 +1,14 @@
|
|||
#!/usr/bin/env python
|
||||
# To use:
|
||||
# python setup.py install
|
||||
#
|
||||
|
||||
try:
|
||||
import distutils
|
||||
from distutils import sysconfig
|
||||
from distutils.command.install import install
|
||||
from distutils.core import setup, Extension
|
||||
except:
|
||||
raise SystemExit("Distutils problem")
|
||||
import sysconfig
|
||||
from setuptools import setup, Extension
|
||||
|
||||
install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]]
|
||||
|
||||
prefix = sysconfig.PREFIX
|
||||
prefix = sysconfig.get_config_var('prefix')
|
||||
inc_dirs = [prefix + "/include"]
|
||||
lib_dirs = [prefix + "/lib"]
|
||||
libs = ["gdbm"]
|
||||
|
||||
setup(name = "gdbm",
|
||||
description = "GDBM Extension to Python",
|
||||
|
||||
ext_modules = [Extension('_gdbm', ['_gdbmmodule.c'],
|
||||
setup(ext_modules = [Extension('_gdbm', ['_gdbmmodule.c'],
|
||||
include_dirs = inc_dirs,
|
||||
libraries = libs,
|
||||
library_dirs = lib_dirs)]
|
||||
|
|
Loading…
Add table
Reference in a new issue