2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
beautifulsoup4,
|
|
|
|
blender,
|
|
|
|
boxx,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchPypi,
|
|
|
|
minexr,
|
|
|
|
opencv4,
|
|
|
|
requests,
|
|
|
|
runCommand,
|
|
|
|
zcs,
|
2022-01-13 20:06:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bpycv";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.4.0";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "setuptools";
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-qqNGemDB0aagCXjrECuh6kLksf+KujPejpnXVqFG8GY=";
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
beautifulsoup4
|
|
|
|
minexr
|
|
|
|
zcs
|
|
|
|
requests
|
2023-11-16 04:20:00 +00:00
|
|
|
opencv4
|
2022-01-13 20:06:32 +00:00
|
|
|
boxx
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i 's/opencv-python//g' requirements.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
# pythonImportsCheck = [ "bpycv" ]; # this import depends on bpy that is only available inside blender
|
2023-05-24 13:37:59 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = {
|
2024-06-05 15:53:02 +00:00
|
|
|
render =
|
|
|
|
runCommand "bpycv-render-test"
|
|
|
|
{
|
|
|
|
BPY_EXAMPLE_DATA = fetchFromGitHub {
|
|
|
|
owner = "DIYer22";
|
|
|
|
repo = "bpycv_example_data";
|
|
|
|
hash = "sha256-dGb6KvbXTGTu5f4AqhA+i4AwTqBoR5SdXk0vsMEcD3Q=";
|
|
|
|
rev = "6ce0e65c107d572011394da16ffdf851e988dbb4";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
''
|
|
|
|
${blender.withPackages (ps: [ ps.bpycv ])}/bin/blender-wrapped -b -P ${./bpycv-test.py}
|
|
|
|
'';
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Computer vision utils for Blender";
|
|
|
|
homepage = "https://github.com/DIYer22/bpycv";
|
|
|
|
license = licenses.mit;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = [ maintainers.lucasew ];
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isAarch64;
|
2023-05-24 13:37:59 +00:00
|
|
|
inherit (blender.meta) platforms;
|
2022-01-13 20:06:32 +00:00
|
|
|
};
|
|
|
|
}
|