Switch from hatch to setuptools/CFFI build to produce wheels correctly.

This commit is contained in:
Leo Vasanko
2025-11-06 16:34:32 -06:00
parent fd24bb02f8
commit f8cc02eb41
8 changed files with 108 additions and 155 deletions
+12 -2
View File
@@ -34,8 +34,18 @@ def clean_declaration(text: str) -> str:
if text == old:
break
# Remove CRYPTO_ALIGN(...)
text = re.sub(r"CRYPTO_ALIGN\s*\(\s*\d+\s*\)", "", text)
# For structs with CRYPTO_ALIGN, replace the field with "...;" to make it flexible
# This tells CFFI to use the C compiler's alignment instead of calculating it
if "CRYPTO_ALIGN" in text and "typedef struct" in text:
# Replace "CRYPTO_ALIGN(N) uint8_t opaque[SIZE];" with "...;"
text = re.sub(
r"CRYPTO_ALIGN\s*\(\s*\d+\s*\)\s+uint8_t\s+opaque\[\d+\];",
"...;",
text
)
else:
# For non-struct declarations, just remove CRYPTO_ALIGN
text = re.sub(r"CRYPTO_ALIGN\s*\(\s*\d+\s*\)", "", text)
# Normalize whitespace but preserve structure
lines = []