Skip to content

Commit

Permalink
fix: skia-canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Aug 17, 2023
1 parent 5e924b8 commit 52ce045
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/build_electron.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function $withoutEscaping(pieces, ...args) {
const platform = argv._[0]

let electronBuilderArgs = []
let nodePreGypArgs = []

if (!platform) {
console.log('No platform specified, building for current')
Expand All @@ -21,20 +22,30 @@ if (!platform) {

if (platform === 'mac-x64') {
electronBuilderArgs.push('--x64', '--mac')
nodePreGypArgs = ['--target_platform=darwin', '--target_arch=x64', '--target_libc=unknown']
} else if (platform === 'mac-arm64') {
electronBuilderArgs.push('--arm64', '--mac')
nodePreGypArgs = ['--target_platform=darwin', '--target_arch=arm64', '--target_libc=unknown']
} else if (platform === 'win-x64') {
electronBuilderArgs.push('--x64', '--win')
nodePreGypArgs = ['--target_platform=win32', '--target_arch=x64', '--target_libc=unknown']
} else if (platform === 'linux-x64') {
electronBuilderArgs.push('--x64', '--linux')
nodePreGypArgs = ['--target_platform=linux', '--target_arch=x64', '--target_libc=glibc']
} else if (platform === 'linux-arm7') {
electronBuilderArgs.push('--armv7l', '--linux')
nodePreGypArgs = ['--target_platform=linux', '--target_arch=arm', '--target_libc=glibc']
} else {
console.error('Unknown platform')
process.exit(1)
}
}

// Force reinstall @julusian/skia-canvas, so that it is the correct arch
if (nodePreGypArgs.length) {
await $`yarn --cwd node_modules/@julusian/skia-canvas run install --update-binary ${nodePreGypArgs}`
}

// HACK: skip this as it is trying to rebuild everything from source and failing
// if (!platform) {
// // If for our own platform, make sure the correct deps are installed
Expand Down

0 comments on commit 52ce045

Please sign in to comment.