nixpkgs/pkgs/applications/misc/ydict/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
888 B
Nix
Raw Normal View History

2023-01-13 06:59:46 +00:00
{ lib
, fetchFromGitHub
, buildGoModule
, makeWrapper
, mpg123
}:
2022-04-15 09:51:58 +00:00
buildGoModule rec {
pname = "ydict";
2023-11-02 13:37:25 +00:00
version = "2.2.2";
2022-04-15 09:51:58 +00:00
src = fetchFromGitHub {
owner = "TimothyYe";
repo = "ydict";
rev = "v${version}";
2023-11-02 13:37:25 +00:00
sha256 = "sha256-FcrkfWE1m5OveK4YPgVmUbL/jkh2NEs9bfeCHm2H9P8=";
2022-04-15 09:51:58 +00:00
};
vendorHash = "sha256-c5nQVQd4n978kFAAKcx5mX2Jz16ZOhS8iL/oxS1o5xs=";
2022-04-15 09:51:58 +00:00
2023-01-13 06:59:46 +00:00
ldflags = [
"-s"
"-w"
"-X=main.Version=${version}"
];
nativeBuildInputs = [ makeWrapper ];
preFixup = ''
wrapProgram $out/bin/${pname} \
--prefix PATH ":" "${lib.makeBinPath [ mpg123 ]}";
'';
2022-04-15 09:51:58 +00:00
# has no tests
doCheck = false;
meta = with lib; {
2023-01-13 06:59:46 +00:00
description = "Yet another command-line Youdao Chinese dictionary";
mainProgram = "ydict";
2022-04-15 09:51:58 +00:00
homepage = "https://github.com/TimothyYe/ydict";
license = licenses.mit;
maintainers = with maintainers; [ zendo ];
};
}