yb85 / scantailor-advanced-osx

Homebrew formula and App bundler for Scantailor (Advanced)
149 stars 6 forks source link

Bundling fix on Big Sur #14

Closed giovariot closed 2 years ago

giovariot commented 2 years ago

Here is the description from the README.md file:

Bundling your binary

To use the bundler, you need the fish shell (brew install fish) and the utility macdeployqt to do the linking.

  1. make sure that QT is correctly linked : brew link --force qt5
  2. add the QT bin folder to your fish path : echo 'set -g fish_user_paths "/usr/local/opt/qt/bin" $fish_user_paths' >> ~/.config/fish/config.fish
  3. Simply run bundler/scantailor_bundler.command (you may have to chmod 755 bundler/scantailor_bundler.command)

The bundler script will use the scantailor binary which is in your shell path (the value printed out by which scantailor).

The problem is that on newer versions of brew the linked version of Qt is 6 onwards so forcing the linking of Qt5 is impossible. So here is part of the output from the bundler command following the README instructions:

ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QSet("/Users/giovanni/scantailor-advanced-osx/bundler/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QSet("/Users/giovanni/scantailor-advanced-osx/bundler/lib")
ERROR: Cannot resolve rpath "@rpath/QtWidgets.framework/Versions/A/QtWidgets"
ERROR:  using QSet("/Users/giovanni/scantailor-advanced-osx/bundler/lib")
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
ERROR:  using QSet("/Users/giovanni/scantailor-advanced-osx/bundler/lib")
ERROR: Cannot resolve rpath "@rpath/QtCore.framework/Versions/A/QtCore"
ERROR:  using QSet("/Users/giovanni/scantailor-advanced-osx/bundler/lib")
...

It still manages to create a bundle app file and a dmg file but opening the app it crashes right away.

Here is my proposed fix to the readme file. It currently works perfectly and generates a working app:

Bundling your binary

To use the bundler, you need the fish shell (brew install fish).

  1. open fish shell once
  2. add the QT 5 bin folder to your fish path : echo 'set -g fish_user_paths "/usr/local/opt/qt@5/bin" $fish_user_paths' >> ~/.config/fish/config.fish
  3. Simply run bundler/scantailor_bundler.command (you may have to chmod 755 bundler/scantailor_bundler.command)

The bundler script will use the scantailor binary which is in your shell path (the value printed out by which scantailor).

sebasrocksocks commented 2 years ago

Hi I am a amateur book scanner and know very little about coding. I have installed brew but when I input brew install fish I receive an error

Screen Shot 2021-12-10 at 11 47 45 AM
whoisjolan commented 2 years ago

Hi I am a amateur book scanner and know very little about coding. I have installed brew but when I input brew install fish I receive an error

Screen Shot 2021-12-10 at 11 47 45 AM

@sebasrocksocks Its because you are trying to install from the wrong directory in terminal. You need to first run the command cd to get to your home directory and then run brew install fish