jadb/nix/jmdict.nix

45 lines
855 B
Nix

{
stdenvNoCC,
jmdict-src,
jmdict-with-examples-src,
xmlformat,
gzip,
edrdgMetadata,
}:
stdenvNoCC.mkDerivation {
name = "jmdict";
srcs = [
jmdict-src
jmdict-with-examples-src
];
dontUnpack = true;
nativeBuildInputs = [
gzip
xmlformat
];
buildPhase = ''
runHook preBuild
gzip -dkc ${jmdict-src} > JMdict.xml
gzip -dkc ${jmdict-with-examples-src} > JMdict_with_examples.xml
xmlformat -i JMdict.xml
xmlformat -i JMdict_with_examples.xml
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dt $out JMdict.xml JMdict_with_examples.xml
runHook postInstall
'';
meta = edrdgMetadata // {
description = "A Japanese-Multilingual Dictionary providing lexical data for japanese words";
homepage = "https://www.edrdg.org/jmdict/j_jmdict.html";
};
}