Debian Codegraph @

debian/patches/0004-python-system-rapidyaml.patch

raw
1 --- a/setup.py
2 +++ b/setup.py
3 @@ -34,7 +34,6 @@ LIB_SOURCES = [
4 "core/string_utils.cpp",
5 "core/vm.cpp",
6 "third_party/md5/md5.cpp",
7 - "third_party/rapidyaml/rapidyaml.cpp",
8 "python/_jsonnet.c",
9 ]
10
11 @@ -113,6 +112,12 @@ if not hasattr(sys, "_is_gil_enabled") o
12 _PY_LIMITED_API = 0x03080000
13 _bdist_limited_api_tag = "cp38"
14
15 +macros = [
16 + ("USE_SYSTEM_RAPIDYAML","1"),
17 + ("RYML_NEW_ERROR_API","1"),
18 +]
19 +if _PY_LIMITED_API is not None:
20 + macros.append(("Py_LIMITED_API", f"{_PY_LIMITED_API:#010x}"))
21
22 setuptools.setup(
23 name="jsonnet",
24 @@ -124,19 +129,14 @@ setuptools.setup(
25 ext_modules=[
26 setuptools.Extension(
27 "_jsonnet",
28 - define_macros=(
29 - [("Py_LIMITED_API", f"{_PY_LIMITED_API:#010x}")]
30 - if _PY_LIMITED_API is not None
31 - else []
32 - ),
33 + define_macros=macros,
34 py_limited_api=(_PY_LIMITED_API is not None),
35 sources=LIB_SOURCES,
36 include_dirs=[
37 "include",
38 "third_party/md5",
39 - "third_party/json",
40 - "third_party/rapidyaml",
41 ],
42 + libraries=["ryml"],
43 language="c++",
44 )
45 ],