Mac OS X: Apparently FFMPEG dylib files also refer to /usr/local/Cellar (Brew again) which the Makefile did not recognize. Recognize those too so dylib dependencies are properly patched on Intel builds

This commit is contained in:
Jonathan Campbell 2021-07-03 01:56:42 -07:00
parent 408bc6353d
commit 05f87854eb

View File

@ -18,7 +18,7 @@ dosbox-x.app: src/dosbox-x contrib/macos/dosbox.icns
cp -v src/dosbox-x dosbox-x.app/Contents/MacOS/DosBox
# this is where it gets ugly
codesign --remove-signature dosbox-x.app/Contents/MacOS/DosBox
otool -L dosbox-x.app/Contents/MacOS/DosBox | grep -E '/usr/local/lib|/usr/local/opt|/opt/homebrew/' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
otool -L dosbox-x.app/Contents/MacOS/DosBox | grep -E '/usr/local/lib|/usr/local/opt|/usr/local/Cellar|/opt/homebrew/' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -v $$Y dosbox-x.app/Contents/MacOS/; \
codesign --remove-signature "dosbox-x.app/Contents/MacOS/$$dylib" || exit 1; \
@ -28,7 +28,7 @@ dosbox-x.app: src/dosbox-x contrib/macos/dosbox.icns
# and the libs too. NTS: Cannot use install_name_tool anymore to change anything about dylib files because that invalidates code signing of those files
for pass in 1 2 3 4 5; do \
for dolib in dosbox-x.app/Contents/MacOS/*.dylib; do \
XB=`otool -L "$$dolib" | grep -E '/usr/local/lib|/usr/local/opt|/opt/homebrew/' | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
XB=`otool -L "$$dolib" | grep -E '/usr/local/lib|/usr/local/opt|/usr/local/Cellar|/opt/homebrew/' | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
for Y in $$XB; do \
dylib=`basename $$Y`; \
if [ -f "dosbox-x.app/Contents/MacOS/$$dylib" ]; then true; else \