This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added automatization script for SFML binaries on Mac OS X
- Loading branch information
1 parent
f337e32
commit cc4e855
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/sh | ||
|
||
# this script updates the install name of SFML binaries | ||
# | ||
# renames these files from working directory and edit some stuffs with install_name_tool : | ||
# - libsfml-audio.2.0.dylib => libsfml-audio.dylib | ||
# - libsfml-graphics.2.0.dylib => libsfml-graphics.dylib | ||
# - libsfml-system.2.0.dylib => libsfml-system.dylib | ||
# - libsfml-window.2.0.dylib => libsfml-window.dylib | ||
# | ||
# libsndfile is not handled by this script! | ||
# | ||
|
||
|
||
error() { | ||
echo "$@" 1>&2 | ||
exit 1 | ||
} | ||
|
||
audio="libsfml-audio.2.0.dylib" | ||
graphics="libsfml-graphics.2.0.dylib" | ||
system="libsfml-system.2.0.dylib" | ||
window="libsfml-window.2.0.dylib" | ||
|
||
if [ ! -f "$audio" ] || [ ! -f "$graphics" ] || [ ! -f "$system" ] || [ ! -f "$window" ] ; | ||
then | ||
error "missing files" | ||
fi | ||
|
||
|
||
# rename files | ||
n_audio="libsfml-audio.dylib" | ||
n_graphics="libsfml-graphics.dylib" | ||
n_system="libsfml-system.dylib" | ||
n_window="libsfml-window.dylib" | ||
|
||
mv "$audio" "$n_audio" | ||
audio="$n_audio" | ||
|
||
mv "$graphics" "$n_graphics" | ||
graphics="$n_graphics" | ||
|
||
mv "$system" "$n_system" | ||
system="$n_system" | ||
|
||
mv "$window" "$n_window" | ||
window="$n_window" | ||
|
||
# edit install name for each dylib | ||
install_name_tool -id "$audio" \ | ||
-change @executable_path/../Frameworks/sndfile.framework/Versions/A/sndfile @loader_path/libsndfile.dylib \ | ||
-change @executable_path/../Frameworks/libsfml-system.2.dylib @loader_path/"$system" \ | ||
"$audio" | ||
|
||
install_name_tool -id "$graphics" \ | ||
-change @executable_path/../Frameworks/libsfml-window.2.dylib @loader_path/"$window" \ | ||
-change @executable_path/../Frameworks/libsfml-system.2.dylib @loader_path/"$system" \ | ||
"$graphics" | ||
|
||
install_name_tool -id "$system" \ | ||
"$system" | ||
|
||
install_name_tool -id "$window" \ | ||
-change @executable_path/../Frameworks/libsfml-system.2.dylib @loader_path/"$system" \ | ||
"$window" | ||
|
||
|