mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-02-07 12:53:34 +01:00
Fix bundle dir for macOS
This commit is contained in:
parent
ab827a91dc
commit
7d8ba57e5f
@ -347,6 +347,15 @@ if (HAVE_STREAM_DEEZER AND NOT HAVE_DZMEDIA AND NOT HAVE_DEEZER)
|
|||||||
message(STATUS "Deezer is enabled, but not DZMedia or Deezer engine, only preview streams will be available.")
|
message(STATUS "Deezer is enabled, but not DZMedia or Deezer engine, only preview streams will be available.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
option(USE_BUNDLE "Bundle macOS dependencies" OFF)
|
||||||
|
elseif(WIN32)
|
||||||
|
option(USE_BUNDLE "Bundle Windows dependencies" ON)
|
||||||
|
endif()
|
||||||
|
if (APPLE AND USE_BUNDLE AND NOT USE_BUNDLE_DIR)
|
||||||
|
set(USE_BUNDLE_DIR "../PlugIns")
|
||||||
|
endif()
|
||||||
|
|
||||||
#if(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
#if(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
||||||
#add_subdirectory(ext/gstafc)
|
#add_subdirectory(ext/gstafc)
|
||||||
#endif(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
#endif(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
||||||
|
@ -228,8 +228,8 @@ void WorkerPool<HandlerType>::DoStart() {
|
|||||||
|
|
||||||
QStringList search_path;
|
QStringList search_path;
|
||||||
search_path << qApp->applicationDirPath();
|
search_path << qApp->applicationDirPath();
|
||||||
#ifdef Q_OS_MACOS
|
#if defined(Q_OS_MACOS) && defined(USE_BUNDLE)
|
||||||
search_path << qApp->applicationDirPath() + "/../PlugIns";
|
search_path << qApp->applicationDirPath() + "/" + USE_BUNDLE_DIR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (const QString &path_prefix : search_path) {
|
for (const QString &path_prefix : search_path) {
|
||||||
|
@ -56,5 +56,9 @@
|
|||||||
#cmakedefine HAVE_KEYSYMDEF_H
|
#cmakedefine HAVE_KEYSYMDEF_H
|
||||||
#cmakedefine HAVE_XF86KEYSYM_H
|
#cmakedefine HAVE_XF86KEYSYM_H
|
||||||
|
|
||||||
|
#cmakedefine USE_BUNDLE
|
||||||
|
|
||||||
|
#define USE_BUNDLE_DIR "${USE_BUNDLE_DIR}"
|
||||||
|
|
||||||
#endif // CONFIG_H_IN
|
#endif // CONFIG_H_IN
|
||||||
|
|
||||||
|
@ -423,10 +423,15 @@ void GstEngine::SetEnvironment() {
|
|||||||
QString plugin_path;
|
QString plugin_path;
|
||||||
QString registry_filename;
|
QString registry_filename;
|
||||||
|
|
||||||
// On windows we bundle the gstreamer plugins with strawberry
|
// On Windows and macOS we bundle the gstreamer plugins with strawberry
|
||||||
#if defined(Q_OS_WIN32)
|
#ifdef USE_BUNDLE
|
||||||
|
#if defined(Q_OS_DARWIN)
|
||||||
|
scanner_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gst-plugin-scanner";
|
||||||
|
plugin_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gstreamer";
|
||||||
|
#elif defined(Q_OS_WIN32)
|
||||||
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
|
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
|
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
|
||||||
registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
||||||
@ -444,6 +449,10 @@ void GstEngine::SetEnvironment() {
|
|||||||
Utilities::SetEnv("GST_REGISTRY", registry_filename);
|
Utilities::SetEnv("GST_REGISTRY", registry_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(Q_OS_DARWIN) && defined(USE_BUNDLE)
|
||||||
|
SetEnv("GIO_EXTRA_MODULES", QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gio-modules");
|
||||||
|
#endif
|
||||||
|
|
||||||
Utilities::SetEnv("PULSE_PROP_media.role", "music");
|
Utilities::SetEnv("PULSE_PROP_media.role", "music");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,9 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
QtSingleApplication a(argc, argv);
|
QtSingleApplication a(argc, argv);
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#if defined(Q_OS_DARWIN) && defined(USE_BUNDLE)
|
||||||
//QCoreApplication::setLibraryPaths(QStringList() << QCoreApplication::applicationDirPath() + "/../PlugIns");
|
qLog(Debug) << "Looking for resources in" + QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR;
|
||||||
|
QCoreApplication::setLibraryPaths(QStringList() << QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
a.setQuitOnLastWindowClosed(false);
|
a.setQuitOnLastWindowClosed(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user