2022-01-13 20:06:32 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, writeText
|
|
|
|
, blender
|
|
|
|
, minexr
|
|
|
|
, beautifulsoup4
|
|
|
|
, zcs
|
|
|
|
, requests
|
|
|
|
, opencv3
|
|
|
|
, boxx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bpycv";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "0.3.6";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-08 16:32:21 +00:00
|
|
|
sha256 = "sha256-4N4rCVhbfJx7H7jS88QR3EcRupISIhnLuZ+cgfwIzg4=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ blender ];
|
2022-01-13 20:06:32 +00:00
|
|
|
checkPhase = let
|
|
|
|
bpycv_example_data = fetchFromGitHub {
|
|
|
|
owner = "DIYer22";
|
|
|
|
repo = "bpycv_example_data";
|
|
|
|
sha256 = "sha256-dGb6KvbXTGTu5f4AqhA+i4AwTqBoR5SdXk0vsMEcD3Q=";
|
|
|
|
rev = "6ce0e65c107d572011394da16ffdf851e988dbb4";
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
pushd $TEMPDIR
|
|
|
|
cp -r ${bpycv_example_data} example_data
|
|
|
|
chmod +w -R example_data
|
|
|
|
BPY_EXAMPLE_DATA=${bpycv_example_data} blender -b -P ${./bpycv-test.py}
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Computer vision utils for Blender";
|
|
|
|
homepage = "https://github.com/DIYer22/bpycv";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ lucasew ];
|
|
|
|
};
|
|
|
|
}
|