1{
2 buildPythonPackage,
3 cmake,
4 setuptools-scm,
5 numpy,
6 pillow,
7 pybind11,
8 libzxing-cpp,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "zxing-cpp";
14 inherit (libzxing-cpp) src version meta;
15 pyproject = true;
16
17 sourceRoot = "${src.name}/wrappers/python";
18
19 # we don't need pybind11 in the root environment
20 # https://pybind11.readthedocs.io/en/stable/installing.html#include-with-pypi
21 postPatch = ''
22 substituteInPlace pyproject.toml \
23 --replace "pybind11[global]" "pybind11"
24 '';
25
26 dontUseCmakeConfigure = true;
27
28 propagatedBuildInputs = [ numpy ];
29
30 buildInputs = [ pybind11 ];
31
32 nativeBuildInputs = [
33 cmake
34 setuptools-scm
35 ];
36
37 nativeCheckInputs = [
38 pillow
39 pytestCheckHook
40 ];
41
42 pytestFlagsArray = [ "test.py" ];
43
44 pythonImportsCheck = [ "zxingcpp" ];
45}