-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add universal builds on macOS (#767)
* Create `universal` builds on macOS * try building separately * use one build step per arch * add arch to file name * Revert "use one build step per arch" This reverts commit 4d4b398. * wip * bump `@filecoin-station/core` * use after-pack hook to rebuild core * clean up * `universal` seems to work! * undo file name change * clean up * update `electron-builder` * set `x64ArchFiles` (bacalhau arm64 is actually x64) * fix bacalhau path * Revert "fix bacalhau path" This reverts commit f054187. * Revert "set `x64ArchFiles` (bacalhau arm64 is actually x64)" This reverts commit 4d974e8. * disable `USE_HARD_LINKS`
- Loading branch information
1 parent
17cee5e
commit 0a612d9
Showing
5 changed files
with
3,216 additions
and
903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict' | ||
|
||
const { spawn } = require('node:child_process') | ||
const { platform } = require('node:os') | ||
const assert = require('node:assert') | ||
const { join } = require('node:path') | ||
const { once } = require('node:events') | ||
|
||
/** @typedef {import('app-builder-lib').AfterPackContext} AfterPackContext */ | ||
|
||
/** | ||
* @param {AfterPackContext} context | ||
*/ | ||
exports.default = async function (context) { | ||
if (platform() !== 'darwin') return | ||
const arch = context.arch === 1 | ||
? 'x64' | ||
: context.arch === 3 | ||
? 'arm64' | ||
: context.arch === 4 | ||
? 'universal' | ||
: null | ||
if (arch === 'universal') return | ||
assert(arch, `Unknown architecture id: ${context.arch}`) | ||
console.log(`Rebuild Station Core for arch=${arch}`) | ||
const ps = spawn( | ||
'node', | ||
['scripts/post-install.js'], | ||
{ | ||
cwd: join( | ||
context.appOutDir, | ||
'Filecoin Station.app', | ||
'Contents', | ||
'Resources', | ||
'core' | ||
), | ||
env: { | ||
...process.env, | ||
TARGET_ARCH: arch | ||
} | ||
} | ||
) | ||
ps.stdout.pipe(process.stdout) | ||
ps.stderr.pipe(process.stderr) | ||
await once(ps, 'exit') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.