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