diff --git a/imageio_ffmpeg/_definitions.py b/imageio_ffmpeg/_definitions.py index 578971a..c9ea900 100644 --- a/imageio_ffmpeg/_definitions.py +++ b/imageio_ffmpeg/_definitions.py @@ -1,25 +1,27 @@ import platform import struct -import sys __version__ = "0.5.0" def get_platform(): bits = struct.calcsize("P") * 8 - if sys.platform.startswith("linux"): + if platform.system().lower().startswith("linux"): architecture = platform.machine() if architecture == "aarch64": return "linuxaarch64" return "linux{}".format(bits) - elif sys.platform.startswith("freebsd"): + elif platform.system().lower().startswith("freebsd"): return "freebsd{}".format(bits) - elif sys.platform.startswith("win"): + elif platform.system().lower().startswith("win"): return "win{}".format(bits) - elif sys.platform.startswith("cygwin"): + elif platform.system().lower().startswith("cygwin"): return "win{}".format(bits) - elif sys.platform.startswith("darwin"): - return "osx{}".format(bits) + elif platform.system().lower().startswith("darwin"): + if platform.processor().lower().startswith("arm"): # Apple Silicon + return "osx-arm{}".format(bits) + else: + return "osx-{}".format(bits) else: # pragma: no cover return None @@ -34,7 +36,8 @@ def get_platform(): # Platform string -> ffmpeg filename FNAME_PER_PLATFORM = { - "osx64": "ffmpeg-osx64-v4.2.2", # 10.10+ + "osx-arm64": "ffmpeg-osx-arm64-v7.0", # Apple Silicon + "osx64": "ffmpeg-osx-x86-v7.0", # 10.9+ "win32": "ffmpeg-win32-v4.2.2.exe", # Windows 7+ "win64": "ffmpeg-win64-v4.2.2.exe", # "linux32": "ffmpeg-linux32-v4.2.2", @@ -42,13 +45,15 @@ def get_platform(): "linuxaarch64": "ffmpeg-linuxaarch64-v4.2.2", } -osxplats = "macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64" +osxplats = "macosx_10_9_intel.macosx_10_9_x86_64" +osxarmplats = "macosx_11_0_arm64" # Wheel tag -> platform string WHEEL_BUILDS = { "py3-none-manylinux2010_x86_64": "linux64", "py3-none-manylinux2014_aarch64": "linuxaarch64", - "py3-none-" + osxplats: "osx64", + "py3-none-" + osxplats: "osx64", # Apple Intel + "py3-none-" + osxarmplats: "osx-arm64", # Apple Silicon "py3-none-win32": "win32", "py3-none-win_amd64": "win64", }