From b15945b43c05deaf013aa088393d727684cac003 Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Thu, 11 Jul 2024 09:49:51 +0800 Subject: [PATCH] tplay: fix runtime ffprobe dependency --- pkgs/by-name/tp/tplay/package.nix | 37 ++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/tp/tplay/package.nix b/pkgs/by-name/tp/tplay/package.nix index 37bf1db7d198..39204176b534 100644 --- a/pkgs/by-name/tp/tplay/package.nix +++ b/pkgs/by-name/tp/tplay/package.nix @@ -1,13 +1,15 @@ -{ lib -, rustPlatform -, fetchFromGitHub -, pkg-config -, clang -, ffmpeg -, openssl -, alsa-lib -, libclang -, opencv +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + clang, + ffmpeg, + openssl, + alsa-lib, + libclang, + opencv, + makeWrapper, }: rustPlatform.buildRustPackage rec { pname = "tplay"; @@ -16,13 +18,13 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "maxcurzi"; repo = "tplay"; - rev = "v${version}"; + rev = "v${version}"; hash = "sha256-/3ui0VOxf+kYfb0JQXPVbjAyXPph2LOg2xB0DGmAbwc="; }; cargoHash = "sha256-zRkIEH37pvxHUbnfg25GW1Z7od9XMkRmP2Qvs64uUjg="; checkFlags = [ - # requires network access + # requires network access "--skip=pipeline::image_pipeline::tests::test_process" "--skip=pipeline::image_pipeline::tests::test_to_ascii" "--skip=pipeline::image_pipeline::tests::test_to_ascii_ext" @@ -34,6 +36,7 @@ rustPlatform.buildRustPackage rec { pkg-config clang ffmpeg + makeWrapper ]; buildInputs = [ @@ -44,11 +47,19 @@ rustPlatform.buildRustPackage rec { opencv ]; + postFixup = '' + wrapProgram $out/bin/tplay \ + --prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" + ''; + meta = { description = "Terminal Media Player"; homepage = "https://github.com/maxcurzi/tplay"; platforms = lib.platforms.linux; license = lib.licenses.mit; - maintainers = with lib.maintainers; [ demine colemickens ]; + maintainers = with lib.maintainers; [ + demine + colemickens + ]; }; }