修复Linux arm64系统下无法启动的问题(#1102)
parent
c8210e0516
commit
26e8e0a1b1
|
@ -0,0 +1,31 @@
|
|||
const fs = require('fs')
|
||||
const fsPromises = require('fs').promises
|
||||
const path = require('path')
|
||||
const { Arch } = require('electron-builder')
|
||||
|
||||
const replaceSqliteLib = async() => {
|
||||
// console.log(await fs.readdir(path.join(context.appOutDir, './resources/')))
|
||||
// if (context.electronPlatformName != 'linux' || context.arch != Arch.arm64) return
|
||||
console.log('replace sqlite lib...')
|
||||
const filePath = path.join(__dirname, './lib/better_sqlite3.linux.arm64.node')
|
||||
const targetPath = path.join(__dirname, '../node_modules/better-sqlite3/build/Release/better_sqlite3.node')
|
||||
await fsPromises.unlink(targetPath).catch(_ => _)
|
||||
await fsPromises.copyFile(filePath, targetPath)
|
||||
}
|
||||
|
||||
|
||||
module.exports = async(context) => {
|
||||
const { electronPlatformName, arch } = context
|
||||
if (electronPlatformName !== 'linux') return
|
||||
const bindingFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp')
|
||||
const bindingBakFilePath = path.join(__dirname, '../node_modules/better-sqlite3/binding.gyp.bak')
|
||||
if (arch == Arch.arm64) {
|
||||
console.log('rename binding file...')
|
||||
await fsPromises.rename(bindingFilePath, bindingBakFilePath)
|
||||
await replaceSqliteLib()
|
||||
} else {
|
||||
if (fs.existsSync(bindingFilePath)) return
|
||||
console.log('restore binding file...')
|
||||
await fsPromises.rename(bindingBakFilePath, bindingFilePath)
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -79,6 +79,7 @@
|
|||
},
|
||||
"build": {
|
||||
"appId": "cn.toside.music.desktop",
|
||||
"beforePack": "./build-config/build-before-pack.js",
|
||||
"afterPack": "./build-config/build-after-pack.js",
|
||||
"protocols": {
|
||||
"name": "lx-music-protocol",
|
||||
|
@ -193,10 +194,7 @@
|
|||
"electron-app",
|
||||
"vuejs3"
|
||||
],
|
||||
"author": {
|
||||
"name": "lyswhut",
|
||||
"email": "lyswhut@qq.com"
|
||||
},
|
||||
"author": "lyswhut <lyswhut@qq.com>",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lyswhut/lx-music-desktop/issues"
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
### 修复
|
||||
|
||||
- 修复初始设置的桌面歌词窗口没有完全居右下角的问题
|
||||
- 修复Linux arm64系统下无法启动的问题(#1102)
|
||||
|
|
Loading…
Reference in New Issue