diff --git a/pkgs/development/python-modules/lexilang/default.nix b/pkgs/development/python-modules/lexilang/default.nix index 6c9b34bfc66b..3d334db4e951 100644 --- a/pkgs/development/python-modules/lexilang/default.nix +++ b/pkgs/development/python-modules/lexilang/default.nix @@ -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 ]; }; -} +})