Skip to content

Commit 4db6a09

Browse files
committed
update
1 parent 16f96b2 commit 4db6a09

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/LOOT/rebuild_libloot.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
1616
VENV_DIR="${PROJECT_DIR}/.venv"
1717
LIBLOOT_DIR="${SCRIPT_DIR}/libloot"
1818
PYTHON_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"
2023
OUT_PRIMARY="${SCRIPT_DIR}/${OUT_SO_NAME}"
2124
REQUIREMENTS="${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
120123
for 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
128131
done
129132
if [ -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

src/appimage/make-appimage.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ done
5858
rm -f "$APP_SHARE/LOOT/rebuild_libloot.sh"
5959
find "$APP_SHARE" -type f -name '*.sh' -exec rm -f {} \;
6060
find "$APP_SHARE" -type f -name 'requirements*.txt' -delete 2>/dev/null || true
61-
LOOT_SO="$APP_SHARE/LOOT/loot.cpython-313-x86_64-linux-gnu.so"
62-
[ -f "$LOOT_SO" ] && strip --strip-unneeded "$LOOT_SO" 2>/dev/null || true
61+
# Strip the libloot extension regardless of which Python ABI tag it
62+
find "$APP_SHARE/LOOT" -maxdepth 1 -name 'loot.cpython-*-x86_64-linux-gnu.so' \
63+
-exec strip --strip-unneeded {} + 2>/dev/null || true
6364
find "$APP_SHARE" -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
6465
find "$APP_SHARE" -type f -name '*.py' -exec chmod -x {} \;
6566

0 commit comments

Comments
 (0)