jpeglib has no pre-built ARM64 wheel and the source tarball is missing libjpeg header files. This adds a workaround that downloads the official libjpeg headers before building. - Add rpi/patches/jpeglib/install-jpeglib-arm64.sh helper script - Update setup.sh to download headers when building from source - Downloads headers for libjpeg 6b, 7-9f, turbo, and mozjpeg versions 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