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";
|
2022-06-08 11:33:04 +00:00
|
|
|
version = "2.2.1";
|
2022-04-15 09:51:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TimothyYe";
|
|
|
|
repo = "ydict";
|
|
|
|
rev = "v${version}";
|
2022-06-08 11:33:04 +00:00
|
|
|
sha256 = "sha256-qrGOrqI+PXsDNCmgcCPDNn6qUYu2emhYSkYsz4sj27M=";
|
2022-04-15 09:51:58 +00:00
|
|
|
};
|
|
|
|
|
2023-09-13 04:44:46 +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";
|
2022-04-15 09:51:58 +00:00
|
|
|
homepage = "https://github.com/TimothyYe/ydict";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zendo ];
|
|
|
|
};
|
|
|
|
}
|