2c76a4cb41
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
53 lines
840 B
Nix
53 lines
840 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, cmake
|
|
, setuptools-scm
|
|
, numpy
|
|
, pillow
|
|
, pybind11
|
|
, libzxing-cpp
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "zxing-cpp";
|
|
inherit (libzxing-cpp) src version meta;
|
|
pyproject = true;
|
|
|
|
sourceRoot = "${src.name}/wrappers/python";
|
|
|
|
# we don't need pybind11 in the root environment
|
|
# https://pybind11.readthedocs.io/en/stable/installing.html#include-with-pypi
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace "pybind11[global]" "pybind11"
|
|
'';
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
propagatedBuildInputs = [
|
|
numpy
|
|
];
|
|
|
|
buildInputs = [
|
|
pybind11
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
setuptools-scm
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pillow
|
|
pytestCheckHook
|
|
];
|
|
|
|
pytestFlagsArray = [
|
|
"test.py"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"zxingcpp"
|
|
];
|
|
}
|