cliamp: fix darwin build

Darwin wasn't building due to the length of the socket paths being
allowed (104 bytes). This makes a new TMPDIR which is shorter and the
build succeeds now.

Also, I added the platforms tag which reflects the two platforms I have
tested cliamp for. Maybe changing it to unix would also be okay, but I
haven't tested it.
This commit is contained in:
Mirza Arnaut
2026-07-11 18:25:24 +02:00
parent dd7bc1fcd2
commit 64387acfe4
+6
View File
@@ -41,6 +41,11 @@ buildGoModule (finalAttrs: {
alsa-lib
];
# macOS limits Unix socket paths to 104 bytes; use a shorter TMPDIR.
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
export TMPDIR="$(mktemp -d /tmp/cliamp-XXXXXX)"
'';
postInstall = ''
wrapProgram $out/bin/cliamp \
--prefix PATH : ${
@@ -60,6 +65,7 @@ buildGoModule (finalAttrs: {
description = "Terminal Winamp - a retro terminal music player inspired by Winamp 2.x";
homepage = "https://github.com/bjarneo/cliamp";
license = lib.licenses.mit;
platforms = with lib.platforms; darwin ++ linux;
maintainers = with lib.maintainers; [ supermarin ];
mainProgram = "cliamp";
};