Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down