From 3e2b29d58a3d69927fdca31c3c754bbcdf7b4664 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 28 Mar 2024 04:05:55 +0100 Subject: [PATCH] libretranslate: fix build --- .../python-modules/libretranslate/default.nix | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/libretranslate/default.nix b/pkgs/development/python-modules/libretranslate/default.nix index 8afdbf97e184..042fd5d404d1 100644 --- a/pkgs/development/python-modules/libretranslate/default.nix +++ b/pkgs/development/python-modules/libretranslate/default.nix @@ -1,7 +1,9 @@ { lib , buildPythonPackage , fetchFromGitHub +, pythonRelaxDepsHook , pytestCheckHook +, hatchling , argostranslate , flask , flask-swagger @@ -11,6 +13,8 @@ , flask-session , waitress , expiringdict +, langdetect +, lexilang , ltpycld2 , morfessor , appdirs @@ -27,8 +31,7 @@ buildPythonPackage rec { pname = "libretranslate"; version = "1.5.6"; - - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { owner = "LibreTranslate"; @@ -37,7 +40,14 @@ buildPythonPackage rec { hash = "sha256-43VnxgtapMRKyXxqsvBgSMUxvpbLI+iOfW3FA0/POpE="; }; - propagatedBuildInputs = [ + build-system = [ + hatchling + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = true; + + dependencies = [ argostranslate flask flask-swagger @@ -47,6 +57,8 @@ buildPythonPackage rec { flask-session waitress expiringdict + langdetect + lexilang ltpycld2 morfessor appdirs @@ -59,14 +71,6 @@ buildPythonPackage rec { polib ]; - postPatch = '' - substituteInPlace requirements.txt \ - --replace "==" ">=" - - substituteInPlace setup.py \ - --replace "'pytest-runner'" "" - ''; - postInstall = '' # expose static files to be able to serve them via web-server mkdir -p $out/share/libretranslate