From ed3b7f79714458b0ec5021d9adf4524cfd5ca9ae Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 25 May 2020 17:47:20 +0200 Subject: [PATCH] Patch electron-builder to fix signing on macos Remove this once https://github.com/electron-userland/electron-builder/pull/4993 is merged Change-type: patch --- patches/electron-builder-fix-macos-sign.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patches/electron-builder-fix-macos-sign.patch diff --git a/patches/electron-builder-fix-macos-sign.patch b/patches/electron-builder-fix-macos-sign.patch new file mode 100644 index 00000000..6638e8fc --- /dev/null +++ b/patches/electron-builder-fix-macos-sign.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/app-builder-lib/electron-osx-sign/sign.js b/node_modules/app-builder-lib/electron-osx-sign/sign.js +index 3b85d83c..87da4e57 100644 +--- a/node_modules/app-builder-lib/electron-osx-sign/sign.js ++++ b/node_modules/app-builder-lib/electron-osx-sign/sign.js +@@ -119,6 +119,17 @@ async function verifySignApplicationAsync (opts) { + function signApplicationAsync (opts) { + return walkAsync(getAppContentsPath(opts)) + .then(async function (childPaths) { ++ /** ++ * Sort the child paths by how deep they are in the file tree. Some arcane apple ++ * logic expects the deeper files to be signed first otherwise strange errors get ++ * thrown our way ++ */ ++ childPaths = childPaths.sort((a, b) => { ++ const aDepth = a.split(path.sep).length ++ const bDepth = b.split(path.sep).length ++ return bDepth - aDepth ++ }) ++ + function ignoreFilePath (opts, filePath) { + if (opts.ignore) { + return opts.ignore.some(function (ignore) {