Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow .framework DLLs on macOS #138

Merged
merged 2 commits into from
Nov 23, 2019
Merged

Allow .framework DLLs on macOS #138

merged 2 commits into from
Nov 23, 2019

Conversation

a-hurst
Copy link
Member

@a-hurst a-hurst commented May 28, 2019

The pre-built SDL2 binaries for macOS on the official website are all packaged in .framework format. However, PySDL2 currently only looks for SDL2 DLLs in .dylib format, meaning that if you download the official frameworks and try to point PYSDL2_DLL_PATH towards them, it won't be able to find them.

This patch fixes this, and lays the groundwork for having a separate 'pysdl2-dlls wheel' that contains the official pre-built SDL2 + extras runtime libraries which would solve #78 (I currently have a script/package to create such a wheel for macOS and it seems to work well using this fix!)

@a-hurst
Copy link
Member Author

a-hurst commented May 29, 2019

In order for the official SDL2_Mixer framework to load on macOS, I also had to comment out the Mix_HasMusicDecoder function in sdlmixer.py. Otherwise, I get the following error:

ValueError: could not find function 'Mix_HasMusicDecoder' in <CDLL '/usr/local/lib/python3.7/site-packages/sdl2dll/dll/SDL2_mixer.framework/SDL2_mixer', handle 7faf27d90d80 at 0x112aac048>

Looking into it further, the Mix_HasMusicDecoder function exists in the SDL_mixer.h header but isn't actually implemented anywhere in SDL_Mixer, meaning that the binding process in Python fails. Thus, there's no loss in functionality by removing the function from PySDL2 until it actually gets implemented.

@a-hurst a-hurst merged commit 4aedbc8 into py-sdl:master Nov 23, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant