@@ -16,7 +16,10 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
1616VENV_DIR=" ${PROJECT_DIR} /.venv"
1717LIBLOOT_DIR=" ${SCRIPT_DIR} /libloot"
1818PYTHON_DIR=" ${LIBLOOT_DIR} /python"
19- OUT_SO_NAME=" loot.cpython-313-x86_64-linux-gnu.so"
19+ # Build for whatever Python version is the system default
20+ PY_TAG=" $( python3 -c ' import sys; print(f"cpython-{sys.version_info.major}{sys.version_info.minor}")' ) "
21+ PY_TAG_SHORT=" $( python3 -c ' import sys; print(f"cp{sys.version_info.major}{sys.version_info.minor}")' ) "
22+ OUT_SO_NAME=" loot.${PY_TAG} -x86_64-linux-gnu.so"
2023OUT_PRIMARY=" ${SCRIPT_DIR} /${OUT_SO_NAME} "
2124REQUIREMENTS=" ${PROJECT_DIR} /requirements.txt"
2225
@@ -118,7 +121,7 @@ cd "$PYTHON_DIR"
118121# ── Locate the built wheel ────────────────────────────────────────────
119122# Maturin may put target/wheels under python/ or under the repo root
120123for WHEEL_DIR in " ${PYTHON_DIR} /target/wheels" " ${LIBLOOT_DIR} /target/wheels" ; do
121- WHEEL=( " $WHEEL_DIR " /libloot-* -cp313 -* linux* .whl " $WHEEL_DIR " /loot-* -cp313 -* linux* .whl )
124+ WHEEL=( " $WHEEL_DIR " /libloot-* -${PY_TAG_SHORT} -* linux* .whl " $WHEEL_DIR " /loot-* -${PY_TAG_SHORT} -* linux* .whl )
122125 for w in " ${WHEEL[@]} " ; do
123126 if [ -f " $w " ]; then
124127 WHEEL=" $w "
@@ -127,7 +130,7 @@ for WHEEL_DIR in "${PYTHON_DIR}/target/wheels" "${LIBLOOT_DIR}/target/wheels"; d
127130 done
128131done
129132if [ -z " ${WHEEL:- } " ] || [ ! -f " $WHEEL " ]; then
130- echo " ERROR: No cp313 linux wheel found in target/wheels under libloot or libloot/python." >&2
133+ echo " ERROR: No ${PY_TAG_SHORT} linux wheel found in target/wheels under libloot or libloot/python." >&2
131134 for d in " ${PYTHON_DIR} /target/wheels" " ${LIBLOOT_DIR} /target/wheels" ; do
132135 [ -d " $d " ] && ls -la " $d " 2> /dev/null || true
133136 done
0 commit comments