koffi 3.0.0-rc.1 → 3.0.0-rc.2
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/cnoke.cjs +7 -7
- package/package.json +15 -15
- package/src/koffi/index.cjs +12 -12
- package/src/koffi/index.js +9 -9
- package/src/koffi/indirect.cjs +12 -12
- package/src/koffi/indirect.js +7 -7
package/cnoke.cjs
CHANGED
|
@@ -22,16 +22,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// src/cnoke/cnoke.js
|
|
26
26
|
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
27
27
|
|
|
28
|
-
//
|
|
28
|
+
// src/cnoke/src/builder.js
|
|
29
29
|
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
30
30
|
var import_node_os = __toESM(require("node:os"), 1);
|
|
31
31
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
32
32
|
var import_node_child_process = require("node:child_process");
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// src/cnoke/src/abi.js
|
|
35
35
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
36
|
function determineAbi() {
|
|
37
37
|
let abi = process.arch;
|
|
@@ -121,7 +121,7 @@ function decodeElfHeader(buf) {
|
|
|
121
121
|
return header;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
//
|
|
124
|
+
// src/cnoke/src/util.js
|
|
125
125
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
126
126
|
function pathIsAbsolute(path2) {
|
|
127
127
|
if (process.platform == "win32" && path2.match(/^[a-zA-Z]:/))
|
|
@@ -194,7 +194,7 @@ function compareVersions(ver1, ver2) {
|
|
|
194
194
|
return cmp;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
//
|
|
197
|
+
// src/cnoke/src/assets.js
|
|
198
198
|
var FIND_CNOKE_CMAKE = `# SPDX-License-Identifier: MIT
|
|
199
199
|
# SPDX-FileCopyrightText: 2026 Niels Martign\xE8ne <niels.martignene@protonmail.com>
|
|
200
200
|
|
|
@@ -361,7 +361,7 @@ const PfnDliHook __pfnDliNotifyHook2 = self_exe_hook;
|
|
|
361
361
|
#endif
|
|
362
362
|
`;
|
|
363
363
|
|
|
364
|
-
//
|
|
364
|
+
// src/cnoke/src/builder.js
|
|
365
365
|
var DefaultOptions = {
|
|
366
366
|
mode: "RelWithDebInfo"
|
|
367
367
|
};
|
|
@@ -650,7 +650,7 @@ function Builder(config = {}) {
|
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
-
//
|
|
653
|
+
// src/cnoke/cnoke.js
|
|
654
654
|
var VALID_COMMANDS = ["build", "configure", "clean"];
|
|
655
655
|
main();
|
|
656
656
|
async function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koffi",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.2",
|
|
4
4
|
"description": "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"foreign",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
},
|
|
34
34
|
"funding": "https://liberapay.com/Koromix",
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@koromix/koffi-linux-arm64": "3.0.0-rc.
|
|
37
|
-
"@koromix/koffi-linux-ia32": "3.0.0-rc.
|
|
38
|
-
"@koromix/koffi-linux-x64": "3.0.0-rc.
|
|
39
|
-
"@koromix/koffi-linux-
|
|
40
|
-
"@koromix/koffi-freebsd-ia32": "3.0.0-rc.
|
|
41
|
-
"@koromix/koffi-freebsd-x64": "3.0.0-rc.
|
|
42
|
-
"@koromix/koffi-freebsd-arm64": "3.0.0-rc.
|
|
43
|
-
"@koromix/koffi-openbsd-ia32": "3.0.0-rc.
|
|
44
|
-
"@koromix/koffi-openbsd-x64": "3.0.0-rc.
|
|
45
|
-
"@koromix/koffi-win32-ia32": "3.0.0-rc.
|
|
46
|
-
"@koromix/koffi-win32-x64": "3.0.0-rc.
|
|
47
|
-
"@koromix/koffi-darwin-x64": "3.0.0-rc.
|
|
48
|
-
"@koromix/koffi-darwin-arm64": "3.0.0-rc.
|
|
49
|
-
"@koromix/koffi-linux-loong64": "3.0.0-rc.
|
|
36
|
+
"@koromix/koffi-linux-arm64": "3.0.0-rc.2",
|
|
37
|
+
"@koromix/koffi-linux-ia32": "3.0.0-rc.2",
|
|
38
|
+
"@koromix/koffi-linux-x64": "3.0.0-rc.2",
|
|
39
|
+
"@koromix/koffi-linux-riscv64": "3.0.0-rc.2",
|
|
40
|
+
"@koromix/koffi-freebsd-ia32": "3.0.0-rc.2",
|
|
41
|
+
"@koromix/koffi-freebsd-x64": "3.0.0-rc.2",
|
|
42
|
+
"@koromix/koffi-freebsd-arm64": "3.0.0-rc.2",
|
|
43
|
+
"@koromix/koffi-openbsd-ia32": "3.0.0-rc.2",
|
|
44
|
+
"@koromix/koffi-openbsd-x64": "3.0.0-rc.2",
|
|
45
|
+
"@koromix/koffi-win32-ia32": "3.0.0-rc.2",
|
|
46
|
+
"@koromix/koffi-win32-x64": "3.0.0-rc.2",
|
|
47
|
+
"@koromix/koffi-darwin-x64": "3.0.0-rc.2",
|
|
48
|
+
"@koromix/koffi-darwin-arm64": "3.0.0-rc.2",
|
|
49
|
+
"@koromix/koffi-linux-loong64": "3.0.0-rc.2"
|
|
50
50
|
},
|
|
51
51
|
"type": "module",
|
|
52
52
|
"main": "./index.cjs",
|
package/src/koffi/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
));
|
|
33
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
34
|
|
|
35
|
-
//
|
|
35
|
+
// src/cnoke/src/abi.js
|
|
36
36
|
function determineAbi() {
|
|
37
37
|
let abi = process.arch;
|
|
38
38
|
if (abi == "riscv32" || abi == "riscv64") {
|
|
@@ -122,20 +122,20 @@ function decodeElfHeader(buf) {
|
|
|
122
122
|
}
|
|
123
123
|
var import_node_fs;
|
|
124
124
|
var init_abi = __esm({
|
|
125
|
-
"
|
|
125
|
+
"src/cnoke/src/abi.js"() {
|
|
126
126
|
import_node_fs = __toESM(require("node:fs"), 1);
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
// package.json
|
|
130
|
+
// src/koffi/package.json
|
|
131
131
|
var package_default;
|
|
132
132
|
var init_package = __esm({
|
|
133
|
-
"package.json"() {
|
|
134
|
-
package_default = { name: "koffi", version: "3.0.0-rc.
|
|
133
|
+
"src/koffi/package.json"() {
|
|
134
|
+
package_default = { name: "koffi", version: "3.0.0-rc.2", cnoke: { api: "../../vendor/node-api-headers", output: "../../bin/Koffi/{{ toolchain }}", node: 16, napi: 8 } };
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
// src/init.js
|
|
138
|
+
// src/koffi/src/init.js
|
|
139
139
|
var init_exports = {};
|
|
140
140
|
__export(init_exports, {
|
|
141
141
|
detectPlatform: () => detectPlatform,
|
|
@@ -217,7 +217,7 @@ function wrapNative(native2) {
|
|
|
217
217
|
}
|
|
218
218
|
var import_node_util, import_node_fs2, import_node_module, requireNative;
|
|
219
219
|
var init_init = __esm({
|
|
220
|
-
"src/init.js"() {
|
|
220
|
+
"src/koffi/src/init.js"() {
|
|
221
221
|
import_node_util = __toESM(require("node:util"));
|
|
222
222
|
import_node_fs2 = __toESM(require("node:fs"));
|
|
223
223
|
import_node_module = require("node:module");
|
|
@@ -227,9 +227,9 @@ var init_init = __esm({
|
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
|
|
230
|
-
// src/static.js
|
|
230
|
+
// src/koffi/src/static.js
|
|
231
231
|
var require_static = __commonJS({
|
|
232
|
-
"src/static.js"(exports2, module2) {
|
|
232
|
+
"src/koffi/src/static.js"(exports2, module2) {
|
|
233
233
|
var { createRequire: createRequire2 } = require("node:module");
|
|
234
234
|
var requireNative2 = createRequire2(__filename);
|
|
235
235
|
var BINARY_ROOT2 = __dirname + "/../../build/koffi";
|
|
@@ -251,8 +251,8 @@ var require_static = __commonJS({
|
|
|
251
251
|
} catch (err) {
|
|
252
252
|
}
|
|
253
253
|
try {
|
|
254
|
-
if (pkg2 == "linux-
|
|
255
|
-
native2 = requireNative2("../../../@koromix/koffi-linux-
|
|
254
|
+
if (pkg2 == "linux-riscv64")
|
|
255
|
+
native2 = requireNative2("../../../@koromix/koffi-linux-riscv64");
|
|
256
256
|
} catch (err) {
|
|
257
257
|
}
|
|
258
258
|
try {
|
|
@@ -314,7 +314,7 @@ var require_static = __commonJS({
|
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
// index.cjs
|
|
317
|
+
// src/koffi/index.cjs
|
|
318
318
|
var { detectPlatform: detectPlatform2, loadDynamic: loadDynamic2, wrapNative: wrapNative2 } = (init_init(), __toCommonJS(init_exports));
|
|
319
319
|
var { BINARY_ROOT, loadStatic } = require_static();
|
|
320
320
|
var [version, pkg, triplets] = detectPlatform2();
|
package/src/koffi/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// src/init.js
|
|
1
|
+
// src/koffi/src/init.js
|
|
2
2
|
import util from "node:util";
|
|
3
3
|
import fs2 from "node:fs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// src/cnoke/src/abi.js
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
function determineAbi() {
|
|
9
9
|
let abi = process.arch;
|
|
@@ -93,10 +93,10 @@ function decodeElfHeader(buf) {
|
|
|
93
93
|
return header;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// package.json
|
|
97
|
-
var package_default = { name: "koffi", version: "3.0.0-rc.
|
|
96
|
+
// src/koffi/package.json
|
|
97
|
+
var package_default = { name: "koffi", version: "3.0.0-rc.2", cnoke: { api: "../../vendor/node-api-headers", output: "../../bin/Koffi/{{ toolchain }}", node: 16, napi: 8 } };
|
|
98
98
|
|
|
99
|
-
// src/init.js
|
|
99
|
+
// src/koffi/src/init.js
|
|
100
100
|
var requireNative = createRequire(import.meta.url);
|
|
101
101
|
function detectPlatform() {
|
|
102
102
|
if (process.versions.napi == null || process.versions.napi < package_default.cnoke.napi) {
|
|
@@ -172,7 +172,7 @@ function wrapNative(native2) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
// src/static.js
|
|
175
|
+
// src/koffi/src/static.js
|
|
176
176
|
import { createRequire as createRequire2 } from "node:module";
|
|
177
177
|
var requireNative2 = createRequire2(import.meta.url);
|
|
178
178
|
var BINARY_ROOT = import.meta.dirname + "/../../build/koffi";
|
|
@@ -194,8 +194,8 @@ function loadStatic(pkg2) {
|
|
|
194
194
|
} catch (err) {
|
|
195
195
|
}
|
|
196
196
|
try {
|
|
197
|
-
if (pkg2 == "linux-
|
|
198
|
-
native2 = requireNative2("../../../@koromix/koffi-linux-
|
|
197
|
+
if (pkg2 == "linux-riscv64")
|
|
198
|
+
native2 = requireNative2("../../../@koromix/koffi-linux-riscv64");
|
|
199
199
|
} catch (err) {
|
|
200
200
|
}
|
|
201
201
|
try {
|
|
@@ -251,7 +251,7 @@ function loadStatic(pkg2) {
|
|
|
251
251
|
return native2;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
// index.js
|
|
254
|
+
// src/koffi/index.js
|
|
255
255
|
var [version, pkg, triplets] = detectPlatform();
|
|
256
256
|
var native = null;
|
|
257
257
|
STATIC: native = loadStatic(pkg);
|
package/src/koffi/indirect.cjs
CHANGED
|
@@ -32,7 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
));
|
|
33
33
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
34
34
|
|
|
35
|
-
//
|
|
35
|
+
// src/cnoke/src/abi.js
|
|
36
36
|
function determineAbi() {
|
|
37
37
|
let abi = process.arch;
|
|
38
38
|
if (abi == "riscv32" || abi == "riscv64") {
|
|
@@ -122,20 +122,20 @@ function decodeElfHeader(buf) {
|
|
|
122
122
|
}
|
|
123
123
|
var import_node_fs;
|
|
124
124
|
var init_abi = __esm({
|
|
125
|
-
"
|
|
125
|
+
"src/cnoke/src/abi.js"() {
|
|
126
126
|
import_node_fs = __toESM(require("node:fs"), 1);
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
|
|
130
|
-
// package.json
|
|
130
|
+
// src/koffi/package.json
|
|
131
131
|
var package_default;
|
|
132
132
|
var init_package = __esm({
|
|
133
|
-
"package.json"() {
|
|
134
|
-
package_default = { name: "koffi", version: "3.0.0-rc.
|
|
133
|
+
"src/koffi/package.json"() {
|
|
134
|
+
package_default = { name: "koffi", version: "3.0.0-rc.2", cnoke: { api: "../../vendor/node-api-headers", output: "../../bin/Koffi/{{ toolchain }}", node: 16, napi: 8 } };
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
// src/init.js
|
|
138
|
+
// src/koffi/src/init.js
|
|
139
139
|
var init_exports = {};
|
|
140
140
|
__export(init_exports, {
|
|
141
141
|
detectPlatform: () => detectPlatform,
|
|
@@ -217,7 +217,7 @@ function wrapNative(native2) {
|
|
|
217
217
|
}
|
|
218
218
|
var import_node_util, import_node_fs2, import_node_module, requireNative;
|
|
219
219
|
var init_init = __esm({
|
|
220
|
-
"src/init.js"() {
|
|
220
|
+
"src/koffi/src/init.js"() {
|
|
221
221
|
import_node_util = __toESM(require("node:util"));
|
|
222
222
|
import_node_fs2 = __toESM(require("node:fs"));
|
|
223
223
|
import_node_module = require("node:module");
|
|
@@ -227,9 +227,9 @@ var init_init = __esm({
|
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
|
|
230
|
-
// src/static.js
|
|
230
|
+
// src/koffi/src/static.js
|
|
231
231
|
var require_static = __commonJS({
|
|
232
|
-
"src/static.js"(exports2, module2) {
|
|
232
|
+
"src/koffi/src/static.js"(exports2, module2) {
|
|
233
233
|
var { createRequire: createRequire2 } = require("node:module");
|
|
234
234
|
var requireNative2 = createRequire2(__filename);
|
|
235
235
|
var BINARY_ROOT2 = __dirname + "/../../build/koffi";
|
|
@@ -251,8 +251,8 @@ var require_static = __commonJS({
|
|
|
251
251
|
} catch (err) {
|
|
252
252
|
}
|
|
253
253
|
try {
|
|
254
|
-
if (pkg2 == "linux-
|
|
255
|
-
native2 = requireNative2("../../../@koromix/koffi-linux-
|
|
254
|
+
if (pkg2 == "linux-riscv64")
|
|
255
|
+
native2 = requireNative2("../../../@koromix/koffi-linux-riscv64");
|
|
256
256
|
} catch (err) {
|
|
257
257
|
}
|
|
258
258
|
try {
|
|
@@ -314,7 +314,7 @@ var require_static = __commonJS({
|
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
|
|
317
|
-
// index.cjs
|
|
317
|
+
// src/koffi/index.cjs
|
|
318
318
|
var { detectPlatform: detectPlatform2, loadDynamic: loadDynamic2, wrapNative: wrapNative2 } = (init_init(), __toCommonJS(init_exports));
|
|
319
319
|
var { BINARY_ROOT, loadStatic } = require_static();
|
|
320
320
|
var [version, pkg, triplets] = detectPlatform2();
|
package/src/koffi/indirect.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// src/init.js
|
|
1
|
+
// src/koffi/src/init.js
|
|
2
2
|
import util from "node:util";
|
|
3
3
|
import fs2 from "node:fs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
|
|
6
|
-
//
|
|
6
|
+
// src/cnoke/src/abi.js
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
function determineAbi() {
|
|
9
9
|
let abi = process.arch;
|
|
@@ -93,10 +93,10 @@ function decodeElfHeader(buf) {
|
|
|
93
93
|
return header;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// package.json
|
|
97
|
-
var package_default = { name: "koffi", version: "3.0.0-rc.
|
|
96
|
+
// src/koffi/package.json
|
|
97
|
+
var package_default = { name: "koffi", version: "3.0.0-rc.2", cnoke: { api: "../../vendor/node-api-headers", output: "../../bin/Koffi/{{ toolchain }}", node: 16, napi: 8 } };
|
|
98
98
|
|
|
99
|
-
// src/init.js
|
|
99
|
+
// src/koffi/src/init.js
|
|
100
100
|
var requireNative = createRequire(import.meta.url);
|
|
101
101
|
function detectPlatform() {
|
|
102
102
|
if (process.versions.napi == null || process.versions.napi < package_default.cnoke.napi) {
|
|
@@ -172,12 +172,12 @@ function wrapNative(native2) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
// src/static.js
|
|
175
|
+
// src/koffi/src/static.js
|
|
176
176
|
import { createRequire as createRequire2 } from "node:module";
|
|
177
177
|
var requireNative2 = createRequire2(import.meta.url);
|
|
178
178
|
var BINARY_ROOT = import.meta.dirname + "/../../build/koffi";
|
|
179
179
|
|
|
180
|
-
// index.js
|
|
180
|
+
// src/koffi/index.js
|
|
181
181
|
var [version, pkg, triplets] = detectPlatform();
|
|
182
182
|
var native = null;
|
|
183
183
|
if (native == null)
|