qt6.qtdeclarative: fix code-signing on Darwin

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.
This commit is contained in:
Randy Eckenrode
2025-04-15 08:45:32 -04:00
parent 0c3fc96845
commit b403bd0b59
@@ -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