- Create rpi/patches/ directory with multi-strategy patching - Patch tries: patch file → sed → Python regex → already-patched detection - Fix jpegio patch to handle multiple -m64 occurrences - Update docs to use wget instead of curl|bash (stdin conflict with read) - Update SSH examples to use admin@stegasoo.local 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
RPi Patches
This directory contains patches for dependencies that need modifications to build on ARM64.
Structure
patches/
<package>/
arm64.patch # Standard unified diff patch file
apply-patch.sh # Script with fallback strategies
How It Works
The apply-patch.sh script tries multiple strategies in order:
- Patch file - Apply the
.patchfile usingpatch -p1 - Sed fallback - Use sed for simple string replacements
- Python fallback - Use regex for flexible pattern matching
This layered approach handles:
- Exact matches (patch file works)
- Minor upstream changes (sed catches variations)
- Significant changes (Python regex is most flexible)
- Already patched files (detected and skipped)
Adding a New Patch
- Create a directory:
patches/<package>/ - Create the patch file:
git diff > arm64.patch - Create
apply-patch.shwith appropriate fallback logic - Update
setup.shto call the patch script
jpegio Patch
The jpegio library includes x86-specific -m64 compiler flags that fail on ARM64.
The patch removes these flags by replacing:
cargs.append('-m64')
with:
pass # ARM64: removed x86-specific -m64 flag
Updating Patches
When upstream changes break a patch:
- Clone the new version
- Make the necessary modifications
- Generate a new patch:
diff -u original modified > arm64.patch - Test on a fresh Pi install