option(WITH_SCANNER "Enable webcam QR scanner" ON)
option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
+# internal configuration options
+option(TOR_INSTALLED "Is Tor installed on the filesystem?" OFF)
+
# Plugins
option(WITH_PLUGIN_HOME "Include Home tab plugin" ON)
option(WITH_PLUGIN_TICKERS "Include Tickers Home plugin" ON)
*mingw32)
case "$OPTIONS" in
installer)
- CMAKEVARS+=" -DPLATFORM_INSTALLER=On -DTOR_DIR=Off -DTOR_VERSION=Off"
+ CMAKEVARS+=" -DPLATFORM_INSTALLER=On -DTOR_INSTALLED=On -DTOR_DIR=Off -DTOR_VERSION=Off"
;;
esac
;;
CMAKEVARS+=" -DNO_AES=On" # Raspberry Pi
;;
*darwin*)
- CMAKEVARS+=" -DTOR_DIR=Off -DTOR_VERSION=Off"
+ CMAKEVARS+=" -DTOR_DIR=Off -DTOR_VERSION=Off -DTOR_INSTALLED=On"
;;
esac
mkdir -p Feather.app/Contents/bin
cp -a /feather/contrib/depends/${HOST}/Tor/libevent-2.1.7.dylib Feather.app/Contents/bin
cp -a /feather/contrib/depends/${HOST}/Tor/tor Feather.app/Contents/bin
+ chmod +x Feather.app/Contents/bin/tor
;;
esac
target_compile_definitions(feather PRIVATE PLATFORM_INSTALLER=1)
endif()
+if(TOR_INSTALLED)
+ target_compile_definitions(feather PRIVATE TOR_INSTALLED=1)
+endif()
+
if(STACK_TRACE)
target_compile_definitions(feather PRIVATE STACK_TRACE=1)
endif()
connect(m_checkConnectionTimer, &QTimer::timeout, this, &TorManager::checkConnection);
this->torDir = Config::defaultConfigDir().filePath("tor");
-#if defined(PLATFORM_INSTALLER)
+#if defined(TOR_INSTALLED)
// When installed, use directory relative to application path.
this->torDir = QDir(Utils::applicationPath()).filePath("tor");
#endif
+ if (QString(FEATHER_TARGET_TRIPLET) == "arm64-apple-darwin" || QString(FEATHER_TARGET_TRIPLET) == "x86_64-apple-darwin") {
+ QString featherBinaryPath = QCoreApplication::applicationDirPath();
+ QDir appBinaryDir(featherBinaryPath);
+ appBinaryDir.cd("..");
+ this->torDir = appBinaryDir.filePath("bin");
+ }
this->torDataPath = Config::defaultConfigDir().filePath("tor/data");
this->torPath = QDir(this->torDir).filePath(torBin);
-#if defined(PLATFORM_INSTALLER)
+#if defined(TOR_INSTALLED)
// We don't need to unpack if Tor was installed using the installer
return true;
#endif
+ if (QString(FEATHER_TARGET_TRIPLET) == "arm64-apple-darwin" || QString(FEATHER_TARGET_TRIPLET) == "x86_64-apple-darwin") {
+ return true;
+ }
+
SemanticVersion embeddedVersion = SemanticVersion::fromString(QString(TOR_VERSION));
SemanticVersion filesystemVersion = this->getVersion(torPath);
qDebug() << QString("Tor versions: embedded %1, filesystem %2").arg(embeddedVersion.toString(), filesystemVersion.toString());
}
// Don't start a Tor daemon if we don't have one
-#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
+#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
qWarning() << "Feather built without embedded Tor. Assuming --use-local-tor";
return false;
#endif
// [Tor settings]
// [Let Feather start and manage a Tor daemon]
-#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
+#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
ui->checkBox_torManaged->setChecked(false);
ui->checkBox_torManaged->setEnabled(false);
ui->checkBox_torManaged->setToolTip("Feather was bundled without Tor");
// [Show Tor logs]
ui->frame_torShowLogs->setVisible(!conf()->get(Config::useLocalTor).toBool());
-#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
+#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
ui->frame_torShowLogs->setVisible(false);
#endif
connect(ui->btn_torShowLogs, &QPushButton::clicked, [this]{