public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/zxing-cpp/files/, media-libs/zxing-cpp/
@ 2020-04-09 21:37 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2020-04-09 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     f9d4418788a98c6acd9b904cb806767487d55776
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Apr  9 17:17:15 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Apr  9 21:36:22 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9d44187

media-libs/zxing-cpp: Fix pkgconfig version

Thanks-to: cyrillic <cyrilmaley <AT> hotmail.com>
Closes: https://bugs.gentoo.org/716818
Package-Manager: Portage-2.3.98, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../zxing-cpp/files/zxing-cpp-1.0.8-pkgconfig.patch     | 10 ++++++++++
 media-libs/zxing-cpp/zxing-cpp-1.0.8-r1.ebuild          | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/media-libs/zxing-cpp/files/zxing-cpp-1.0.8-pkgconfig.patch b/media-libs/zxing-cpp/files/zxing-cpp-1.0.8-pkgconfig.patch
new file mode 100644
index 00000000000..d1dda4f584e
--- /dev/null
+++ b/media-libs/zxing-cpp/files/zxing-cpp-1.0.8-pkgconfig.patch
@@ -0,0 +1,10 @@
+--- a/zxing.pc.in	2020-04-09 11:43:22.494219440 -0400
++++ b/zxing.pc.in	2020-04-09 11:49:03.884867034 -0400
+@@ -5,6 +5,6 @@
+ 
+ Name: ZXing
+ Description: ZXing library set
+-Version: @VERSION@
++Version: @PROJECT_VERSION@
+ Libs: -L${libdir} -l@TARGET_ZXING@ 
+ Cflags: -I${includedir} -I${includedir}/ZXing
\ No newline at end of file

