From 2ce5fca4ad0672efdc136bf0fdb4abc27fdb72bd Mon Sep 17 00:00:00 2001 From: zendo Date: Fri, 13 Jan 2023 14:59:46 +0800 Subject: [PATCH] ydict: add mpg123 to PATH --- pkgs/applications/misc/ydict/default.nix | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/ydict/default.nix b/pkgs/applications/misc/ydict/default.nix index 9440c2368100..078d6abccf50 100644 --- a/pkgs/applications/misc/ydict/default.nix +++ b/pkgs/applications/misc/ydict/default.nix @@ -1,4 +1,9 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib +, fetchFromGitHub +, buildGoModule +, makeWrapper +, mpg123 +}: buildGoModule rec { pname = "ydict"; @@ -13,16 +18,26 @@ buildGoModule rec { vendorSha256 = "sha256-c5nQVQd4n978kFAAKcx5mX2Jz16ZOhS8iL/oxS1o5xs="; - ldflags = [ "-s" "-w" "-X=main.Version=${version}" ]; + ldflags = [ + "-s" + "-w" + "-X=main.Version=${version}" + ]; + + nativeBuildInputs = [ makeWrapper ]; + + preFixup = '' + wrapProgram $out/bin/${pname} \ + --prefix PATH ":" "${lib.makeBinPath [ mpg123 ]}"; + ''; # has no tests doCheck = false; meta = with lib; { - description = "A command-line Chinese dictionary"; + description = "Yet another command-line Youdao Chinese dictionary"; homepage = "https://github.com/TimothyYe/ydict"; license = licenses.mit; - platforms = platforms.linux; maintainers = with maintainers; [ zendo ]; }; }