python3.pkgs.zxing_cpp: init at 1.4.0

This commit is contained in:
Luke Granger-Brown 2022-11-30 13:02:57 +00:00
parent 5b6e95b131
commit 8647d1d515
4 changed files with 70 additions and 0 deletions

View file

@ -3,6 +3,7 @@
, fetchFromGitHub
, pkg-config
, cmake
, python3
}:
stdenv.mkDerivation rec {
@ -37,6 +38,10 @@ stdenv.mkDerivation rec {
--replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
'';
passthru.tests = {
inherit (python3.pkgs) zxing_cpp;
};
meta = with lib; {
homepage = "https://github.com/nu-book/zxing-cpp";
description = "C++ port of zxing (a Java barcode image processing library)";

View file

@ -0,0 +1,49 @@
{ buildPythonPackage
, lib
, cmake
, pybind11
, zxing-cpp
, numpy
, pillow
}:
buildPythonPackage rec {
pname = "zxing_cpp";
inherit (zxing-cpp) src version;
sourceRoot = "source/wrappers/python";
patches = [
./use-nixpkgs-pybind11.patch
];
dontUseCmakeConfigure = true;
propagatedBuildInputs = [
pybind11
numpy
];
nativeBuildInputs = [
cmake
];
checkInputs = [
pillow
];
meta = with lib; {
homepage = "https://github.com/zxing-cpp/zxing-cpp";
description = "Python bindings for C++ port of zxing (a Java barcode image processing library)";
longDescription = ''
ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
image processing library implemented in C++.
It was originally ported from the Java ZXing Library but has been
developed further and now includes many improvements in terms of quality
and performance. It can both read and write barcodes in a number of
formats.
'';
license = licenses.asl20;
maintainers = with maintainers; [ lukegb ];
platforms = with platforms; unix;
};
}

View file

@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eadfc045..b6f273a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,8 +20,7 @@ if (NOT hasParent)
# In development mode, when the whole zxing-cpp directory is checked out, build against head code.
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../core ZXing EXCLUDE_FROM_ALL)
- include(${CMAKE_CURRENT_SOURCE_DIR}/../../zxing.cmake)
- zxing_add_package(pybind11 pybind11 ${pybind11_git_repo} ${pybind11_git_rev})
+ find_package(pybind11 CONFIG)
else()
# we don't have access to the top-level cmake helpers -> simply fetch it unconditional
include(FetchContent)

View file

@ -12396,4 +12396,6 @@ self: super: with self; {
zwave-js-server-python = callPackage ../development/python-modules/zwave-js-server-python { };
zxcvbn = callPackage ../development/python-modules/zxcvbn { };
zxing_cpp = callPackage ../development/python-modules/zxing_cpp { };
}