lol

qt6: include qttranslations properly

K900 0597d865 68cc0258

+30 -6
+12 -3
pkgs/development/libraries/qt-6/default.nix
··· 48 48 ./patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch 49 49 ./patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch 50 50 ./patches/0007-qtbase-find-qt-tools-in-QTTOOLSPATH.patch 51 + ./patches/0008-qtbase-allow-translations-outside-prefix.patch 51 52 ]; 52 53 }; 53 54 env = callPackage ./qt-env.nix { }; ··· 168 169 169 170 # TODO(@Artturin): convert to makeScopeWithSplicing 170 171 # simple example of how to do that in 5568a4d25ca406809530420996d57e0876ca1a01 171 - self = lib.makeScope newScope addPackages; 172 - in 173 - self 172 + baseScope = lib.makeScope newScope addPackages; 173 + 174 + bootstrapScope = baseScope.overrideScope'(final: prev: { 175 + qtbase = prev.qtbase.override { qttranslations = null; }; 176 + qtdeclarative = null; 177 + }); 178 + 179 + finalScope = baseScope.overrideScope'(final: prev: { 180 + qttranslations = bootstrapScope.qttranslations; 181 + }); 182 + in finalScope
+2 -1
pkgs/development/libraries/qt-6/modules/qtbase.nix
··· 93 93 , libGL 94 94 , debug ? false 95 95 , developerBuild ? false 96 + , qttranslations ? null 96 97 }: 97 98 98 99 let ··· 233 234 ] ++ lib.optionals stdenv.isDarwin [ 234 235 # error: 'path' is unavailable: introduced in macOS 10.15 235 236 "-DQT_FEATURE_cxx17_filesystem=OFF" 236 - ]; 237 + ] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; 237 238 238 239 NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [ 239 240 # Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc"
+2 -1
pkgs/development/libraries/qt-6/modules/qttranslations.nix
··· 4 4 5 5 qtModule { 6 6 pname = "qttranslations"; 7 - qtInputs = [ qttools ]; 7 + nativeBuildInputs = [ qttools ]; 8 + outputs = [ "out" ]; 8 9 }
+13
pkgs/development/libraries/qt-6/patches/0008-qtbase-allow-translations-outside-prefix.patch
··· 1 + diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake 2 + index b45ec1d208..05f69c131b 100644 3 + --- a/cmake/QtBuild.cmake 4 + +++ b/cmake/QtBuild.cmake 5 + @@ -30,7 +30,7 @@ function(qt_configure_process_path name default docstring) 6 + set(rel_path ".") 7 + elseif(rel_path MATCHES "^\.\./") 8 + # INSTALL_SYSCONFDIR is allowed to be outside the prefix. 9 + - if(NOT name STREQUAL "INSTALL_SYSCONFDIR") 10 + + if(NOT (name STREQUAL "INSTALL_SYSCONFDIR" OR name STREQUAL "INSTALL_TRANSLATIONSDIR")) 11 + message(FATAL_ERROR 12 + "Path component '${name}' is outside computed install prefix: ${rel_path} ") 13 + return()
+1 -1
pkgs/development/libraries/qt-6/qtModule.nix
··· 22 22 buildInputs = args.buildInputs or [ ]; 23 23 nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ] 24 24 ++ lib.optionals stdenv.isDarwin [ moveBuildTree ]; 25 - propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]); 25 + propagatedBuildInputs = (args.qtInputs or [ ]) ++ (args.propagatedBuildInputs or [ ]); 26 26 27 27 moveToDev = false; 28 28