From 3a45f3c5fa19f7a44e8bfd0728d6bad61255d3a8 Mon Sep 17 00:00:00 2001 From: Filipe Forattini Date: Tue, 22 Sep 2026 12:53:50 -0300 Subject: [PATCH] fix: detect installed ALSA runtime library --- src/manifest.test.ts | 15 +++++++++++++++ src/manifest.ts | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/src/manifest.test.ts b/src/manifest.test.ts index 7ef6d20..2a7d9e6 100644 --- a/src/manifest.test.ts +++ b/src/manifest.test.ts @@ -156,6 +156,21 @@ describe("the manifest itself", () => { expect(installState(missing!)).toBe("absent"); }); + test("libasound2 is detected through its multiarch shared library", () => { + // libasound2t64 installs no command called `libasound2`. Without an + // explicit file probe, doctor reports a missing package immediately + // after apt successfully installed it. + const tool = TOOLS.find((candidate) => candidate.name === "libasound2"); + expect(tool?.file).toEndWith("-linux-gnu/libasound.so.2"); + expect(tool?.cmd).toBeUndefined(); + + const seen = { ...tool!, file: import.meta.path } as typeof tool; + expect(installState(seen!)).toBe("ok"); + + const missing = { ...tool!, file: "/nonexistent/libasound.so.2" } as typeof tool; + expect(installState(missing!)).toBe("absent"); + }); + test("what init.sh sources, the manifest installs", () => { // The gap this closes: init.sh sourced bash_completion from the // first version and nothing ever declared the package. On a desktop diff --git a/src/manifest.ts b/src/manifest.ts index 1787f88..7d14056 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -1005,6 +1005,14 @@ export const TOOLS: Tool[] = [ name: "libasound2", about: "the ALSA library dit links against", scope: "desktop", + // This package exposes a shared library, not a command named + // `libasound2`. Probing PATH therefore reports it missing even after apt + // installed it successfully. Ubuntu uses its Debian multiarch directory + // for the runtime library on both architectures red-dev supports. + file: + process.arch === "arm64" + ? "/usr/lib/aarch64-linux-gnu/libasound.so.2" + : "/usr/lib/x86_64-linux-gnu/libasound.so.2", u24: apt("libasound2t64"), win: skip(NO_GUI), },