Accepting request 1004900 from home:cgiboudeaux:branches:devel:libraries:c_c++

Revert to 1.2.0. Newer versions are pre-2.0 with ABI / API changes. It breaks libreoffice.
Add fmt 9 compatibility patch.

OBS-URL: https://build.opensuse.org/request/show/1004900
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/zxing-cpp?expand=0&rev=25
This commit is contained in:
Dirk Mueller 2022-09-20 07:29:23 +00:00 committed by Git OBS Bridge
parent 7c3b11b8bb
commit 9b799b60f4
7 changed files with 1745 additions and 54 deletions

View File

@ -0,0 +1,44 @@
From 6dc756175003658cafb9039185a5094b9c157ba6 Mon Sep 17 00:00:00 2001
From: axxel <awagger@gmail.com>
Date: Tue, 26 Jul 2022 22:42:00 +0200
Subject: [PATCH] test: update to libfmt v9.0.0
---
test/blackbox/BlackboxTestRunner.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/test/blackbox/BlackboxTestRunner.cpp b/test/blackbox/BlackboxTestRunner.cpp
index 0df58ba..b8afe14 100644
--- a/test/blackbox/BlackboxTestRunner.cpp
+++ b/test/blackbox/BlackboxTestRunner.cpp
@@ -158,8 +158,7 @@ static void doRunTests(
auto folderName = directory.stem();
if (Size(imgPaths) != totalTests)
- fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName, totalTests,
- imgPaths.size());
+ fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName.string(), totalTests, imgPaths.size());
for (auto& test : tests) {
fmt::print("{:20} @ {:3}, {:3}", folderName.string(), test.rotation, Size(imgPaths));
@@ -234,7 +233,7 @@ static void doRunStructuredAppendTest(
}
if (Size(imageGroups) != totalTests)
- fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName, totalTests,
+ fmt::print("TEST {} => Expected number of tests: {}, got: {} => FAILED\n", folderName.string(), totalTests,
imageGroups.size());
for (auto& test : tests) {
@@ -445,7 +444,7 @@ int runBlackBoxTests(const fs::path& testPathPrefix, const std::set<std::string>
{ 17, 20, 0 },
{ 19, 20, 180 },
});
-
+
runTests("upca-extension-1", "UPC-A", 6, {
{ 3, 6, 0 },
{ 4, 6, 180 },
--
2.37.3

1647
269.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
diff -Nur zxing-cpp-1.2.0/test/blackbox/CMakeLists.txt new/test/blackbox/CMakeLists.txt
--- zxing-cpp-1.2.0/test/blackbox/CMakeLists.txt 2021-05-28 12:47:09.000000000 +0200
+++ new/test/blackbox/CMakeLists.txt 2021-05-29 13:34:47.707152999 +0200
@@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.14)
-include(FetchContent)
-FetchContent_Declare (fmtlib
+find_package(fmt 7.1.2)
+if (NOT fmt_FOUND)
+ include(FetchContent)
+ FetchContent_Declare (fmtlib
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 7.1.2)
-FetchContent_MakeAvailable (fmtlib) # Adds fmt::fmt
+ FetchContent_MakeAvailable (fmtlib) # Adds fmt::fmt
+endif()
if (BUILD_READERS)
add_executable (ReaderTest

3
zxing-cpp-1.2.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:653d9e44195d86cf64a36af9ff3a1978ec5599df3882439fefa56e7064f55e8a
size 97942494

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:126767bb56f8a1f25ae84d233db2e9b9be50d71f5776092d0e170ca0f0ed1862
size 1018225

View File

@ -1,42 +1,8 @@
-------------------------------------------------------------------
Mon Sep 19 07:45:22 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
Tue Sep 20 07:10:22 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 1.4.0. Changes since 1.3.0:
* Reader support for Micro QRCode by @corbers
* Prepared switch from std::wstring based utf16 to std::string
based utf8 results, use new ZX_USE_UTF8 macro to transition
to the upcoming 2.0 API
* Much improved 'binary' data support via new Result::bytes() API
* New Result::contentType() API returning information about the
type of content (like text vs. binary, etc.)
* Better standards conformance with respect to ECI handling,
see Results::bytesECI()
* Support for proper ECI handling across structured append
symbols (see MergeStructuredAppendResults())
* New Result::error() API with improved error handling, see also
DecodeHints::returnErrors()
* Removed all internal header files from the installed set, so
only the ReadBarcode.h based APIs are supported from here on out
* Removed all sample images from the 'source' distribution zip/tar
archives (much reduced size)
* Python read_barcode returns None if no symbol was found (might
break existing code if not checked for None before)
* Lots of little bug fixes
* Smaller per process runtime memory
* clang-13 and gcc-13 compilation fixes
* Ported Qt example code to Qt6
* Experimental multi-symbol detection support for DataMatrix when
compiled with c++-20
* Fix error in multi-symbol detection of linear codes (sometimes
reported 1 symbol as 2)
* New -bytes and -errors options in ZXingReader
* Support tryRotate for PDF417 symbols
* Check https://github.com/zxing-cpp/zxing-cpp/releases for
older changes
- Drop SLE12 conditions. The cmake package is too old
- Drop patches:
* 269.patch
* cmake-check-system-first.patch
- Add fmt 9.0 compatibility patch (boo#1202273):
* 0001-test-update-to-libfmt-v9.0.0.patch
-------------------------------------------------------------------
Mon Dec 13 14:14:53 UTC 2021 - Danilo Spinella <danilo.spinella@suse.com>

View File

@ -16,14 +16,9 @@
#
# gmock is too old in 15.3 / 15.4
# TODO: Check which version will be in 15.5
%if 0%{?suse_version} > 1500
%bcond_without tests
%endif
%define sover 1
Name: zxing-cpp
Version: 1.4.0
Version: 1.2.0
Release: 0
Summary: Library for processing 1D and 2D barcodes
License: Apache-2.0 AND Zlib AND LGPL-2.1-with-Qt-Company-Qt-exception-1.1
@ -31,11 +26,25 @@ Group: Development/Languages/C and C++
URL: https://github.com/nu-book/zxing-cpp/
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source99: baselibs.conf
# PATCH-FIX-OPENSUSE cmake-check-system-first.patch -- Search system for needed libraries first
Patch0: cmake-check-system-first.patch
# PATCH-FIX-UPSTREAM 269.patch -- Update stb_image/stb_image_write
Patch1: 269.patch
# PATCH-FIX-UPSTREAM 0001-test-update-to-libfmt-v9.0.0.patch -- fmt 9 compatibility
Patch2: 0001-test-update-to-libfmt-v9.0.0.patch
BuildRequires: pkgconfig
BuildRequires: cmake >= 3.14
# Use cmake3 package on SLE12 because cmake is too old (version 3.5)
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
BuildRequires: cmake3-full >= 3.10
BuildRequires: gcc11-c++
%else
BuildRequires: cmake >= 3.10
BuildRequires: gcc-c++
%if %{with tests}
BuildRequires: cmake(GTest) >= 1.11
%endif
# only TW has fmt
%if 0%{?suse_version} > 1500
# For blackbox tests
BuildRequires: cmake(fmt) >= 7.1.2
%endif
%description
@ -67,12 +76,16 @@ other applications.
%autosetup -p1
%build
# Use g++-11 to build a C++17 codebase
# Examples require QT5-base/multimedia, but doing so creates a cycle
# Tests samples are no longer present in the released tarball. The blackbox test cannot pass
# Blackbox tests require fmt
%cmake \
-DBUILD_EXAMPLES=OFF \
%if %{with tests}
-DBUILD_UNIT_TESTS=ON
%if !0%{?is_opensuse} && 0%{?sle_version} < 150000
-DCMAKE_CXX_COMPILER=/usr/bin/g++-11 \
%endif
%if 0%{?suse_version} < 1550
-DBUILD_BLACKBOX_TESTS=OFF
%endif
%cmake_build
@ -81,9 +94,10 @@ other applications.
%cmake_install
%check
%if %{with tests}
%ctest
%if 0%{?sle_version}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%endif
%ctest
%post -n libZXing%{sover} -p /sbin/ldconfig
%postun -n libZXing%{sover} -p /sbin/ldconfig