Skip to content

Commit

Permalink
add arm64 venmic binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Oct 26, 2023
1 parent 886d02f commit b17370c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"arrpc": "github:OpenAsar/arrpc#89f4da610ccfac93f461826a446a17cd3b23953d"
},
"optionalDependencies": {
"@vencord/venmic": "^1.4.0"
"@vencord/venmic": "^1.6.0"
},
"devDependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
Expand Down
21 changes: 11 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions scripts/build/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,23 @@ async function createContext(options: BuildOptions) {
contexts.push(await context(options));
}

await Promise.all([
process.platform === "linux" &&
async function copyVenmic() {
if (process.platform !== "linux") return;

return Promise.all([
copyFile(
"./node_modules/@vencord/venmic/prebuilds/venmic-addon-linux-x64/node-napi-v7.node",
"./static/dist/venmic.node"
).catch(() => console.warn("Failed to copy venmic. Building without venmic support")),
"./static/dist/venmic-x64.node"
),
copyFile(
"./node_modules/@vencord/venmic/prebuilds/venmic-addon-linux-arm64/node-napi-v7.node",
"./static/dist/venmic-arm64.node"
)
]).catch(() => console.warn("Failed to copy venmic. Building without venmic support"));
}

await Promise.all([
copyVenmic(),
createContext({
...NodeCommonOpts,
entryPoints: ["src/main/index.ts"],
Expand Down
4 changes: 3 additions & 1 deletion src/main/virtmic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ function obtainVenmic() {
if (!initialized) {
initialized = true;
try {
const { PatchBay } = require(join(STATIC_DIR, "dist/venmic.node")) as typeof import("@vencord/venmic");
const { PatchBay } = require(
join(STATIC_DIR, `dist/venmic-${process.arch}.node`)
) as typeof import("@vencord/venmic");
patchBay = new PatchBay();
} catch (e: any) {
console.error("Failed to initialise venmic. Make sure you're using pipewire", e);
Expand Down

0 comments on commit b17370c

Please sign in to comment.