From b403bd0b59f14a166a43e7ffda334dac7ac17305 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Tue, 15 Apr 2025 08:09:48 -0400 Subject: [PATCH] qt6.qtdeclarative: fix code-signing on Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build tries to sign qmltestrunner, but sometimes it’s already signed, causing the signing to fail due to an existing signature. Cherry-pick this patch from upstream to force sign it regardless. --- .../qt-6/modules/qtdeclarative/default.nix | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix index fe554c46e2a35..fed828ae7b0d2 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative/default.nix @@ -10,6 +10,7 @@ lib, pkgsBuildBuild, replaceVars, + fetchpatch2, }: qtModule { @@ -28,16 +29,24 @@ qtModule { darwin.sigtool ]; - patches = [ - # invalidates qml caches created from nix applications at different - # store paths and disallows saving caches of bare qml files in the store. - (replaceVars ./invalidate-caches-from-mismatched-store-paths.patch { - nixStore = builtins.storeDir; - nixStoreLength = builtins.toString ((builtins.stringLength builtins.storeDir) + 1); # trailing / - }) - # add version specific QML import path - ./use-versioned-import-path.patch - ]; + patches = + [ + # invalidates qml caches created from nix applications at different + # store paths and disallows saving caches of bare qml files in the store. + (replaceVars ./invalidate-caches-from-mismatched-store-paths.patch { + nixStore = builtins.storeDir; + nixStoreLength = builtins.toString ((builtins.stringLength builtins.storeDir) + 1); # trailing / + }) + # add version specific QML import path + ./use-versioned-import-path.patch + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # The build attempts to sign qmltestrunner, which may already be signed, causing it to fail unless forced. + (fetchpatch2 { + url = "https://invent.kde.org/qt/qt/qtdeclarative/-/commit/8effbbcefd8cae27cd5da07b4ffe3aa86dad83bf.diff"; + hash = "sha256-wKrKXdr1ddshpRVIZZ/dsn87wjPXSaoUvXT9edlPtzA="; + }) + ]; preConfigure = let