python3Packages.lexilang: compile and install dictionaries (#498058)

This commit is contained in:
misuzu
2026-03-10 13:21:34 +00:00
committed by GitHub
@@ -6,7 +6,7 @@
python,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "lexilang";
version = "1.0.7";
pyproject = true;
@@ -14,12 +14,20 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "LibreTranslate";
repo = "LexiLang";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-5/P9u2naTTyG5l3uhrinRIAekyOYn8OKLwb/VEON2Vc=";
};
build-system = [ setuptools ];
# Upstream builds in CI:
# https://github.com/LibreTranslate/LexiLang/blob/ba49108a736b9c077ea45cbe61d54fa635fe25d5/.github/workflows/publish.yml#L30-L31
postInstall = ''
${lib.getExe python} -c "from lexilang.utils import compile_data; compile_data()"
rm -f lexilang/data/.gitignore
cp -r lexilang/data $out/${python.sitePackages}/lexilang/data
'';
pythonImportsCheck = [ "lexilang" ];
checkPhase = ''
@@ -34,4 +42,4 @@ buildPythonPackage rec {
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ izorkin ];
};
}
})