Skip to content

Commit e906f21

Browse files
committed
Fix: node-zstd not have native dependencies in arm64 build (Linux and macOS)
1 parent f304cae commit e906f21

File tree

7 files changed

+153
-9
lines changed

7 files changed

+153
-9
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## v1.1.1 (dd-mm-yyyy)
8+
9+
##### 🚀 New Features
10+
11+
##### 🐛 Bug Fixes
12+
13+
- node-zstd not have native dependencies in arm64 build (Linux and macOS)
14+
715
## [v1.1.0](https://github.com/ollm/OpenComic/releases/tag/v1.1.0) (13-01-2024)
816

917
##### 🚀 New Features

build/node-zstd-native-dependencies/package-lock.json

+105
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "node-zstd-force-native-dependencies",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"dependencies": {
6+
"@toondepauw/node-zstd-linux-arm64-gnu": "*",
7+
"@toondepauw/node-zstd-linux-arm64-musl": "*",
8+
"@toondepauw/node-zstd-linux-x64-gnu": "*",
9+
"@toondepauw/node-zstd-linux-x64-musl": "*",
10+
"@toondepauw/node-zstd-darwin-arm64": "*",
11+
"@toondepauw/node-zstd-darwin-x64": "*"
12+
}
13+
}

languages/zh-hans.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,4 @@
381381
}
382382
]
383383
}
384-
}
384+
}

package-lock.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "opencomic",
33
"productName": "OpenComic",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"main": "scripts/main.js",
66
"type": "commonjs",
77
"keywords": [
@@ -63,7 +63,7 @@
6363
"build-7z-arm": "npm run prebuild && electron-builder --arm64 --linux 7z",
6464
"snapcraft": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-amd64/ && snapcraft",
6565
"snapcraft-arm": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-arm64/ && snapcraft --target-arch=arm64",
66-
"postinstall": "electron-builder install-app-deps"
66+
"postinstall": "electron-builder install-app-deps && node scripts/zstd-copy-native.js"
6767
},
6868
"dependencies": {
6969
"@electron/remote": "^2.1.0",
@@ -116,6 +116,8 @@
116116
"!themes/*/templates",
117117
"!templates",
118118
"!images",
119+
"!node_modules/cpu-features/build/node_gyp_bins",
120+
"!node_modules/ssh2/lib/protocol/crypto/build/node_gyp_bins",
119121
"images/logo.png",
120122
"images/logo.svg",
121123
"templates/index.html",
@@ -124,9 +126,11 @@
124126
],
125127
"asarUnpack": [
126128
"node_modules/sharp",
129+
"node_modules/@img",
127130
"node_modules/node-7z",
128131
"node_modules/7zip-bin",
129132
"node_modules/shosho",
133+
"node_modules/@toondepauw",
130134
"Pepper & Carrot"
131135
],
132136
"win": {

scripts/zstd-copy-native.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
3+
if(process.platform == 'darwin')
4+
{
5+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-darwin-x64', './node_modules/@toondepauw/node-zstd-darwin-x64', {recursive: true});
6+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-darwin-arm64', './node_modules/@toondepauw/node-zstd-darwin-arm64', {recursive: true});
7+
}
8+
else if(process.platform == 'linux')
9+
{
10+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-linux-x64-musl', './node_modules/@toondepauw/node-zstd-linux-x64-musl', {recursive: true});
11+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-linux-x64-gnu', './node_modules/@toondepauw/node-zstd-linux-x64-gnu', {recursive: true});
12+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-linux-arm64-musl', './node_modules/@toondepauw/node-zstd-linux-arm64-musl', {recursive: true});
13+
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-linux-arm64-gnu', './node_modules/@toondepauw/node-zstd-linux-arm64-gnu', {recursive: true});
14+
}

0 commit comments

Comments
 (0)