Skip to content

Commit d33a49f

Browse files
committed
Update spkg-build.in to set PKG_CONFIG_PATH and CPPFLAGS for Python 3.13+ compatibility
1 parent 60ad748 commit d33a49f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

build/pkgs/python3/spkg-build.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ export EXTRA_CFLAGS="`testcflags.sh -Wno-unused $OLD_CFLAGS`"
6262
# https://github.com/sagemath/sage/issues/23398
6363
PYTHON_CONFIGURE="$PYTHON_CONFIGURE --without-ensurepip"
6464

65+
# Set PKG_CONFIG_PATH to help Python 3.13+ find sqlite3 and other dependencies
66+
# Python 3.13 changed its build system and now uses pkg-config at configure time
67+
if [ -n "$SAGE_LOCAL" ]; then
68+
export PKG_CONFIG_PATH="$SAGE_LOCAL/lib/pkgconfig:${PKG_CONFIG_PATH}"
69+
fi
70+
71+
# Ensure Python can find headers and libraries during configure (not just make)
72+
# This is critical for Python 3.13+ which detects extension modules at configure time
73+
if [ -n "$SAGE_LOCAL" ]; then
74+
export CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
75+
export LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS"
76+
fi
77+
6578
sdh_configure --enable-shared $PYTHON_CONFIGURE
6679

6780
# Make sure -L. is placed before -L$SAGE_LOCAL/lib so that python and extension

0 commit comments

Comments
 (0)