RPi: Simpler approach - filter lines containing turbo/mozjpeg
This commit is contained in:
11
rpi/setup.sh
11
rpi/setup.sh
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user