Closed justvanrossum closed 5 months ago
gif and mp4 export work, but the embedded tools are still Intel. We should track down Universal builds for ffmpeg, gifsicle, potrace, etc.
If it wasn't for PIL, DrawBot would still run on macOS 10.10...
3.12.1 (v3.12.1:2305ca5144, Dec 7 2023, 17:23:39) [Clang 13.0.0 (clang-1300.0.29.30)]
macOS-10.10.5-x86_64-i386-64bit
I'm trying to find out what it is lowest macOS that current PIL/Pillow is expected to run on: https://github.com/python-pillow/Pillow/issues/6862#issuecomment-1913552472
With Pillow 10.1.0, DrawBot actually works on macOS 10.10:
Hm, this seems an official source for ffmpeg, and they don't seem to intend to provide Apple Silicon binaries: https://evermeet.cx/ffmpeg/apple-silicon-arm
Tangentially, I found this blog post that shows how to speed up h264 encoding on Apple Silicon: https://www.learnwithjason.dev/blog/hardware-acceleration-ffmpeg-apple-silicon/
super mega cool!!
that statement related to ffmpeg seems not sustainable in the long run... there will be no intel mac in a few years...
a quick test leads to this error, it will not be the only one I guess:
from fontTools import bezierTools
Traceback (most recent call last):
File "<untitled>", line 1, in <module>
ImportError: cannot import name 'bezierTools' from 'fontTools' (/private/var/folders/qy/sv345q756dg_jsx6jg2tf6240000gn/T/AppTranslocation/874D5ABD-17F6-463E-9CCB-6A63FAA449DB/d/DrawBot.app/Contents/Resources/lib/python3.12/fontTools/__init__.py)
this happens cause pip checks the arch, you force the arch somewhere, if I remember it correctly
a quick test leads to this error
Argh yes, it is because if x84 and universal2 wheels are available, it picks x84 :(
We may have to work around it with a script downloading wheels from pypi directly.
that statement related to ffmpeg seems not sustainable in the long run
Interesting (and sad) to see that providing binaries for this hugely successful tool seems to depend on one guy...
I think this may be a possible approach:
pip install -r requirements.txt
and capture the output[^\s]+.whl.metadata
+ packaging.utils.parse_wheel_filename()
)location_for_special_universal_wheels/*.whl
delocate.fuse.fuse_wheels()
), write to location_for_special_universal_wheels/*.whl
pip install --force location_for_special_universal_wheels/*.whl
I think this may be a possible approach
I did that and it seems to work correctly on M123 and Intel, down to macOS 10.10:
@typemytype, this is ready for review/merge.
The build works on both Intel and Apple Silicon: https://github.com/typemytype/drawbot/actions/runs/7681596610
Intel:
Apple Silicon: