1{ lib
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 = [
29 numpy
30 ];
31
32 buildInputs = [
33 pybind11
34 ];
35
36 nativeBuildInputs = [
37 cmake
38 setuptools-scm
39 ];
40
41 nativeCheckInputs = [
42 pillow
43 pytestCheckHook
44 ];
45
46 pytestFlagsArray = [
47 "test.py"
48 ];
49
50 pythonImportsCheck = [
51 "zxingcpp"
52 ];
53}