Skip to content

Commit

Permalink
fix: reduce install size for linux glibc/musl
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle authored and LongYinan committed Dec 30, 2021
1 parent 450896c commit 8e6c7e8
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 4 deletions.
13 changes: 13 additions & 0 deletions npm/linux-arm64-gnu/install.js
@@ -0,0 +1,13 @@
// Node.js 10.x, ignore
if (!process.report || typeof process.report.getReport !== 'function') {
process.exit(0)
}

// Only GNU system has this field
const { glibcVersionRuntime } = process.report.getReport().header

if (glibcVersionRuntime) {
process.exit(0)
} else {
process.exit(1)
}
6 changes: 5 additions & 1 deletion npm/linux-arm64-gnu/package.json
Expand Up @@ -9,8 +9,12 @@
],
"main": "skia.linux-arm64-gnu.node",
"files": [
"skia.linux-arm64-gnu.node"
"skia.linux-arm64-gnu.node",
"install.js"
],
"scripts": {
"install": "node install.js"
},
"description": "Canvas for Node.js with skia backend",
"keywords": [
"napi-rs",
Expand Down
13 changes: 13 additions & 0 deletions npm/linux-arm64-musl/install.js
@@ -0,0 +1,13 @@
// Node.js 10.x, ignore
if (!process.report || typeof process.report.getReport !== 'function') {
process.exit(0)
}

// Only GNU system has this field
const { glibcVersionRuntime } = process.report.getReport().header

if (glibcVersionRuntime) {
process.exit(1)
} else {
process.exit(0)
}
6 changes: 5 additions & 1 deletion npm/linux-arm64-musl/package.json
Expand Up @@ -9,8 +9,12 @@
],
"main": "skia.linux-arm64-musl.node",
"files": [
"skia.linux-arm64-musl.node"
"skia.linux-arm64-musl.node",
"install.js"
],
"scripts": {
"install": "node install.js"
},
"description": "Canvas for Node.js with skia backend",
"keywords": [
"napi-rs",
Expand Down
13 changes: 13 additions & 0 deletions npm/linux-x64-gnu/install.js
@@ -0,0 +1,13 @@
// Node.js 10.x, ignore
if (!process.report || typeof process.report.getReport !== 'function') {
process.exit(0)
}

// Only GNU system has this field
const { glibcVersionRuntime } = process.report.getReport().header

if (glibcVersionRuntime) {
process.exit(0)
} else {
process.exit(1)
}
6 changes: 5 additions & 1 deletion npm/linux-x64-gnu/package.json
Expand Up @@ -9,8 +9,12 @@
],
"main": "skia.linux-x64-gnu.node",
"files": [
"skia.linux-x64-gnu.node"
"skia.linux-x64-gnu.node",
"install.js"
],
"scripts": {
"install": "node install.js"
},
"description": "Canvas for Node.js with skia backend",
"keywords": [
"napi-rs",
Expand Down
13 changes: 13 additions & 0 deletions npm/linux-x64-musl/install.js
@@ -0,0 +1,13 @@
// Node.js 10.x, ignore
if (!process.report || typeof process.report.getReport !== 'function') {
process.exit(0)
}

// Only GNU system has this field
const { glibcVersionRuntime } = process.report.getReport().header

if (glibcVersionRuntime) {
process.exit(1)
} else {
process.exit(0)
}
6 changes: 5 additions & 1 deletion npm/linux-x64-musl/package.json
Expand Up @@ -9,8 +9,12 @@
],
"main": "skia.linux-x64-musl.node",
"files": [
"skia.linux-x64-musl.node"
"skia.linux-x64-musl.node",
"install.js"
],
"scripts": {
"install": "node install.js"
},
"description": "Canvas for Node.js with skia backend",
"keywords": [
"napi-rs",
Expand Down

0 comments on commit 8e6c7e8

Please sign in to comment.