@tongue-core/raster-linux-x64 0.0.0-stage → 0.1.0-rc.1
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/README.md +18 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13 -0
- package/lib/libtongue_gpu_raster.so +0 -0
- package/lib/libtongue_raster.so +0 -0
- package/package.json +37 -4
package/README.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tongue-core/raster-linux-x64
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Prebuilt rasterizers for Linux x64, installed as an optional dependency of `@tongue-core/sdk` (the way
|
|
4
|
+
esbuild ships its binaries). Other platforms fall back to the WebAssembly raster embedded in
|
|
5
|
+
`@tongue-core/engine`.
|
|
6
|
+
|
|
7
|
+
| Library | What it is |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `lib/libtongue_raster.so` | `crates/raster` compiled for x86-64-v3 (AVX2). Byte-identical to the WebAssembly raster. |
|
|
10
|
+
| `lib/libtongue_gpu_raster.so` | `crates/gpu-raster`: headless EGL + OpenGL ES 3.1 on a DRM render node. Within a few levels of the CPU raster; opt-in. Needs libEGL, libGLESv2 and a GPU. |
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { nativeRaster, gpuRaster } from "@tongue-core/raster-linux-x64";
|
|
14
|
+
nativeRaster(); // { path: "/…/lib/libtongue_raster.so", exists: true }
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Build them with `bun scripts/build-rasters.ts` from the repo root (`--no-wasm`, `--no-native`,
|
|
18
|
+
`--no-gpu` to skip parts). The SDK can also be pointed at other builds with `TONGUE_NATIVE_RASTER`
|
|
19
|
+
and `TONGUE_GPU_RASTER`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RasterLibrary {
|
|
2
|
+
/** Absolute path of the shared library. */
|
|
3
|
+
readonly path: string;
|
|
4
|
+
/** Whether it has been built (or installed). */
|
|
5
|
+
readonly exists: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** The CPU raster, compiled for x86-64-v3 (AVX2): byte-identical to the WebAssembly raster. */
|
|
8
|
+
export declare const nativeRaster: () => RasterLibrary;
|
|
9
|
+
/** The GPU raster (headless EGL + GLES 3.1): within a few levels of the CPU raster. */
|
|
10
|
+
export declare const gpuRaster: () => RasterLibrary;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
// Where this package's prebuilt rasterizers are. The libraries are built by
|
|
4
|
+
// scripts/build-rasters.ts (repo root) and loaded by @tongue-core/sdk through bun:ffi.
|
|
5
|
+
const lib = join(import.meta.dir, "../lib");
|
|
6
|
+
const libraryAt = (file) => {
|
|
7
|
+
const path = join(lib, file);
|
|
8
|
+
return { path, exists: existsSync(path) };
|
|
9
|
+
};
|
|
10
|
+
/** The CPU raster, compiled for x86-64-v3 (AVX2): byte-identical to the WebAssembly raster. */
|
|
11
|
+
export const nativeRaster = () => libraryAt("libtongue_raster.so");
|
|
12
|
+
/** The GPU raster (headless EGL + GLES 3.1): within a few levels of the CPU raster. */
|
|
13
|
+
export const gpuRaster = () => libraryAt("libtongue_gpu_raster.so");
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongue-core/raster-linux-x64",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"description": "Prebuilt native (x86-64-v3) and GPU (EGL + GLES 3.1) rasterizers for Tongue on Linux x64.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"author": "Backpine",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/backpine/tongue-core.git",
|
|
11
|
+
"directory": "packages/raster-linux-x64"
|
|
12
|
+
},
|
|
13
|
+
"engines": {
|
|
14
|
+
"bun": ">=1.3.0"
|
|
15
|
+
},
|
|
16
|
+
"os": [
|
|
17
|
+
"linux"
|
|
18
|
+
],
|
|
19
|
+
"cpu": [
|
|
20
|
+
"x64"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"lib",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
}
|
|
39
|
+
}
|