1
0
Fork 0
forked from hanez/xtc

Phase 9: Add native processors and reproducible Linux release tooling

This commit is contained in:
Johannes Findeisen 2026-10-27 01:21:04 +01:00
commit de403b37d7
43 changed files with 1656 additions and 19 deletions

16
tools/pkgconfig.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python3
"""Generate pkg-config metadata without shell/sed interpolation of paths."""
import argparse
from pathlib import Path
from dist import version
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--prefix', required=True)
parser.add_argument('--jack', default='')
parser.add_argument('--output', type=Path, required=True)
args = parser.parse_args()
if not args.prefix.startswith('/') or any(c in args.prefix for c in '\n\r\0"$\\'):
parser.error('PREFIX must be absolute, without newlines, quotes, $, or backslashes')
text = Path('packaging/xtc.pc.in').read_text().replace('@PREFIX@', args.prefix)
text = text.replace('@VERSION@', version(Path.cwd())).replace('@JACK@', args.jack)
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_text(text)