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