Commit 3bd16814 authored by lucasew's avatar lucasew
Browse files

backgroundremover: fix build, remove with lib in meta



Signed-off-by: default avatarlucasew <lucas59356@gmail.com>
parent 6a3d4273
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -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