RPi: Simpler approach - filter lines containing turbo/mozjpeg

This commit is contained in:
Aaron D. Lee
2026-01-10 23:10:10 -05:00
parent f46ef01f5f
commit ebc999b2b3

View File

@@ -369,15 +369,12 @@ else
# Patch setup.py to only build standard libjpeg versions # Patch setup.py to only build standard libjpeg versions
echo " Patching setup.py to skip turbo/mozjpeg (need cmake)..." echo " Patching setup.py to skip turbo/mozjpeg (need cmake)..."
python3 -c " python3 -c "
import re
with open('setup.py', 'r') as f: with open('setup.py', 'r') as f:
content = f.read() lines = f.readlines()
# Remove turbo and mozjpeg entries from libjpeg_versions dict # Filter out lines containing turbo or mozjpeg
content = re.sub(r\"\\s*'turbo\\d+':[^,]+,\", '', content) filtered = [l for l in lines if 'turbo' not in l and 'mozjpeg' not in l]
content = re.sub(r\"\\s*'mozjpeg\\d+':[^,]+,\", '', content)
content = re.sub(r\"\\s*#.*turbo.*\\n\", '\\n', content)
with open('setup.py', 'w') as f: with open('setup.py', 'w') as f:
f.write(content) f.writelines(filtered)
" "
# Build and install # Build and install