tau-radio: init at 0.2.3

This commit is contained in:
eljamm
2026-06-16 10:21:04 +02:00
parent 84588fd5b8
commit 6288ce86f4
+71
View File
@@ -0,0 +1,71 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
pkg-config,
alsa-lib,
jack2,
libogg,
libopus,
libopusenc,
libshout,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "tau-radio";
version = "0.2.3";
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "tau-org";
repo = "tau-radio";
tag = "v${finalAttrs.version}";
hash = "sha256-1SKlZ+htlCsO7ClZDbFbKyw8v9zgV5pKDEtL57D49f8=";
};
cargoHash = "sha256-X1uHKYgt9ddvr/cBDW9HaHawG5uv2sU416jyL/XTPF4=";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
libogg
libopus
libopusenc
libshout
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
jack2
];
# fatal error: 'opus.h' file not found
env.NIX_CFLAGS_COMPILE = "-I${libopus.dev}/include/opus";
postPatch = ''
# The opusenc crate hardcodes `*const i8`, but bindgen generates `*const c_char`,
# which is `u8` on `aarch64-linux`, causing a type mismatch on that platform
substituteInPlace $cargoDepsCopy/*/opusenc-*/src/comments.rs \
--replace-fail \
"picture.as_ptr() as *const i8," \
"picture.as_ptr() as *const std::ffi::c_char,"
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Web radio - Hijacks audio device using CLAP and Ogg/Opus";
homepage = "https://github.com/tau-org/tau-radio";
mainProgram = "tau-radio";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [ eljamm ];
teams = with lib.teams; [ ngi ];
};
})