Manually Building qBittorrent on Mac
Cause
Recently the pressure of graduation has been quite heavy, so I wanted to download a movie from Beiyouren and relax a bit. But I found that qBittorrent, the BitTorrent client I had always used for seeding and downloading, could no longer open. I searched online for quite a while for the cause and solution.
I finally confirmed that the culprit was a Mac update. qBittorrent was treated as an app with incomplete verification: Issue 11570.
There are two solutions:
- Disable Apple’s security checks
- Manually build the app yourself
For certain reasons, I could not make too many system-level changes to the Mac. So I had to try the second solution. It turned out that manually building qBittorrent was not simple; one whole afternoon passed like that, and I did not get to watch the movie either. To make it easier for classmates with the same problem to reference, I record my solution here. During my build process, I did not find similar tutorials or references online, and there were indeed quite a few pitfalls.
Steps
If there is no Qt environment before, ./configure will report an error that it cannot find qmake. The corresponding environment needs to be configured.
1 | brew install qt |
If there is no boost environment before, it will report an error that it cannot find boostlib:
1 | checking for boostlib >= 1.65 (106500)... configure: We could not detect the boost libraries (version 1.65 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation. |
The boost environment needs to be installed.
1 | brew install boost |
1 | brew install libtorrent-rasterbar |
If you encounter this error,
1 | Error: Directory not empty @ dir_s_rmdir - /usr/local/opt/openssl |
you can delete the corresponding folder or change its owner with chown.
1 | brew cleanup |
After I ran brew install libtorrent-rasterbar and then ./configure, I still ran into a wrong-version problem for that library:
1 | Requested 'libtorrent-rasterbar >= 1.2.11' but version of libtorrent-rasterbar is 1.2.10 |
Because the brew formula only had 1.2.10, we had to manually build a newer version.
Go to GitHub and find the source code for the corresponding version of libtorrent-rasterbar: download. Compile and install it according to the build instructions in the documentation.
For Mac:
1 | brew install boost-build boost openssl@1.1 |
1 | export libtorrent_LIBS="-L/usr/local/lib" |
In addition, you can also refer to some other official compilation and build documents. They provide build options using CMake or Qt Creator.