Small cosmetic change to the macOS dylib rpaths update script.

This commit is contained in:
Leon Styhre 2021-05-14 11:09:25 +02:00
parent 57a5e1ccb3
commit bdc4849a3b
2 changed files with 13 additions and 13 deletions

View file

@ -507,17 +507,17 @@ Note that the filenames could be slightly different depending on what versions y
There are some secondary internal dependencies between some of these library files, and these are baked into the files as absolut paths. As such we need to rewrite these to rpaths (relative paths) which is done using the install_name_tool command.
A script is available to automate this, `tools/macOS_change_dylib_rpaths.sh`
A script is available to automate this: `tools/macOS_change_dylib_rpaths.sh`
Simply run this script:
Simply run the following:
```
cd emulationstation-de
tools/macOS_change_dylib_rpaths.sh
Found file libfreetype.6.dylib - changing rpaths
Found file libavcodec.58.dylib - changing rpaths
Found file libavformat.58.dylib - changing rpaths
Found file libswresample.3.dylib - changing rpaths
Found file libswscale.5.dylib - changing rpaths
Found file libfreetype.6.dylib - changing to rpaths
Found file libavcodec.58.dylib - changing to rpaths
Found file libavformat.58.dylib - changing to rpaths
Found file libswresample.3.dylib - changing to rpaths
Found file libswscale.5.dylib - changing to rpaths
```
Verify that it worked as expected by running the otool command, for example `otool -L libfreetype.6.dylib` should show something like the following:
@ -533,7 +533,7 @@ libfreetype.6.dylib:
It's unclear why the first line shows a reference to itself, and this line apparently can't be modified using the install_name_tool command. It doesn't matter though and the application will work fine even if this path does not exist on the system.
You of course only need to change the paths to rpaths once, well at least until you replace the libraries in case of moving to a newer version or so.
You of course only need to change the absolute paths to rpaths once, well at least until you replace the libraries in case of moving to a newer version or so.
In addition to these libraries, you need to create a `plugins` directory and copy over the following VLC libraries, which are normally located in `/Applications/VLC.app/Contents/MacOS/plugins/`:

View file

@ -18,14 +18,14 @@ export SWRESAMPLE_FILENAME=libswresample.3.dylib
export SWSCALE_FILENAME=libswscale.5.dylib
if [ -f $FREETYPE_FILENAME ]; then
echo Found file $FREETYPE_FILENAME - changing rpaths
echo Found file $FREETYPE_FILENAME - changing to rpaths
chmod 755 $FREETYPE_FILENAME
install_name_tool -change /usr/local/opt/libpng/lib/libpng16.16.dylib @rpath/libpng16.16.dylib $FREETYPE_FILENAME
install_name_tool -add_rpath @executable_path $FREETYPE_FILENAME
fi
if [ -f $AVCODEC_FILENAME ]; then
echo Found file $AVCODEC_FILENAME - changing rpaths
echo Found file $AVCODEC_FILENAME - changing to rpaths
chmod 755 $AVCODEC_FILENAME
install_name_tool -change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib $AVCODEC_FILENAME
install_name_tool -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib $AVCODEC_FILENAME
@ -34,7 +34,7 @@ if [ -f $AVCODEC_FILENAME ]; then
fi
if [ -f $AVFORMAT_FILENAME ]; then
echo Found file $AVFORMAT_FILENAME - changing rpaths
echo Found file $AVFORMAT_FILENAME - changing to rpaths
chmod 755 $AVFORMAT_FILENAME
install_name_tool -change /usr/local/lib/libavcodec.58.dylib @rpath/libavcodec.58.dylib $AVFORMAT_FILENAME
install_name_tool -change /usr/local/lib/libswresample.3.dylib @rpath/libswresample.3.dylib $AVFORMAT_FILENAME
@ -44,14 +44,14 @@ if [ -f $AVFORMAT_FILENAME ]; then
fi
if [ -f $SWRESAMPLE_FILENAME ]; then
echo Found file $SWRESAMPLE_FILENAME - changing rpaths
echo Found file $SWRESAMPLE_FILENAME - changing to rpaths
chmod 755 $SWRESAMPLE_FILENAME
install_name_tool -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib $SWRESAMPLE_FILENAME
install_name_tool -add_rpath @executable_path $SWRESAMPLE_FILENAME
fi
if [ -f $SWSCALE_FILENAME ]; then
echo Found file $SWSCALE_FILENAME - changing rpaths
echo Found file $SWSCALE_FILENAME - changing to rpaths
chmod 755 $SWSCALE_FILENAME
install_name_tool -change /usr/local/lib/libavutil.56.dylib @rpath/libavutil.56.dylib $SWSCALE_FILENAME
install_name_tool -add_rpath @executable_path $SWSCALE_FILENAME