mirror of https://github.com/Kylart/KawAnime.git
Can now ship windows build with libssl and libcrypto 1.1
This commit is contained in:
parent
d767e52138
commit
c8644f5dbf
|
@ -38,5 +38,6 @@ bindings/build
|
||||||
|
|
||||||
# External libs binaries
|
# External libs binaries
|
||||||
public/*.dylib
|
public/*.dylib
|
||||||
|
public/*.dll
|
||||||
public/mpv/*
|
public/mpv/*
|
||||||
!public/mpv/.gitkeep
|
!public/mpv/.gitkeep
|
|
@ -1,22 +1,31 @@
|
||||||
const { readdirSync, copyFileSync } = require('fs')
|
const { homedir } = require('os')
|
||||||
const { join } = require('path')
|
const { copyFileSync } = require('fs')
|
||||||
|
const { join, basename } = require('path')
|
||||||
|
|
||||||
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
const PUBLIC_DIR = join(__dirname, '..', 'public')
|
||||||
const BINDINGS_BUILD_DIR = join(__dirname, '..', 'bindings', 'build', 'Release')
|
|
||||||
|
|
||||||
const FILE_NAME = {
|
function moveToPublic (filepath) {
|
||||||
darwin: 'libtorrent-rasterbar.10.dylib',
|
console.log(`[KawAnime] Copying ${filepath} to public directory.`)
|
||||||
win32: 'libtorrent-rasterbar.dll'
|
|
||||||
}[process.platform] || 'libtorrent-rasterbar.so'
|
|
||||||
|
|
||||||
readdirSync(BINDINGS_BUILD_DIR)
|
copyFileSync(
|
||||||
.forEach((file) => {
|
filepath,
|
||||||
if (file !== FILE_NAME) return
|
join(PUBLIC_DIR, basename(filepath))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`[KawAnime] Moving ${file} to public directory.`)
|
function linux () {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
copyFileSync(
|
function windows () {
|
||||||
join(BINDINGS_BUILD_DIR, file),
|
const sys32Path = join(homedir().split('\\')[0], 'Windows', 'System32')
|
||||||
join(PUBLIC_DIR, file)
|
const requiredDlls = [
|
||||||
)
|
'libcrypto-1_1-x64.dll',
|
||||||
})
|
'libssl-1_1-x64.dll'
|
||||||
|
].map((dll) => join(sys32Path, dll))
|
||||||
|
|
||||||
|
requiredDlls.forEach(moveToPublic)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.platform === 'win32') windows()
|
||||||
|
else linux()
|
||||||
|
|
Loading…
Reference in New Issue