Skip to content

Commit

Permalink
Fix: node-zstd not have native dependencies in arm64 build (Linux and…
Browse files Browse the repository at this point in the history
… macOS)
  • Loading branch information
ollm committed Jan 14, 2024
1 parent f304cae commit e906f21
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

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).

## v1.1.1 (dd-mm-yyyy)

##### 🚀 New Features

##### 🐛 Bug Fixes

- node-zstd not have native dependencies in arm64 build (Linux and macOS)

## [v1.1.0](https://github.com/ollm/OpenComic/releases/tag/v1.1.0) (13-01-2024)

##### 🚀 New Features
Expand Down
105 changes: 105 additions & 0 deletions build/node-zstd-native-dependencies/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions build/node-zstd-native-dependencies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "node-zstd-force-native-dependencies",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@toondepauw/node-zstd-linux-arm64-gnu": "*",
"@toondepauw/node-zstd-linux-arm64-musl": "*",
"@toondepauw/node-zstd-linux-x64-gnu": "*",
"@toondepauw/node-zstd-linux-x64-musl": "*",
"@toondepauw/node-zstd-darwin-arm64": "*",
"@toondepauw/node-zstd-darwin-x64": "*"
}
}
2 changes: 1 addition & 1 deletion languages/zh-hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,4 @@
}
]
}
}
}
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "opencomic",
"productName": "OpenComic",
"version": "1.1.0",
"version": "1.1.1",
"main": "scripts/main.js",
"type": "commonjs",
"keywords": [
Expand Down Expand Up @@ -63,7 +63,7 @@
"build-7z-arm": "npm run prebuild && electron-builder --arm64 --linux 7z",
"snapcraft": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-amd64/ && snapcraft",
"snapcraft-arm": "npm run prebuild && node ./scripts/snapcraft.js && cd dist/__snap-arm64/ && snapcraft --target-arch=arm64",
"postinstall": "electron-builder install-app-deps"
"postinstall": "electron-builder install-app-deps && node scripts/zstd-copy-native.js"
},
"dependencies": {
"@electron/remote": "^2.1.0",
Expand Down Expand Up @@ -116,6 +116,8 @@
"!themes/*/templates",
"!templates",
"!images",
"!node_modules/cpu-features/build/node_gyp_bins",
"!node_modules/ssh2/lib/protocol/crypto/build/node_gyp_bins",
"images/logo.png",
"images/logo.svg",
"templates/index.html",
Expand All @@ -124,9 +126,11 @@
],
"asarUnpack": [
"node_modules/sharp",
"node_modules/@img",
"node_modules/node-7z",
"node_modules/7zip-bin",
"node_modules/shosho",
"node_modules/@toondepauw",
"Pepper & Carrot"
],
"win": {
Expand Down
14 changes: 14 additions & 0 deletions scripts/zstd-copy-native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require('fs');

if(process.platform == 'darwin')
{
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-darwin-x64', './node_modules/@toondepauw/node-zstd-darwin-x64', {recursive: true});
fs.cpSync('./build/node-zstd-native-dependencies/node_modules/@toondepauw/node-zstd-darwin-arm64', './node_modules/@toondepauw/node-zstd-darwin-arm64', {recursive: true});
}
else if(process.platform == 'linux')
{
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});
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});
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});
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});
}

0 comments on commit e906f21

Please sign in to comment.