From 4d0a76416f5ca0402bfe7fc3fcd52a6d36c660c3 Mon Sep 17 00:00:00 2001 From: K900 Date: Sat, 29 Jul 2023 17:21:34 +0300 Subject: [PATCH] qt6.qtwebengine: don't try to install locales to qtbase translation directory --- .../libraries/qt-6/modules/qtwebengine.nix | 3 ++ .../patches/qtwebengine-locales-path.patch | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index 909616d953de..361be9490b64 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -135,6 +135,9 @@ qtModule { # environment variable, since NixOS relies on it working. # See https://github.com/NixOS/nixpkgs/issues/226484 for more context. ../patches/qtwebengine-xkb-includes.patch + + # Override locales install path so they go to QtWebEngine's $out + ../patches/qtwebengine-locales-path.patch ]; postPatch = '' diff --git a/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch b/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch new file mode 100644 index 000000000000..58f2d96f8097 --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/qtwebengine-locales-path.patch @@ -0,0 +1,28 @@ +diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt +index f860e0ba7..30e1a767a 100644 +--- a/src/core/api/CMakeLists.txt ++++ b/src/core/api/CMakeLists.txt +@@ -193,7 +193,8 @@ if(QT_FEATURE_framework) + + else() + install(FILES ${localeFiles} +- DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales ++ # Nixpkgs: INSTALL_TRANSLATIONSDIR points to Qt base translations store path ++ DESTINATION ${INSTALL_DATADIR}/qtwebengine_locales + CONFIGURATIONS ${config} + ) + install(FILES ${resourceFiles} +diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp +index c03c9a3b2..430fdfab2 100644 +--- a/src/core/web_engine_library_info.cpp ++++ b/src/core/web_engine_library_info.cpp +@@ -203,7 +203,8 @@ QString localesPath() + candidatePaths << getResourcesPath(frameworkBundle()) % QDir::separator() + % QLatin1String("qtwebengine_locales"); + #endif +- candidatePaths << QLibraryInfo::path(QLibraryInfo::TranslationsPath) % QDir::separator() ++ // Nixpkgs: match the changes made in CMakeLists.txt ++ candidatePaths << QLibraryInfo::path(QLibraryInfo::DataPath) % QDir::separator() + % QLatin1String("qtwebengine_locales"); + candidatePaths << fallbackDir(); + }