From 2f56ed096bf69d26ceb1d0d19927971a52a90d26 Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Fri, 6 Sep 2024 00:22:13 +0100 Subject: [PATCH] bark: 2023-08-22 -> 0.6.0 --- pkgs/by-name/ba/bark/package.nix | 48 +++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/ba/bark/package.nix b/pkgs/by-name/ba/bark/package.nix index 37c675df1b35..ff30f59217d6 100644 --- a/pkgs/by-name/ba/bark/package.nix +++ b/pkgs/by-name/ba/bark/package.nix @@ -2,26 +2,54 @@ lib, rustPlatform, fetchFromGitHub, - pkg-config, + fetchpatch, alsa-lib, - speexdsp, + libopus, + soxr, + cmake, + pkg-config, + versionCheckHook, + nix-update-script, }: -rustPlatform.buildRustPackage { +rustPlatform.buildRustPackage (final: { pname = "bark"; - version = "unstable-2023-08-22"; + version = "0.6.0"; src = fetchFromGitHub { owner = "haileys"; repo = "bark"; - rev = "2586b9fb58b496f8ef06f516c9cd3aace77521f7"; - hash = "sha256-sGroae6uJhB9UIpFmvt520Zs9k0ir7H8pGkhKJmVWek="; + tag = "v${final.version}"; + hash = "sha256-JaUIWGCYhasM0DgqL+DiG2rE1OWVg/N66my/4RWDN1E="; }; + useFetchCargoVendor = true; - cargoHash = "sha256-OjlVn4fvKPm3UfqhKkv7cDuvK4mcLcQXPNPK+WScrMc="; + cargoHash = "sha256-LcmX8LbK8UHDDeqwLTFEUuRBv9GgDiCpXP4bmIR3gME="; + + # Broken rustdoc comment + patches = [ + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/haileys/bark/pull/13.patch"; + hash = "sha256-cA1bqc7XhJ2cxOYvjIJ9oopzBZ9I4rGERkiwDAUh3V4"; + }) + ]; + buildInputs = [ alsa-lib - speexdsp + libopus + soxr ]; - nativeBuildInputs = [ pkg-config ]; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; meta = { description = "Live sync audio streaming for local networks"; @@ -31,4 +59,4 @@ rustPlatform.buildRustPackage { platforms = lib.platforms.linux; mainProgram = "bark"; }; -} +})