pup-recorder 0.1.2 → 0.1.4
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/build_rust.ts +28 -19
- package/dist/cjs/app.cjs +11 -11
- package/dist/cjs/cli.cjs +2 -2
- package/dist/cjs/index.cjs +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/rust/darwin-arm64.node +0 -0
- package/rust/darwin-x64.node +0 -0
- package/rust/linux-arm64.node +0 -0
- package/rust/linux-x64.node +0 -0
- package/rust/win32-arm64.node +0 -0
- package/rust/win32-x64.node +0 -0
- package/rust-toolchain.toml +10 -0
- package/src/app.ts +8 -16
- package/src/base/electron.ts +10 -11
- package/src/base/ffmpeg.ts +4 -2
- package/src/base/hwaccel.ts +32 -5
- package/src/base/limiter.ts +21 -18
- package/src/base/network.ts +126 -0
- package/src/base/waitable_event.ts +34 -0
- package/src/base/window.ts +12 -32
- package/src/common.ts +2 -2
- package/src/rust/lib.ts +2 -3
- package/x265/darwin-arm64 +0 -0
- package/x265/darwin-x64 +0 -0
- package/x265/linux-arm64 +0 -0
- package/x265/linux-x64 +0 -0
- package/x265/win32-arm64.exe +0 -0
- package/x265/win32-x64.exe +0 -0
- package/src/base/proxy.ts +0 -42
package/build_rust.ts
CHANGED
|
@@ -13,12 +13,23 @@ function getTriple(platform: string, arch: string) {
|
|
|
13
13
|
if (arch === "x64") return "x86_64-unknown-linux-gnu";
|
|
14
14
|
if (arch === "arm64") return "aarch64-unknown-linux-gnu";
|
|
15
15
|
}
|
|
16
|
+
if (platform === "win32") {
|
|
17
|
+
if (arch === "x64") return "x86_64-pc-windows-msvc";
|
|
18
|
+
if (arch === "arm64") return "aarch64-pc-windows-msvc";
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getArtifactName(platform: string) {
|
|
24
|
+
if (platform === "darwin") return "libnative.dylib";
|
|
25
|
+
if (platform === "linux") return "libnative.so";
|
|
26
|
+
if (platform === "win32") return "native.dll";
|
|
16
27
|
return null;
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
async function copyArtifact(platform: string, arch: string, dir: string) {
|
|
20
|
-
const
|
|
21
|
-
|
|
31
|
+
const libName = getArtifactName(platform);
|
|
32
|
+
if (!libName) return;
|
|
22
33
|
const src = join(dir, libName);
|
|
23
34
|
const destDir = join("rust");
|
|
24
35
|
const dest = join(destDir, `${platform}-${arch}.node`);
|
|
@@ -26,30 +37,28 @@ async function copyArtifact(platform: string, arch: string, dir: string) {
|
|
|
26
37
|
await copyFile(src, dest);
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
async function
|
|
40
|
+
async function cargoBuild(platform: string, arch: string) {
|
|
30
41
|
const triple = getTriple(platform, arch);
|
|
31
42
|
if (triple) {
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
if (platform === "win32") {
|
|
44
|
+
await $`cargo xwin build --release --quiet --target ${triple}`;
|
|
45
|
+
} else {
|
|
46
|
+
await $`cargo zigbuild --release --quiet --target ${triple}`;
|
|
47
|
+
}
|
|
34
48
|
await copyArtifact(platform, arch, `target/${triple}/release`);
|
|
35
49
|
}
|
|
36
50
|
}
|
|
37
51
|
|
|
52
|
+
const PLATFORMS = ["darwin", "linux", "win32"];
|
|
53
|
+
const ARCHS = ["x64", "arm64"];
|
|
54
|
+
|
|
38
55
|
async function buildRust() {
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
platforms
|
|
46
|
-
.map((platform) => {
|
|
47
|
-
return archs.map((arch) => {
|
|
48
|
-
return build(platform, arch);
|
|
49
|
-
});
|
|
50
|
-
})
|
|
51
|
-
.flat(),
|
|
52
|
-
);
|
|
56
|
+
await $`cargo install --quiet cargo-zigbuild cargo-xwin`;
|
|
57
|
+
for (const platform of PLATFORMS) {
|
|
58
|
+
for (const arch of ARCHS) {
|
|
59
|
+
await cargoBuild(platform, arch);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
buildRust();
|