From 6473fa4b670e071ac2e6e389a962cfd9bad687f3 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 6 Feb 2025 15:19:30 +0500 Subject: [PATCH] Deprecate workaround for universal wheels Tested on Blender 4.3.2 and universal wheels are now supported without this hack, see https://projects.blender.org/blender/blender/issues/125091 --- src/bonsai/Makefile | 58 --------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/bonsai/Makefile b/src/bonsai/Makefile index e8d6c6c385..935bf4e743 100644 --- a/src/bonsai/Makefile +++ b/src/bonsai/Makefile @@ -278,64 +278,6 @@ endif fi mv build/wheels/*.whl build/bonsai/wheels/ - # Ugly patch to accomodate MacOS universal builds not being recognized by Blender. - # Blender doesn't look into the wheel contents, it just checks the name. - # So this hack works without working out some way to repack those wheels. - # See: https://projects.blender.org/blender/blender/issues/125091 - -ifeq ($(PLATFORM), macosm1) - # Has universal and x86_64 builds. - prev_whl_name=$$(find build/bonsai/wheels/lxml-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - prev_whl_name=$$(find build/bonsai/wheels/tzfpy-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed -E "s/macosx_10_([0-9]+)_x86_64\.macosx_11_0_arm64\.macosx_10_\1_universal2/macosx_10_\1_arm64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - # Has only universal build. - prev_whl_name=$$(find build/bonsai/wheels/greenlet-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - # has universal and x86_64 builds. - prev_whl_name=$$(find build/bonsai/wheels/fonttools-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/arm64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - # Has only universal build. - prev_whl_name=$$(find build/bonsai/wheels/charset_normalizer-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_arm64/"); \ - mv "$$prev_whl_name" "$$whl_name"; -endif -ifeq ($(PLATFORM), macos) - # Has universal and arm64 builds. - prev_whl_name=$$(find build/bonsai/wheels/MarkupSafe-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_x86_64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - prev_whl_name=$$(find build/bonsai/wheels/tzfpy-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed -E "s/macosx_10_([0-9]+)_x86_64\.macosx_11_0_arm64\.macosx_10_\1_universal2/macosx_10_\1_x86_64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - prev_whl_name=$$(find build/bonsai/wheels/greenlet-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_x86_64/"); \ - mv "$$prev_whl_name" "$$whl_name"; - - prev_whl_name=$$(find build/bonsai/wheels/charset_normalizer-*.whl); \ - whl_name=$$(echo $$prev_whl_name | sed "s/_universal2/_x86_64/"); \ - mv "$$prev_whl_name" "$$whl_name"; -endif - - # Safeguard for unhandled universal files. - wheels=$$(find build/bonsai/wheels/*universal2*.whl); \ - if [ -n "$$wheels" ]; then \ - echo "Found universal2 wheel files:"; \ - echo "$$wheels"; \ - echo "Error: universal2 wheel files are not supported by Blender!"; \ - exit 1; \ - fi - # Temporary workaround for Blender not handling non-3.11 wheels #5743. # Use '-n' as on macos x86-64 doesn't have a binary wheel and it autoincludes 'cp311'. prev_whl_name=$$(find build/bonsai/wheels/tzfpy-*.whl); \