1{ stdenv
2, lib
3, beautifulsoup4
4, blender
5, boxx
6, bpycv
7, buildPythonPackage
8, fetchFromGitHub
9, fetchPypi
10, fetchurl
11, minexr
12, opencv4
13, python3Packages
14, requests
15, runCommand
16, writeText
17, zcs
18}:
19
20buildPythonPackage rec {
21 pname = "bpycv";
22 version = "0.4.0";
23 format = "setuptools";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-qqNGemDB0aagCXjrECuh6kLksf+KujPejpnXVqFG8GY=";
28 };
29
30 propagatedBuildInputs = [
31 beautifulsoup4
32 minexr
33 zcs
34 requests
35 opencv4
36 boxx
37 ];
38
39 postPatch = ''
40 sed -i 's/opencv-python//g' requirements.txt
41 '';
42
43 # pythonImportsCheck = [ "bpycv" ]; # this import depends on bpy that is only available inside blender
44 doCheck = false;
45
46 passthru.tests = {
47 render = runCommand "bpycv-render-test" {
48 BPY_EXAMPLE_DATA = fetchFromGitHub {
49 owner = "DIYer22";
50 repo = "bpycv_example_data";
51 hash = "sha256-dGb6KvbXTGTu5f4AqhA+i4AwTqBoR5SdXk0vsMEcD3Q=";
52 rev = "6ce0e65c107d572011394da16ffdf851e988dbb4";
53 };
54 } ''
55 ${blender.withPackages (ps: [ps.bpycv])}/bin/blender-wrapped -b -P ${./bpycv-test.py}
56 '';
57 };
58
59 meta = with lib; {
60 description = "Computer vision utils for Blender";
61 homepage = "https://github.com/DIYer22/bpycv";
62 license = licenses.mit;
63 maintainers = [ maintainers.lucasew ];
64 broken = stdenv.isAarch64;
65 inherit (blender.meta) platforms;
66 };
67}