Description: Adapt build to Python 3.12
 Relax the version guard from >=3.13 to >=3.12, guard the Python 3.13-only
 Py_mod_gil module slot with PY_VERSION_HEX, and derive Py_LIMITED_API and
 the bdist_wheel py_limited_api tag from the running interpreter, so the
 package can build on systems that only ship Python 3.12.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Last-Updated: 2026-09-14

--- audioop-lts-0.2.2.orig/audioop/_audioop.c
+++ audioop-lts-0.2.2/audioop/_audioop.c
@@ -1981,7 +1981,9 @@ audioop_exec(PyObject* module)
 static PyModuleDef_Slot audioop_slots[] = {
     {Py_mod_exec, audioop_exec},
     {Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
+#if PY_VERSION_HEX >= 0x030D0000
     {Py_mod_gil, Py_MOD_GIL_NOT_USED},
+#endif
     {0, NULL}
 };
 
--- audioop-lts-0.2.2.orig/pyproject.toml
+++ audioop-lts-0.2.2/pyproject.toml
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
 [project]
 name = "audioop-lts"
 description = "LTS Port of Python audioop"
-requires-python = ">=3.13"
+requires-python = ">=3.12"
 version = "0.2.2"
 readme = "README.md"
 license = "PSF-2.0"
@@ -36,7 +36,7 @@ packages = ["audioop"]
 audioop = ["*.c", "*.h"]
 
 [tool.pyright]
-pythonVersion = "3.13"
+pythonVersion = "3.12"
 typeCheckingMode = "strict"
 include = ["audioop"]
 ignore = [
--- audioop-lts-0.2.2.orig/setup.py
+++ audioop-lts-0.2.2/setup.py
@@ -3,7 +3,7 @@ import sysconfig
 
 from setuptools import Extension, setup
 
-if sys.version_info[:2] < (3, 13):
+if sys.version_info[:2] < (3, 12):
     raise RuntimeError(
         """
         audioop-lts is only for python3.13+.
@@ -24,8 +24,8 @@ Py_GIL_DISABLED = sysconfig.get_config_v
 macros: list[tuple[str, str | None]] = []
 options: dict[str, dict[str, str]] = {}
 if not Py_GIL_DISABLED:
-    macros.append(("Py_LIMITED_API", "0x030D0000"))
-    options["bdist_wheel"] = {"py_limited_api": "cp313"}
+    macros.append(("Py_LIMITED_API", "0x03%02X0000" % sys.version_info[1]))
+    options["bdist_wheel"] = {"py_limited_api": "cp%d%d" % sys.version_info[:2]}
 
 extensions = [
     Extension(
