backgroundremover: fix build, remove with lib in meta

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew
2025-03-06 10:59:48 -03:00
parent 6a3d4273d8
commit 3bd16814b0
+13 -9
View File
@@ -14,6 +14,10 @@ let
version = "0.2.9";
pyproject = true;
build-system = [
p.setuptools
];
src = fetchFromGitHub {
owner = "nadermx";
repo = "backgroundremover";
@@ -29,21 +33,21 @@ let
'';
postPatch = ''
rm -rf *dist
substituteInPlace backgroundremover/bg.py backgroundremover/u2net/detect.py \
--replace-fail 'os.path.expanduser(os.path.join("~", ".u2net", model_name + ".pth"))' "os.path.join(\"$models\", model_name + \".pth\")"
'';
nativeBuildInputs = [
p.setuptools
p.wheel
];
substituteInPlace backgroundremover/bg.py \
--replace-fail 'import moviepy.editor' 'import moviepy'
'';
pythonRelaxDeps = [
"pillow"
"torchvision"
"moviepy"
];
propagatedBuildInputs = [
dependencies = [
p.certifi
p.charset-normalizer
p.ffmpeg-python
@@ -95,13 +99,13 @@ let
doCheck = false; # no tests
meta = with lib; {
meta = {
mainProgram = "backgroundremover";
description = "Command line tool to remove background from image and video, made by nadermx to power";
homepage = "https://BackgroundRemoverAI.com";
downloadPage = "https://github.com/nadermx/backgroundremover/releases";
license = licenses.mit;
maintainers = [ maintainers.lucasew ];
license = lib.licenses.mit;
maintainers = [ lib.maintainers.lucasew ];
};
};
in