diff --git a/YACReaderLibrary/server_config_dialog.cpp b/YACReaderLibrary/server_config_dialog.cpp index a6fe9b10..cc57453c 100644 --- a/YACReaderLibrary/server_config_dialog.cpp +++ b/YACReaderLibrary/server_config_dialog.cpp @@ -321,7 +321,11 @@ void ServerConfigDialog::updatePort() QrEncoder::QrEncoder() { +#ifdef Q_OS_MACOS + QLibrary encoder(QCoreApplication::applicationDirPath() + "/utils/libqrencode.dylib"); +#else QLibrary encoder("qrencode"); +#endif QRcode_encodeString8bit = (_QRcode_encodeString8bit) encoder.resolve("QRcode_encodeString8bit"); QRcode_free = (_QRcode_free) encoder.resolve("QRcode_free"); } diff --git a/dependencies/qrencode/macx/libqrencode.4.0.0.dylib b/dependencies/qrencode/macx/libqrencode.4.0.0.dylib new file mode 100755 index 00000000..e8595323 Binary files /dev/null and b/dependencies/qrencode/macx/libqrencode.4.0.0.dylib differ diff --git a/releaseOSX.sh b/releaseOSX.sh index 30fd7a03..b79ef250 100755 --- a/releaseOSX.sh +++ b/releaseOSX.sh @@ -1,42 +1,25 @@ #!/bin/bash -hash macdeployqt 2>/dev/null || { echo >&2 "Qmake command not available. Please add the bin subfolder of your Qt installation to the PATH environment variable."; exit 1; } +hash macdeployqt 2>/dev/null || { echo >&2 "macdeployqt command not available. Please add the bin subfolder of your Qt installation to the PATH environment variable."; exit 1; } + +echo "Preparing apps for release ..." macdeployqt YACReader.app macdeployqt YACReaderLibrary.app -qmldir=YACReaderLibrary/qml macdeployqt YACReaderLibraryServer.app -#TODO: This copies unneeded stuff into the respective apps -#cp -R utils YACReader.app/Contents/MacOS/ -#cp -R utils YACReaderLibrary.app/Contents/MacOS/ -#cp -R utils YACReaderLibraryServer.app/Contents/MacOS/ - mkdir -p YACReaderLibrary.app/Contents/MacOS/utils -cp -L /usr/local/bin/qrencode YACReaderLibrary.app/Contents/MacOS/utils/ -#TODO: avoid using fixed paths here. Get the info from otool instead! - -cp /usr/local/Cellar/qrencode/3.4.4/lib/libqrencode.3.dylib \ -YACReaderLibrary.app/Contents/MacOS/utils - -cp /usr/local/opt/libpng/lib/libpng16.16.dylib \ -YACReaderLibrary.app/Contents/MacOS/utils +cp dependencies/qrencode/macx/libqrencode.4.0.0.dylib \ +YACReaderLibrary.app/Contents/MacOS/utils/libqrencode.dylib chmod +w YACReaderLibrary.app/Contents/MacOS/utils/* -install_name_tool -change /usr/local/Cellar/qrencode/3.4.4/lib/libqrencode.3.dylib \ -@executable_path/utils/libqrencode.3.dylib \ -YACReaderLibrary.app/Contents/MacOS/utils/qrencode - -install_name_tool -change /usr/local/opt/libpng/libpng16.16.dylib \ -@executable_path/utils/libpng16.16.dylib \ -YACReaderLibrary.app/Contents/MacOS/utils/qrencode - cp -R release/server YACReaderLibrary.app/Contents/MacOS/ cp -R release/server YACReaderLibraryServer.app/Contents/MacOS/ cp -R release/languages YACReader.app/Contents/MacOS/ cp -R release/languages YACReaderLibrary.app/Contents/MacOS/ cp -R release/languages YACReaderLibraryServer.app/Contents/MacOS/ -echo "Copied!" +echo "Done." #./signapps.sh