From da448aa0c1f467579fe78c8bc3bad231d39608e8 Mon Sep 17 00:00:00 2001 From: dev Date: Tue, 24 Sep 2019 10:05:55 +0200 Subject: [PATCH] added some relinks in Homebrew libs (absolute paths refering to other libs ... homebrew 2.0 issue ? osx upgrade issue ? xcode linker issue ? --- OpenBoard.pro | 5 +-- release_scripts/osx/release.macx.sh | 28 +++++++++++++++- release_scripts/osx/relink_libs.sh | 52 +++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 3 deletions(-) create mode 100755 release_scripts/osx/relink_libs.sh diff --git a/OpenBoard.pro b/OpenBoard.pro index d21bb776..d44699ac 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -10,8 +10,8 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 5 -VERSION_PATCH = 3 -VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error +VERSION_PATCH = 4 +VERSION_TYPE = a # a = alpha, b = beta, rc = release candidate, r = release, other => error VERSION_BUILD = 0 VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_PATCH}-$${VERSION_TYPE}.$${VERSION_BUILD}" @@ -164,6 +164,7 @@ macx { LIBS += -framework CoreMedia LIBS += -lcrypto + LIBS += -L/usr/local/opt/openssl/lib LIBS += -L/usr/local/opt/quazip/lib LIBS += -L/usr/local/opt/ffmpeg/lib INCLUDEPATH += /usr/local/opt/openssl/include diff --git a/release_scripts/osx/release.macx.sh b/release_scripts/osx/release.macx.sh index 2dd65a3d..08774744 100755 --- a/release_scripts/osx/release.macx.sh +++ b/release_scripts/osx/release.macx.sh @@ -19,7 +19,7 @@ PROJECT_ROOT="$SCRIPT_PATH/../.." APPLICATION_NAME="OpenBoard" -BASE_QT_DIR=~/Qt/5.5/clang_64 +BASE_QT_DIR=~/Qt/5.9.8/clang_64 # Executables QMAKE=$BASE_QT_DIR/bin/qmake MACDEPLOYQT=$BASE_QT_DIR/bin/macdeployqt @@ -200,6 +200,32 @@ cd "`pwd`/build/macx/release/product/" $MACDEPLOYQT "`pwd`/$APPLICATION_NAME.app" cd - +# make sure libs installed via homebrew 2.0 refer to in-app libs +notify "relinking libs ..." +# libavformat +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavcodec.58.dylib @executable_path/../Frameworks/libavcodec.58.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +# libavcodec +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +#libswresample +install_name_tool "$APP/Contents/Frameworks/libswresample.3.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +#libswscale +install_name_tool "$APP/Contents/Frameworks/libswscale.5.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +# libhogweed +install_name_tool "$APP/Contents/Frameworks/libhogweed.4.dylib" -change /usr/local/Cellar/nettle/3.4.1/lib/libnettle.6.dylib @executable_path/../Frameworks/libnettle.6.dylib + +# libssl +install_name_tool "$APP/Contents/Frameworks/libssl.1.1.dylib" -change /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib + +# libvorbis +install_name_tool "$APP/Contents/Frameworks/libvorbisenc.2.dylib" -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib @executable_path/../Frameworks/libvorbis.0.dylib + notify "Extracting debug information ..." $DSYMUTIL "$APP/Contents/MacOS/$APPLICATION_NAME" -o "$DSYM" $STRIP -S "$APP/Contents/MacOS/$APPLICATION_NAME" diff --git a/release_scripts/osx/relink_libs.sh b/release_scripts/osx/relink_libs.sh new file mode 100755 index 00000000..7fdc0eea --- /dev/null +++ b/release_scripts/osx/relink_libs.sh @@ -0,0 +1,52 @@ +# Directories +PRODUCT_DIR="$BUILD_DIR/product" + +function notify { + GROWLNOTIFY=`which growlnotify` + if [ -x "$GROWLNOTIFY" ]; then + $GROWLNOTIFY --name OpenBoard-build --iconpath /Developer/Applications/Xcode.app --message "$1" "OpenBoard" + fi + printf "\033[32m--->\033[0m $1\n" +} + +function abort { + printf "\033[31merror:\033[0m $1\n" + exit 1 +} + +function warn { + abort "$1" +} + +function checkExecutable { + if [ ! -x "$1" ]; then + abort "$1 not found" + fi +} + +APP="$PRODUCT_DIR/$APPLICATION_NAME.app" +# make sure libs installed via homebrew 2.0 refer to in-app libs +notify "relinking libs ..." +# libavformat +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavcodec.58.dylib @executable_path/../Frameworks/libavcodec.58.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavformat.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +# libavcodec +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libswresample.3.dylib @executable_path/../Frameworks/libswresample.3.dylib +install_name_tool "$APP/Contents/Frameworks/libavcodec.58.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +#libswresample +install_name_tool "$APP/Contents/Frameworks/libswresample.3.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +#libswscale +install_name_tool "$APP/Contents/Frameworks/libswscale.5.dylib" -change /usr/local/Cellar/ffmpeg/4.1.4_2/lib/libavutil.56.dylib @executable_path/../Frameworks/libavutil.56.dylib + +# libhogweed +install_name_tool "$APP/Contents/Frameworks/libhogweed.4.dylib" -change /usr/local/Cellar/nettle/3.4.1/lib/libnettle.6.dylib @executable_path/../Frameworks/libnettle.6.dylib + +# libssl +install_name_tool "$APP/Contents/Frameworks/libssl.1.1.dylib" -change /usr/local/Cellar/openssl@1.1/1.1.1c/lib/libcrypto.1.1.dylib @executable_path/../Frameworks/libcrypto.1.1.dylib + +# libvorbis +install_name_tool "$APP/Contents/Frameworks/libvorbisenc.2.dylib" -change /usr/local/Cellar/libvorbis/1.3.6/lib/libvorbis.0.dylib @executable_path/../Frameworks/libvorbis.0.dylib