Embed Tor executable for static Mac OS builds

This commit is contained in:
dsc
2020-10-10 00:23:44 +02:00
parent 18543ad33b
commit 1337c1708d
5 changed files with 36 additions and 3 deletions
+16
View File
@@ -174,6 +174,22 @@ void Tor::handleProcessError(QProcess::ProcessError error) {
bool Tor::unpackBins() {
QString torFile;
// @TODO: refactor for Mac OS - should compile Tor statically.
#if defined(Q_OS_MAC) && defined(DRONE)
// Tor on Mac requires libevent.dylib, borrowed the executable from
// the official Tor Browser release for now.
QString libEvent = ":/tor/libevent-2.1.7.dylib";
if (Utils::fileExists(libEvent)) {
QFile e(libEvent);
QFileInfo eventInfo(e);
auto libEventPath = QDir(this->torDir).filePath(eventInfo.fileName());
qDebug() << libEventPath;
e.copy(libEventPath);
e.close();
}
#endif
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
torFile = ":/tor/tor";
#elif defined(Q_OS_WIN)