From 8212399920e9b6d42c32e1fb87a8880435998db7 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 9 Jan 2023 23:27:42 +0100 Subject: media-libs/zxing-cpp: add 2.0.0 Signed-off-by: Andreas Sturmlechner --- media-libs/zxing-cpp/Manifest | 1 + .../files/zxing-cpp-2.0.0-fix-crash.patch | 24 ++++++++++++++++++++ media-libs/zxing-cpp/zxing-cpp-2.0.0.ebuild | 26 ++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch create mode 100644 media-libs/zxing-cpp/zxing-cpp-2.0.0.ebuild diff --git a/media-libs/zxing-cpp/Manifest b/media-libs/zxing-cpp/Manifest index 8a7287886422..663d55874d73 100644 --- a/media-libs/zxing-cpp/Manifest +++ b/media-libs/zxing-cpp/Manifest @@ -1,2 +1,3 @@ DIST zxing-cpp-1.3.0.tar.gz 97938087 BLAKE2B f0c9c906ab2b534c67cf66605eca0ecc22a90fc9d69e23397bcb0bc8eaf3d68a7ad41631ea6d9c7f292ee03165d2e038d84f497307384205e2d6f37fef5dddba SHA512 27821667dea3d09b91bf9825ff25483ed658d850fd238009f1c7e43b1b09e62d24b3a2cd78d4e39d29725931b32bfce3e21e7ec871830b3ad69a5a69c72d8de8 DIST zxing-cpp-1.4.0.tar.gz 1018225 BLAKE2B 98b6badfe0ddfa39650eb4fbfc02bc01f5237cdd5edfafd7b88067997a22caa2e64d067328b534c439d7d89fef5b6d48acf4bc29389142b332123b477f3e3dde SHA512 05c5b9282f13b76fa0897b21e5b73cb7df0c52e62f1a2d9760fe774aa0378fde97f5f9896690b65b28b4b96ba6ad2703bed53ffaf9d3784636d29cbe860d4bad +DIST zxing-cpp-2.0.0.tar.gz 856413 BLAKE2B 8069d3e39a7ddf99510777df477a5e3503e5eead7adcbf175123ab59de47c3da75bb8187533dad552a07b1475756ff3981d30eaa3e8088c5c9b991e22a7127bd SHA512 fa22164f834a42194eafd0d3e9c09d953233c69843ac6e79c8d6513314be28d8082382b436c379368e687e0eed05cb5e566d2893ec6eb29233a36643904ae083 diff --git a/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch b/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch new file mode 100644 index 000000000000..e6b25633e8e9 --- /dev/null +++ b/media-libs/zxing-cpp/files/zxing-cpp-2.0.0-fix-crash.patch @@ -0,0 +1,24 @@ +From 23c19c5f98602a4d69d1667fff99678308b28b5b Mon Sep 17 00:00:00 2001 +From: liule +Date: Fri, 6 Jan 2023 22:06:24 +0800 +Subject: [PATCH] fix crash when the source image is less than 3 pixels + width/height + +--- + core/src/ReadBarcode.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/core/src/ReadBarcode.cpp b/core/src/ReadBarcode.cpp +index 905dd191c..5ac61e250 100644 +--- a/core/src/ReadBarcode.cpp ++++ b/core/src/ReadBarcode.cpp +@@ -76,7 +76,8 @@ class LumImagePyramid + + layers.push_back(iv); + // TODO: if only matrix codes were considered, then using std::min would be sufficient (see #425) +- while (threshold > 0 && std::max(layers.back().width(), layers.back().height()) > threshold) ++ while (threshold > 0 && std::max(layers.back().width(), layers.back().height()) > threshold && ++ std::min(layers.back().width(), layers.back().height()) >= N) + addLayer(); + #if 0 + // Reversing the layers means we'd start with the smallest. that can make sense if we are only looking for a diff --git a/media-libs/zxing-cpp/zxing-cpp-2.0.0.ebuild b/media-libs/zxing-cpp/zxing-cpp-2.0.0.ebuild new file mode 100644 index 000000000000..6da2db080577 --- /dev/null +++ b/media-libs/zxing-cpp/zxing-cpp-2.0.0.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="C++ Multi-format 1D/2D barcode image processing library" +HOMEPAGE="https://github.com/nu-book/zxing-cpp" +SRC_URI="https://github.com/nu-book/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0/3" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86" +IUSE="" + +PATCHES=( "${FILESDIR}/${P}-fix-crash.patch" ) + +src_configure() { + local mycmakeargs=( + -DBUILD_EXAMPLES=OFF # nothing is installed + -DBUILD_BLACKBOX_TESTS=OFF # FIXME: FetchContent.cmake module usage + -DBUILD_UNIT_TESTS=OFF # for both tests options. no thanks. bug #793173 + ) + cmake_src_configure +} -- cgit v1.2.3-65-gdbad