@ladybugmem/icebug 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ladybugmem/icebug",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Node.js bindings for icebug – high-performance graph analytics (NetworKit fork with Arrow CSR support)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
"src/",
|
|
10
10
|
"prebuilds/",
|
|
11
11
|
"binding.gyp",
|
|
12
|
-
"scripts/download-icebug.sh"
|
|
12
|
+
"scripts/download-icebug.sh",
|
|
13
|
+
"scripts/install.js"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
16
|
+
"install": "node scripts/install.js",
|
|
15
17
|
"download": "bash scripts/download-icebug.sh",
|
|
16
18
|
"build": "npm run download && node-gyp rebuild",
|
|
17
19
|
"build:debug": "npm run download && node-gyp rebuild --debug",
|
|
@@ -32,6 +34,5 @@
|
|
|
32
34
|
},
|
|
33
35
|
"engines": {
|
|
34
36
|
"node": ">=18.0.0"
|
|
35
|
-
}
|
|
36
|
-
"gypfile": true
|
|
37
|
+
}
|
|
37
38
|
}
|
|
Binary file
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* install.js — postinstall entry point
|
|
4
|
+
*
|
|
5
|
+
* If a prebuilt binary for this platform/arch is already bundled in the
|
|
6
|
+
* package (prebuilds/{platform}-{arch}/icebug.node) we use it as-is and
|
|
7
|
+
* skip the compile step entirely. That covers every consumer who does a
|
|
8
|
+
* plain `npm install`.
|
|
9
|
+
*
|
|
10
|
+
* Only when no prebuilt is found do we fall back to compiling from source
|
|
11
|
+
* (requires `node-gyp` and the vendor libs fetched by download-icebug.sh).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const { execSync } = require('child_process');
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
|
|
20
|
+
const root = path.join(__dirname, '..');
|
|
21
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
22
|
+
const prebuilt = path.join(root, 'prebuilds', platformKey, 'icebug.node');
|
|
23
|
+
|
|
24
|
+
if (fs.existsSync(prebuilt)) {
|
|
25
|
+
console.log(`icebug: prebuilt binary found for ${platformKey}, skipping compilation.`);
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(`icebug: no prebuilt binary for ${platformKey}, compiling from source…`);
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
execSync('npm run download', { cwd: root, stdio: 'inherit' });
|
|
33
|
+
execSync('node-gyp rebuild', { cwd: root, stdio: 'inherit' });
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.error('icebug: compilation failed:', err.message);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|