Skip to content

Commit

Permalink
setup: recent version of SDL2_mixer don't have smpeg2
Browse files Browse the repository at this point in the history
On the 2.0.5 version, there is no smpeg2 anymore. The current dmg on their website have:

08:42 tito@kpax ~  $ otool -L /Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/*.framework/Versions/A/{Opus,OpusFile,Vorbis,mpg123,Ogg,FLAC}|grep SDL2
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/Opus.framework/Versions/A/Opus:
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/OpusFile.framework/Versions/A/OpusFile:
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/Vorbis.framework/Versions/A/Vorbis:
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/mpg123.framework/Versions/A/mpg123:
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/Ogg.framework/Versions/A/Ogg:
/Volumes/SDL2_mixer/SDL2_mixer.framework/Frameworks/FLAC.framework/Versions/A/FLAC:

No fix needed at all as all the framework doesn't have an rpath to SDL2_mixer
framework.
  • Loading branch information
tito committed Mar 6, 2019
1 parent 49bad8c commit 0344322
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions setup.py
Expand Up @@ -367,12 +367,17 @@ def update_if_changed(self, fn, content):


def _check_and_fix_sdl2_mixer(f_path):
# Between SDL_mixer 2.0.1 and 2.0.4, the included frameworks changed
# smpeg2 have been replaced with mpg123, but there is no need to fix.
smpeg2_path = ("{}/Versions/A/Frameworks/smpeg2.framework"
"/Versions/A/smpeg2").format(f_path)
if not exists(smpeg2_path):
return

print("Check if SDL2_mixer smpeg2 have an @executable_path")
rpath_from = ("@executable_path/../Frameworks/SDL2.framework"
"/Versions/A/SDL2")
rpath_to = "@rpath/../../../../SDL2.framework/Versions/A/SDL2"
smpeg2_path = ("{}/Versions/A/Frameworks/smpeg2.framework"
"/Versions/A/smpeg2").format(f_path)
output = getoutput(("otool -L '{}'").format(smpeg2_path)).decode('utf-8')
if "@executable_path" not in output:
return
Expand Down

0 comments on commit 0344322

Please sign in to comment.