mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
Support building universal dmgs (x64 and arm64) for mac
Change-type: patch
This commit is contained in:
parent
1dba3ae19b
commit
e42debd183
@ -6,7 +6,7 @@ const process = require('process');
|
|||||||
|
|
||||||
// Rebuild native modules for ia32 and run webpack again for the ia32 part of windows packages
|
// Rebuild native modules for ia32 and run webpack again for the ia32 part of windows packages
|
||||||
exports.default = function(context) {
|
exports.default = function(context) {
|
||||||
if (context.platform.name === 'windows') {
|
if (['windows', 'mac'].includes(context.platform.name)) {
|
||||||
cp.execFileSync(
|
cp.execFileSync(
|
||||||
'bash',
|
'bash',
|
||||||
['./node_modules/.bin/electron-rebuild', '--types', 'dev', '--arch', context.arch],
|
['./node_modules/.bin/electron-rebuild', '--types', 'dev', '--arch', context.arch],
|
||||||
|
@ -68,6 +68,8 @@ function renameNodeModules(resourcePath: string) {
|
|||||||
path
|
path
|
||||||
.relative(__dirname, resourcePath)
|
.relative(__dirname, resourcePath)
|
||||||
.replace('node_modules', 'modules')
|
.replace('node_modules', 'modules')
|
||||||
|
// use the same name on all architectures so electron-builder can build a universal dmg on mac
|
||||||
|
.replace(LZMA_BINDINGS_FOLDER, 'binding')
|
||||||
// file-loader expects posix paths, even on Windows
|
// file-loader expects posix paths, even on Windows
|
||||||
.replace(/\\/g, '/')
|
.replace(/\\/g, '/')
|
||||||
);
|
);
|
||||||
@ -190,12 +192,7 @@ const commonConfig = {
|
|||||||
// remove node-pre-gyp magic from lzma-native
|
// remove node-pre-gyp magic from lzma-native
|
||||||
{
|
{
|
||||||
search: 'require(binding_path)',
|
search: 'require(binding_path)',
|
||||||
replace: () => {
|
replace: `require('./${LZMA_BINDINGS_FOLDER}/lzma_native.node')`,
|
||||||
return `require('./${path.posix.join(
|
|
||||||
LZMA_BINDINGS_FOLDER,
|
|
||||||
'lzma_native.node',
|
|
||||||
)}')`;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
// use regular stream module instead of readable-stream
|
// use regular stream module instead of readable-stream
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user