Skip to content

Commit d1c109e

Browse files
authored
Merge pull request #401 from styfle/add-install-script-gnu-musl
Reduce install size for linux glibc/musl
2 parents 450896c + 8e6c7e8 commit d1c109e

File tree

8 files changed

+72
-4
lines changed

8 files changed

+72
-4
lines changed

npm/linux-arm64-gnu/install.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Node.js 10.x, ignore
2+
if (!process.report || typeof process.report.getReport !== 'function') {
3+
process.exit(0)
4+
}
5+
6+
// Only GNU system has this field
7+
const { glibcVersionRuntime } = process.report.getReport().header
8+
9+
if (glibcVersionRuntime) {
10+
process.exit(0)
11+
} else {
12+
process.exit(1)
13+
}

npm/linux-arm64-gnu/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
],
1010
"main": "skia.linux-arm64-gnu.node",
1111
"files": [
12-
"skia.linux-arm64-gnu.node"
12+
"skia.linux-arm64-gnu.node",
13+
"install.js"
1314
],
15+
"scripts": {
16+
"install": "node install.js"
17+
},
1418
"description": "Canvas for Node.js with skia backend",
1519
"keywords": [
1620
"napi-rs",

npm/linux-arm64-musl/install.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Node.js 10.x, ignore
2+
if (!process.report || typeof process.report.getReport !== 'function') {
3+
process.exit(0)
4+
}
5+
6+
// Only GNU system has this field
7+
const { glibcVersionRuntime } = process.report.getReport().header
8+
9+
if (glibcVersionRuntime) {
10+
process.exit(1)
11+
} else {
12+
process.exit(0)
13+
}

npm/linux-arm64-musl/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
],
1010
"main": "skia.linux-arm64-musl.node",
1111
"files": [
12-
"skia.linux-arm64-musl.node"
12+
"skia.linux-arm64-musl.node",
13+
"install.js"
1314
],
15+
"scripts": {
16+
"install": "node install.js"
17+
},
1418
"description": "Canvas for Node.js with skia backend",
1519
"keywords": [
1620
"napi-rs",

npm/linux-x64-gnu/install.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Node.js 10.x, ignore
2+
if (!process.report || typeof process.report.getReport !== 'function') {
3+
process.exit(0)
4+
}
5+
6+
// Only GNU system has this field
7+
const { glibcVersionRuntime } = process.report.getReport().header
8+
9+
if (glibcVersionRuntime) {
10+
process.exit(0)
11+
} else {
12+
process.exit(1)
13+
}

npm/linux-x64-gnu/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
],
1010
"main": "skia.linux-x64-gnu.node",
1111
"files": [
12-
"skia.linux-x64-gnu.node"
12+
"skia.linux-x64-gnu.node",
13+
"install.js"
1314
],
15+
"scripts": {
16+
"install": "node install.js"
17+
},
1418
"description": "Canvas for Node.js with skia backend",
1519
"keywords": [
1620
"napi-rs",

npm/linux-x64-musl/install.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Node.js 10.x, ignore
2+
if (!process.report || typeof process.report.getReport !== 'function') {
3+
process.exit(0)
4+
}
5+
6+
// Only GNU system has this field
7+
const { glibcVersionRuntime } = process.report.getReport().header
8+
9+
if (glibcVersionRuntime) {
10+
process.exit(1)
11+
} else {
12+
process.exit(0)
13+
}

npm/linux-x64-musl/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99
],
1010
"main": "skia.linux-x64-musl.node",
1111
"files": [
12-
"skia.linux-x64-musl.node"
12+
"skia.linux-x64-musl.node",
13+
"install.js"
1314
],
15+
"scripts": {
16+
"install": "node install.js"
17+
},
1418
"description": "Canvas for Node.js with skia backend",
1519
"keywords": [
1620
"napi-rs",

0 commit comments

Comments
 (0)