libretranslate: fix build

This commit is contained in:
Martin Weinelt 2024-03-28 04:05:55 +01:00
parent 7b937aac12
commit 3e2b29d58a
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -1,7 +1,9 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, pythonRelaxDepsHook
, pytestCheckHook , pytestCheckHook
, hatchling
, argostranslate , argostranslate
, flask , flask
, flask-swagger , flask-swagger
@ -11,6 +13,8 @@
, flask-session , flask-session
, waitress , waitress
, expiringdict , expiringdict
, langdetect
, lexilang
, ltpycld2 , ltpycld2
, morfessor , morfessor
, appdirs , appdirs
@ -27,8 +31,7 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "libretranslate"; pname = "libretranslate";
version = "1.5.6"; version = "1.5.6";
pyproject = true;
format = "setuptools";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "LibreTranslate"; owner = "LibreTranslate";
@ -37,7 +40,14 @@ buildPythonPackage rec {
hash = "sha256-43VnxgtapMRKyXxqsvBgSMUxvpbLI+iOfW3FA0/POpE="; hash = "sha256-43VnxgtapMRKyXxqsvBgSMUxvpbLI+iOfW3FA0/POpE=";
}; };
propagatedBuildInputs = [ build-system = [
hatchling
pythonRelaxDepsHook
];
pythonRelaxDeps = true;
dependencies = [
argostranslate argostranslate
flask flask
flask-swagger flask-swagger
@ -47,6 +57,8 @@ buildPythonPackage rec {
flask-session flask-session
waitress waitress
expiringdict expiringdict
langdetect
lexilang
ltpycld2 ltpycld2
morfessor morfessor
appdirs appdirs
@ -59,14 +71,6 @@ buildPythonPackage rec {
polib polib
]; ];
postPatch = ''
substituteInPlace requirements.txt \
--replace "==" ">="
substituteInPlace setup.py \
--replace "'pytest-runner'" ""
'';
postInstall = '' postInstall = ''
# expose static files to be able to serve them via web-server # expose static files to be able to serve them via web-server
mkdir -p $out/share/libretranslate mkdir -p $out/share/libretranslate