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