lol

qt5: include qttranslations properly

Qt loads its own translations from a hardcoded path, and those are used
(among other things) for determining RTL layout preferences in applications,
so they are definitely something we want to have.

This adds a qtbase/qttools rebuild to the chain, but it's fast enough that it's
probably fine.

Another approach would be to load translation paths from the environment,
and inject it in wrapQtAppsHook, but that seems like more complexity
for very questionable build time savings.

K900 68cc0258 c1460d70

+18 -4
+11 -1
pkgs/development/libraries/qt-5/5.15/default.nix
··· 331 } ../hooks/wrap-qt-apps-hook.sh; 332 }; 333 334 - in makeScopeWithSplicing (generateSplicesForMkScope "qt5") (_: {}) (_: {}) addPackages
··· 331 } ../hooks/wrap-qt-apps-hook.sh; 332 }; 333 334 + baseScope = makeScopeWithSplicing (generateSplicesForMkScope "qt5") (_: {}) (_: {}) addPackages; 335 + 336 + bootstrapScope = baseScope.overrideScope(final: prev: { 337 + qtbase = prev.qtbase.override { qttranslations = null; }; 338 + qtdeclarative = null; 339 + }); 340 + 341 + finalScope = baseScope.overrideScope(final: prev: { 342 + qttranslations = bootstrapScope.qttranslations; 343 + }); 344 + in finalScope
+3
pkgs/development/libraries/qt-5/modules/qtbase.nix
··· 15 # optional dependencies 16 , cups ? null, postgresql ? null 17 , withGtk3 ? false, dconf, gtk3 18 19 # options 20 , libGLSupported ? !stdenv.isDarwin ··· 310 ] ++ lib.optionals (mysqlSupport) [ 311 "-L" "${libmysqlclient}/lib" 312 "-I" "${libmysqlclient}/include" 313 ] 314 ); 315
··· 15 # optional dependencies 16 , cups ? null, postgresql ? null 17 , withGtk3 ? false, dconf, gtk3 18 + , qttranslations ? null 19 20 # options 21 , libGLSupported ? !stdenv.isDarwin ··· 311 ] ++ lib.optionals (mysqlSupport) [ 312 "-L" "${libmysqlclient}/lib" 313 "-I" "${libmysqlclient}/include" 314 + ] ++ lib.optional (qttranslations != null) [ 315 + "-translationdir" "${qttranslations}/translations" 316 ] 317 ); 318
+1 -1
pkgs/development/libraries/qt-5/modules/qttools.nix
··· 36 "bin/macdeployqt" 37 ]; 38 39 - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; 40 41 setupHook = ../hooks/qttools-setup-hook.sh; 42 }
··· 36 "bin/macdeployqt" 37 ]; 38 39 + env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && qtdeclarative != null) ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; 40 41 setupHook = ../hooks/qttools-setup-hook.sh; 42 }
+2 -1
pkgs/development/libraries/qt-5/modules/qttranslations.nix
··· 2 3 qtModule { 4 pname = "qttranslations"; 5 - qtInputs = [ qttools ]; 6 }
··· 2 3 qtModule { 4 pname = "qttranslations"; 5 + nativeBuildInputs = [ qttools ]; 6 + outputs = [ "out" ]; 7 }
+1 -1
pkgs/development/libraries/qt-5/qtModule.nix
··· 17 patches = (args.patches or []) ++ (patches.${pname} or []); 18 19 nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ]; 20 - propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []); 21 22 outputs = args.outputs or [ "out" "dev" ]; 23 setOutputFlags = args.setOutputFlags or false;
··· 17 patches = (args.patches or []) ++ (patches.${pname} or []); 18 19 nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ]; 20 + propagatedBuildInputs = (args.qtInputs or []) ++ (args.propagatedBuildInputs or []); 21 22 outputs = args.outputs or [ "out" "dev" ]; 23 setOutputFlags = args.setOutputFlags or false;