mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Patch electron-builder to support universal binaries on Mac (#803)
This commit is contained in:
34
patches/app-builder-lib+22.10.5.patch
Normal file
34
patches/app-builder-lib+22.10.5.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
diff --git a/node_modules/app-builder-lib/out/macPackager.js b/node_modules/app-builder-lib/out/macPackager.js
|
||||
index 41e067c..0607d09 100644
|
||||
--- a/node_modules/app-builder-lib/out/macPackager.js
|
||||
+++ b/node_modules/app-builder-lib/out/macPackager.js
|
||||
@@ -292,6 +292,18 @@ class MacPackager extends _platformPackager().PlatformPackager {
|
||||
|
||||
const appFile = `${this.appInfo.productFilename}.app`;
|
||||
|
||||
+ // Bitwarden Patch: Electron-Builder currently does not support including our Safari extension which
|
||||
+ // is already cross-compiled. Hence we remove it prior to making the universal package, and re-add
|
||||
+ // it afterwards
|
||||
+ // https://github.com/electron-userland/electron-builder/issues/5552
|
||||
+ const rmdir2 = (0, _util().promisify)(require('fs').rmdir);
|
||||
+ await rmdir2(`${x64AppOutDir}/Bitwarden.app/Contents/PlugIns`, {
|
||||
+ recursive: true
|
||||
+ });
|
||||
+ await rmdir2(`${arm64AppOutPath}/Bitwarden.app/Contents/PlugIns`, {
|
||||
+ recursive: true
|
||||
+ });
|
||||
+
|
||||
const {
|
||||
makeUniversalApp
|
||||
} = require('@electron/universal');
|
||||
@@ -302,6 +314,10 @@ class MacPackager extends _platformPackager().PlatformPackager {
|
||||
outAppPath: path.join(appOutDir, appFile),
|
||||
force: true
|
||||
});
|
||||
+
|
||||
+ // Bitwarden Patch: Re-add PlugIns dir to Universal binary
|
||||
+ await ((0, _fsExtra().copy)(path.join(this.projectDir, 'PlugIns'), `${path.join(appOutDir, appFile)}/Contents/PlugIns`));
|
||||
+
|
||||
const rmdir = (0, _util().promisify)(require('fs').rmdir);
|
||||
await rmdir(x64AppOutDir, {
|
||||
recursive: true
|
||||
Reference in New Issue
Block a user