From ec01ef490254f51de96b8d89649f8a487827ec71 Mon Sep 17 00:00:00 2001 From: Timothy Hofland Date: Wed, 11 Mar 2026 10:35:12 +0100 Subject: [PATCH] fix: force ARM64 platform variables for OpenFrameworks build and apply highlight patch --- scripts/setup.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 3a571ce..121d31c 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -183,9 +183,25 @@ echo "Downloading and building ofxPiMapper Addon..." cd "$REAL_HOME/openFrameworks/addons" [ ! -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" -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 chmod +x /usr/local/bin/ofxPiMapper