Path: blob/main/emulators/fbsd-duckstation/files/patch-relocate-resources.txt
16462 views
Allow relocation of resource files and translations12--- CMakeLists.txt.orig 2024-06-14 05:59:32 UTC3+++ CMakeLists.txt4@@ -34,6 +34,10 @@ include(DuckStationBuildOptions)5# Build options. Depends on system attributes.6include(DuckStationBuildOptions)78+if(DEFINED DUCKSTATION_APPLICATION_DIR_PATH)9+ add_compile_definitions(DUCKSTATION_APPLICATION_DIR_PATH="${DUCKSTATION_APPLICATION_DIR_PATH}")10+endif()11+12# Set _DEBUG macro for Debug builds.13set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")14set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")15--- src/duckstation-qt/qthost.cpp.orig 2024-06-14 05:59:32 UTC16+++ src/duckstation-qt/qthost.cpp17@@ -503,6 +503,10 @@ void QtHost::SetResourcesDirectory()1819void QtHost::SetResourcesDirectory()20{21+#ifdef DUCKSTATION_APPLICATION_DIR_PATH22+ // Resources' path specified at compile time23+ EmuFolders::Resources = Path::Canonicalize(DUCKSTATION_APPLICATION_DIR_PATH "/resources");24+#else25#ifndef __APPLE__26// On Windows/Linux, these are in the binary directory.27EmuFolders::Resources = Path::Combine(EmuFolders::AppRoot, "resources");28@@ -510,6 +514,7 @@ void QtHost::SetResourcesDirectory()29// On macOS, this is in the bundle resources directory.30EmuFolders::Resources = Path::Canonicalize(Path::Combine(EmuFolders::AppRoot, "../Resources"));31#endif32+#endif // DUCKSTATION_APPLICATION_DIR_PATH33}3435bool QtHost::SetDataDirectory()36--- src/duckstation-qt/qttranslations.cpp.orig 2024-06-14 05:59:32 UTC37+++ src/duckstation-qt/qttranslations.cpp38@@ -80,11 +80,15 @@ void QtHost::InstallTranslator(QWidget* dialog_parent)39FixLanguageName(QString::fromStdString(Host::GetBaseStringSettingValue("Main", "Language", GetDefaultLanguage())));4041// install the base qt translation first42+#ifdef DUCKSTATION_APPLICATION_DIR_PATH43+ const QString base_dir = QStringLiteral(DUCKSTATION_APPLICATION_DIR_PATH "/translations");44+#else45#ifndef __APPLE__46const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath());47#else48const QString base_dir = QStringLiteral("%1/../Resources/translations").arg(qApp->applicationDirPath());49#endif50+#endif // DUCKSTATION_APPLICATION_DIR_PATH5152// Qt base uses underscores instead of hyphens.53const QString qt_language = QString(language).replace(QChar('-'), QChar('_'));545556