libtcod / python-tcod

A high-performance Python port of libtcod. Includes the libtcodpy module for backwards compatibility with older projects.
BSD 2-Clause "Simplified" License
410 stars 36 forks source link

Can't build wheels from source on MacOS. #108

Open HexDecimal opened 3 years ago

HexDecimal commented 3 years ago

Wheels built for MacOS require the delocate tool to be run on them. Otherwise SDL will not be bundled with the wheel. Deployments run this tool outside of the normal wheel build process, kind of like how auditwheel works.

This means that while the pre-built MacOS wheels on PyPI are correct, any wheels built from source independently will be missing the SDL library. This will result in the following error when you try to import tcod:

ImportError: dlopen(.../site-packages/tcod/\_libtcod.abi3.so, 2): Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
  Referenced from: .../site-packages/tcod/\_libtcod.abi3.so
  Reason: image not found

My long term plans are to move the bundled SDL libs to another project and handle the issue there.