Bläddra i källkod

fix(macos): patch electron-sign for spaces [skip ci]

Baptiste Augrain 1 år sedan
förälder
incheckning
8e077dc483
2 ändrade filer med 6 tillägg och 60 borttagningar
  1. 0 59
      patches/fix-darwin-sign.patch
  2. 6 1
      prepare_assets.sh

+ 0 - 59
patches/fix-darwin-sign.patch

@@ -2,26 +2,6 @@ diff --git a/build/darwin/sign.js b/build/darwin/sign.js
 index f5913b7..c861e3e 100644
 --- a/build/darwin/sign.js
 +++ b/build/darwin/sign.js
-@@ -37,3 +37,3 @@ async function main(buildDir) {
-     const defaultOpts = {
--        app: path.join(appRoot, appName),
-+        app: `"${path.join(appRoot, appName)}"`,
-         platform: 'darwin',
-@@ -60,3 +60,3 @@ async function main(buildDir) {
-         ...defaultOpts,
--        app: path.join(appFrameworkPath, gpuHelperAppName),
-+        app: `"${path.join(appFrameworkPath, gpuHelperAppName)}"`,
-         entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-gpu-entitlements.plist'),
-@@ -66,3 +66,3 @@ async function main(buildDir) {
-         ...defaultOpts,
--        app: path.join(appFrameworkPath, rendererHelperAppName),
-+        app: `"${path.join(appFrameworkPath, rendererHelperAppName)}"`,
-         entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-renderer-entitlements.plist'),
-@@ -72,3 +72,3 @@ async function main(buildDir) {
-         ...defaultOpts,
--        app: path.join(appFrameworkPath, pluginHelperAppName),
-+        app: `"${path.join(appFrameworkPath, pluginHelperAppName)}"`,
-         entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-plugin-entitlements.plist'),
 @@ -83,3 +83,3 @@ async function main(buildDir) {
              '-string',
 -            'An application in Visual Studio Code wants to use AppleScript.',
@@ -37,42 +17,3 @@ index f5913b7..c861e3e 100644
 -            'An application in Visual Studio Code wants to use the Camera.',
 +            'An application in VSCodium wants to use the Camera.',
              `${infoPlistPath}`
-diff --git a/build/darwin/sign.ts b/build/darwin/sign.ts
-index 01e9ebf..0a88189 100644
---- a/build/darwin/sign.ts
-+++ b/build/darwin/sign.ts
-@@ -43,3 +43,3 @@ async function main(buildDir?: string): Promise<void> {
- 	const defaultOpts: codesign.SignOptions = {
--		app: path.join(appRoot, appName),
-+		app: `"${path.join(appRoot, appName)}"`,
- 		platform: 'darwin',
-@@ -68,3 +68,3 @@ async function main(buildDir?: string): Promise<void> {
- 		...defaultOpts,
--		app: path.join(appFrameworkPath, gpuHelperAppName),
-+		app: `"${path.join(appFrameworkPath, gpuHelperAppName)}"`,
- 		entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-gpu-entitlements.plist'),
-@@ -75,3 +75,3 @@ async function main(buildDir?: string): Promise<void> {
- 		...defaultOpts,
--		app: path.join(appFrameworkPath, rendererHelperAppName),
-+		app: `"${path.join(appFrameworkPath, rendererHelperAppName)}"`,
- 		entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-renderer-entitlements.plist'),
-@@ -82,3 +82,3 @@ async function main(buildDir?: string): Promise<void> {
- 		...defaultOpts,
--		app: path.join(appFrameworkPath, pluginHelperAppName),
-+		app: `"${path.join(appFrameworkPath, pluginHelperAppName)}"`,
- 		entitlements: path.join(baseDir, 'azure-pipelines', 'darwin', 'helper-plugin-entitlements.plist'),
-@@ -94,3 +94,3 @@ async function main(buildDir?: string): Promise<void> {
- 			'-string',
--			'An application in Visual Studio Code wants to use AppleScript.',
-+			'An application in VSCodium wants to use AppleScript.',
- 			`${infoPlistPath}`
-@@ -101,3 +101,3 @@ async function main(buildDir?: string): Promise<void> {
- 			'-string',
--			'An application in Visual Studio Code wants to use the Microphone.',
-+			'An application in VSCodium wants to use the Microphone.',
- 			`${infoPlistPath}`
-@@ -108,3 +108,3 @@ async function main(buildDir?: string): Promise<void> {
- 			'-string',
--			'An application in Visual Studio Code wants to use the Camera.',
-+			'An application in VSCodium wants to use the Camera.',
- 			`${infoPlistPath}`

+ 6 - 1
prepare_assets.sh

@@ -1,10 +1,12 @@
 #!/usr/bin/env bash
-# shellcheck disable=SC1091
+# shellcheck disable=SC1091,2016
 
 set -e
 
 APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )"
 
+. ./utils.sh
+
 npm install -g checksum
 
 sum_file() {
@@ -19,6 +21,9 @@ mkdir -p assets
 
 if [[ "${OS_NAME}" == "osx" ]]; then
   if [[ "${CI_BUILD}" != "no" ]]; then
+    # By default, electron-osx-sign don't support app name with spaces ("VSCodium - Insiders")
+    replace 's|opts.app|"${opts.app}"|' vscode/build/node_modules/electron-osx-sign/sign.js
+
     CERTIFICATE_P12="${APP_NAME}.p12"
     KEYCHAIN="${RUNNER_TEMP}/buildagent.keychain"
     AGENT_TEMPDIRECTORY="${RUNNER_TEMP}"