From e051c40c92c401b7a2d38637b98a3efb574790f6 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:15:58 +0200 Subject: [PATCH] termusic: 0.7.8 -> 0.7.9 --- pkgs/applications/audio/termusic/default.nix | 33 +++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/audio/termusic/default.nix b/pkgs/applications/audio/termusic/default.nix index c26ffd7e64af..85d829f765eb 100644 --- a/pkgs/applications/audio/termusic/default.nix +++ b/pkgs/applications/audio/termusic/default.nix @@ -1,23 +1,42 @@ { lib , stdenv -, fetchCrate , rustPlatform +, fetchCrate +, fetchpatch , pkg-config -, alsa-lib }: +, alsa-lib +, darwin +}: rustPlatform.buildRustPackage rec { pname = "termusic"; - version = "0.7.8"; + version = "0.7.9"; src = fetchCrate { inherit pname version; - sha256 = "sha256-1RlG1/2+NuMO9zqFHQaEkEX1YrYYMjnaNprjdl1ZnHQ="; + hash = "sha256-ytAKINcZwLyHWbzShxfxRKx4BepM0G2BYdLgwR48g7w="; }; - cargoHash = "sha256-SYk2SiFbp40/6Z0aBoX4MPnPLHjEfsJKCW4cErm0D78="; + cargoHash = "sha256-yxFF5Yqj+xTB3FAJUtgcIeAEHR44JA1xONxGFdG0yS0="; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ alsa-lib ]; + patches = [ + (fetchpatch { + name = "fix-panic-when-XDG_AUDIO_DIR-not-set.patch"; + url = "https://github.com/tramhao/termusic/commit/b6006b22901f1f865a2e3acf7490fd3fa520ca5e.patch"; + hash = "sha256-1ukQ0y5IRdOndsryuqXI9/zyhCDQ5NIeTan4KCynAv0="; + }) + ]; + + nativeBuildInputs = [ + pkg-config + rustPlatform.bindgenHook + ]; + + buildInputs = lib.optionals stdenv.isLinux [ + alsa-lib + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.AudioUnit + ]; meta = with lib; { description = "Terminal Music Player TUI written in Rust";