databases/py-gdbm: fix build with Python 3.12+

Certain internal headers are included unconditionally starting with
Python 3.12, but this should have been built with the appropriate
preprocessor macros for internal headers set anyway.

PR: 286298
Event: Kitchener-Waterloo Hackathon 202506
This commit is contained in:
Charlie Li
2025-06-17 15:06:26 -04:00
parent 0c37a95f96
commit a73665376a
2 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
PORTNAME= gdbm
DISTVERSION= ${PYTHON_DISTVERSION}
PORTREVISION= 9
PORTREVISION= 10
CATEGORIES= databases python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

View File

@@ -4,12 +4,15 @@ import sysconfig
from setuptools import setup, Extension
prefix = sysconfig.get_config_var('prefix')
inc_dirs = [prefix + "/include"]
inc_dirs = [sysconfig.get_path('include') + "/internal",
prefix + "/include"]
lib_dirs = [prefix + "/lib"]
libs = ["gdbm"]
macros = [('Py_BUILD_CORE_MODULE', 1)]
setup(ext_modules = [Extension('_gdbm', ['_gdbmmodule.c'],
include_dirs = inc_dirs,
libraries = libs,
library_dirs = lib_dirs)]
library_dirs = lib_dirs,
define_macros = macros)]
)