Make the OLED script work on Bullseye (#470)

* Add check for gcc 10+ and inject compiler flaggs

* Bump Python libraries
This commit is contained in:
Daniel Markstedt 2021-11-14 17:48:46 -08:00 committed by GitHub
parent 014ced6042
commit 0f222df9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -2,7 +2,7 @@ Adafruit-Blinka==6.15.0
adafruit-circuitpython-busdevice==5.1.0
adafruit-circuitpython-framebuf==1.4.7
adafruit-circuitpython-ssd1306==2.12.2
Adafruit-PlatformDetect==3.13.0
Adafruit-PlatformDetect==3.17.2
Adafruit-PureIO==1.1.9
Pillow==8.4.0
pkg-resources==0.0.0
@ -12,5 +12,5 @@ pyusb==1.2.1
rpi-ws281x==4.3.0
RPi.GPIO==0.7.0
sysv-ipc==1.1.0
protobuf==3.17.3
protobuf==3.19.1
unidecode==1.3.2

View File

@ -57,6 +57,14 @@ if ! i2cdetect -y 1 &> /dev/null ; then
echo "i2cdetect -y 1 did not find a screen."
exit 2
fi
# Compiler flags needed for gcc v10 and up
if [[ `gcc --version | awk '/gcc/' | awk -F ' ' '{print $3}' | awk -F '.' '{print $1}'` -ge 10 ]]; then
echo -n "gcc 10 or later detected. Will compile with the following flags: "
COMPILER_FLAGS="-fcommon"
echo $COMPILER_FLAGS
fi
if ! test -e venv; then
echo "Creating python venv for OLED Screen"
python3 -m venv venv
@ -64,7 +72,7 @@ if ! test -e venv; then
source venv/bin/activate
echo "Installing requirements.txt"
pip install wheel
pip install -r requirements.txt
CFLAGS="$COMPILER_FLAGS" pip install -r requirements.txt
git rev-parse HEAD > current
fi
@ -76,7 +84,7 @@ if ! test -e current; then
else
if [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
echo "New version detected, updating requirements.txt"
pip install -r requirements.txt
CFLAGS="$COMPILER_FLAGS" pip install -r requirements.txt
git rev-parse HEAD > current
fi
fi