diff --git a/media-libs/zxing-cpp/zxing-cpp-1.0.8-r1.ebuild b/media-libs/zxing-cpp/zxing-cpp-1.0.8-r1.ebuild
new file mode 100644
index 00000000000..4d6ad244fdd
--- /dev/null
+++ b/media-libs/zxing-cpp/zxing-cpp-1.0.8-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+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"
+KEYWORDS="amd64 arm64 x86"
+IUSE=""
+
+PATCHES=( "${FILESDIR}/${P}-pkgconfig.patch" ) # bug 716818


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/zxing-cpp/files/, media-libs/zxing-cpp/
@ 2023-01-10  0:04 Andreas Sturmlechner
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Sturmlechner @ 2023-01-10  0:04 UTC (permalink / raw
  To: gentoo-commits

commit:     8212399920e9b6d42c32e1fb87a8880435998db7
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  9 22:27:42 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Jan 10 00:04:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82123999

media-libs/zxing-cpp: add 2.0.0

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 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(+)

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 <levie.liu@gmail.com>
+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
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/zxing-cpp/files/, media-libs/zxing-cpp/
@ 2025-03-01  4:41 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2025-03-01  4:41 UTC (permalink / raw
  To: gentoo-commits

commit:     e8c4a9753d3aedf41b1b4112191951fbd0f1cdde
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Feb 28 19:01:55 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  1 04:40:29 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8c4a975

media-libs/zxing-cpp: reverse NDEBUG semantics

Otherwise debug files get generated in users home.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40820
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/zxing-cpp-2.3.0-reverse-NDEBUG.patch     | 88 ++++++++++++++++++++++
 ...-cpp-2.3.0.ebuild => zxing-cpp-2.3.0-r1.ebuild} |  4 +
 2 files changed, 92 insertions(+)

diff --git a/media-libs/zxing-cpp/files/zxing-cpp-2.3.0-reverse-NDEBUG.patch b/media-libs/zxing-cpp/files/zxing-cpp-2.3.0-reverse-NDEBUG.patch
new file mode 100644
index 000000000000..e9ffa0d041e1
--- /dev/null
+++ b/media-libs/zxing-cpp/files/zxing-cpp-2.3.0-reverse-NDEBUG.patch
@@ -0,0 +1,88 @@
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095196
+https://bugs.kde.org/show_bug.cgi?id=498240
+https://github.com/zxing-cpp/zxing-cpp/issues/900
+
+From 82806f5f92173b8cb4e1e9bee13a2d07a33fb69f Mon Sep 17 00:00:00 2001
+From: axxel <awagger@gmail.com>
+Date: Sun, 5 Jan 2025 23:41:29 +0100
+Subject: [PATCH] c++: fix improper use of NDEBUG
+
+Thanks to Antonio Rojas for pointing it out to me.
+--- a/core/src/HybridBinarizer.cpp
++++ b/core/src/HybridBinarizer.cpp
+@@ -143,7 +143,7 @@ static std::shared_ptr<BitMatrix> CalculateMatrix(const uint8_t* __restrict lumi
+ {
+ 	auto matrix = std::make_shared<BitMatrix>(width, height);
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 	Matrix<uint8_t> out(width, height);
+ 	Matrix<uint8_t> out2(width, height);
+ #endif
+@@ -163,7 +163,7 @@ static std::shared_ptr<BitMatrix> CalculateMatrix(const uint8_t* __restrict lumi
+ 			int average = sum / 25;
+ 			ThresholdBlock(luminances, xoffset, yoffset, average, rowStride, *matrix);
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 			for (int yy = 0; yy < 8; ++yy)
+ 				for (int xx = 0; xx < 8; ++xx) {
+ 					out.set(xoffset + xx, yoffset + yy, blackPoints(x, y));
+@@ -173,7 +173,7 @@ static std::shared_ptr<BitMatrix> CalculateMatrix(const uint8_t* __restrict lumi
+ 		}
+ 	}
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 	std::ofstream file("thresholds.pnm");
+ 	file << "P5\n" << out.width() << ' ' << out.height() << "\n255\n";
+ 	file.write(reinterpret_cast<const char*>(out.data()), out.size());
+@@ -260,7 +260,7 @@ static std::shared_ptr<BitMatrix> ThresholdImage(const ImageView iv, const Matri
+ {
+ 	auto matrix = std::make_shared<BitMatrix>(iv.width(), iv.height());
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 	Matrix<uint8_t> out(iv.width(), iv.height());
+ #endif
+ 
+@@ -270,7 +270,7 @@ static std::shared_ptr<BitMatrix> ThresholdImage(const ImageView iv, const Matri
+ 			int xoffset = std::min(x * BLOCK_SIZE, iv.width() - BLOCK_SIZE);
+ 			ThresholdBlock(iv.data(), xoffset, yoffset, thresholds(x, y), iv.rowStride(), *matrix);
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 			for (int yy = 0; yy < 8; ++yy)
+ 				for (int xx = 0; xx < 8; ++xx)
+ 					out.set(xoffset + xx, yoffset + yy, thresholds(x, y));
+@@ -278,7 +278,7 @@ static std::shared_ptr<BitMatrix> ThresholdImage(const ImageView iv, const Matri
+ 		}
+ 	}
+ 
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 	std::ofstream file("thresholds_new.pnm");
+ 	file << "P5\n" << out.width() << ' ' << out.height() << "\n255\n";
+ 	file.write(reinterpret_cast<const char*>(out.data()), out.size());
+--- a/core/src/oned/ODDataBarCommon.h
++++ b/core/src/oned/ODDataBarCommon.h
+@@ -37,7 +37,7 @@ inline bool IsFinder(int a, int b, int c, int d, int e)
+ //			 (c < 5 + 10 * e) &&
+ 			 (a < 2 + 4 * e) &&
+ 			 (4 * a > n);
+-#if !defined(NDEBUG) && 0
++#if defined(PRINT_DEBUG) && 0
+ 	printf("[");
+ 	for (bool v :
+ 		 {w + 5 > 9 * n,
+--- a/test/unit/datamatrix/DMEncodeDecodeTest.cpp
++++ b/test/unit/datamatrix/DMEncodeDecodeTest.cpp
+@@ -21,7 +21,7 @@ namespace {
+ 		ASSERT_EQ(matrix.empty(), false);
+ 
+ 		DecoderResult res = DataMatrix::Decode(matrix);
+-#ifndef NDEBUG
++#ifdef PRINT_DEBUG
+ 		if (!res.isValid() || data != res.text())
+ 			SaveAsPBM(matrix, "failed-datamatrix.pbm", 4);
+ #endif

diff --git a/media-libs/zxing-cpp/zxing-cpp-2.3.0.ebuild b/media-libs/zxing-cpp/zxing-cpp-2.3.0-r1.ebuild
similarity index 95%
rename from media-libs/zxing-cpp/zxing-cpp-2.3.0.ebuild
rename to media-libs/zxing-cpp/zxing-cpp-2.3.0-r1.ebuild
index 8ba734404437..01d12af67225 100644
--- a/media-libs/zxing-cpp/zxing-cpp-2.3.0.ebuild
+++ b/media-libs/zxing-cpp/zxing-cpp-2.3.0-r1.ebuild
@@ -35,6 +35,10 @@ DEPEND="
 	)
 "
 
+PATCHES=(
+	"${FILESDIR}"/zxing-cpp-2.3.0-reverse-NDEBUG.patch
+)
+
 src_prepare() {
 	if use test ; then
 		ln -s "${WORKDIR}"/test/samples "${S}"/test/samples || die


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-01  4:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-01  4:41 [gentoo-commits] repo/gentoo:master commit in: media-libs/zxing-cpp/files/, media-libs/zxing-cpp/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-01-10  0:04 Andreas Sturmlechner
2020-04-09 21:37 Andreas Sturmlechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox