about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/bpycv/default.nix
blob: a6d385e97781781ae9421425ba49e8fae28588f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{ stdenv
, lib
, beautifulsoup4
, blender
, blender-with-packages
, boxx
, bpycv
, buildPythonPackage
, fetchFromGitHub
, fetchPypi
, fetchurl
, minexr
, opencv3
, python3Packages
, requests
, runCommand
, writeText
, zcs
}:

buildPythonPackage rec {
  pname = "bpycv";
  version = "0.4.0";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-qqNGemDB0aagCXjrECuh6kLksf+KujPejpnXVqFG8GY=";
  };

  propagatedBuildInputs = [
    beautifulsoup4
    minexr
    zcs
    requests
    opencv3
    boxx
  ];

  postPatch = ''
    sed -i 's/opencv-python//g' requirements.txt
  '';

  # pythonImportsCheck = [ "bpycv" ]; # this import depends on bpy that is only available inside blender
  doCheck = false;

  passthru.tests = {
    render = runCommand "bpycv-render-test" {
      BPY_EXAMPLE_DATA = fetchFromGitHub {
        owner = "DIYer22";
        repo = "bpycv_example_data";
        hash = "sha256-dGb6KvbXTGTu5f4AqhA+i4AwTqBoR5SdXk0vsMEcD3Q=";
        rev = "6ce0e65c107d572011394da16ffdf851e988dbb4";
      };
      nativeBuildInputs = [
        ((blender-with-packages.override {inherit blender python3Packages;}) {
          packages = [ bpycv ];
        })
      ];
    } ''
      blender-wrapped -b -P ${./bpycv-test.py}
    '';
  };

  meta = with lib; {
    description = "Computer vision utils for Blender";
    homepage = "https://github.com/DIYer22/bpycv";
    license = licenses.mit;
    maintainers = [ maintainers.lucasew ];
    broken = stdenv.isAarch64;
    inherit (blender.meta) platforms;
  };
}