fix: force ARM64 platform variables for OpenFrameworks build and apply highlight patch
This commit is contained in:
@ -183,9 +183,25 @@ echo "Downloading and building ofxPiMapper Addon..."
|
|||||||
cd "$REAL_HOME/openFrameworks/addons"
|
cd "$REAL_HOME/openFrameworks/addons"
|
||||||
[ ! -d "ofxPiMapper" ] && sudo -u "$REAL_USER" git clone --depth 1 https://github.com/kr15h/ofxPiMapper.git
|
[ ! -d "ofxPiMapper" ] && sudo -u "$REAL_USER" git clone --depth 1 https://github.com/kr15h/ofxPiMapper.git
|
||||||
|
|
||||||
# Build Example (Note the underscore in example_basic)
|
# Apply the highlight patch to the addon before building
|
||||||
|
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper"
|
||||||
|
if [ -f src/Osc/OscControl.cpp ]; then
|
||||||
|
echo "Applying highlight surface OSC listener modification..."
|
||||||
|
# Only add if not already present
|
||||||
|
if ! grep -q "ofxPiMapper/surface/highlight" src/Osc/OscControl.cpp; then
|
||||||
|
sed -i '/if (m.getAddress() == "\/ofxPiMapper\/surface\/select"){/i \
|
||||||
|
if (m.getAddress() == "/ofxPiMapper/surface/highlight"){ \
|
||||||
|
int surfaceIndex = m.getArgAsInt32(0); \
|
||||||
|
mapper->getSurfaceManager()->selectSurface(surfaceIndex); \
|
||||||
|
return; \
|
||||||
|
}' src/Osc/OscControl.cpp
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build Example (Explicitly force ARM64 platform variables)
|
||||||
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"
|
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"
|
||||||
sudo -u "$REAL_USER" make -j1
|
echo "Starting compilation (forcing ARM64 platform)..."
|
||||||
|
sudo -u "$REAL_USER" make -j1 PLATFORM_OS=Linux PLATFORM_ARCH=arm64 PLATFORM_VARIANT=raspberrypi
|
||||||
cp bin/example_basic /usr/local/bin/ofxPiMapper
|
cp bin/example_basic /usr/local/bin/ofxPiMapper
|
||||||
chmod +x /usr/local/bin/ofxPiMapper
|
chmod +x /usr/local/bin/ofxPiMapper
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user