Accepting request 827103 from home:cgiboudeaux:zxing

- Update to 1.1.0
  * Add Python binding
  * Bug fixes from upstream XZing project
  * Many performance improvements for 1D readers
  * More meta-data exported when reading specific format
  * Minor bug fixes and improvements for corner cases
  * Improve DataMatrix encoder
  * Add interface to simplify basic usage
  * WASM API to support pixels array as input
  * Few minor bug fixes
  * A new and (hopefully) 'future proof' single ReadBarcode entry point
    into the decoding functionality.
  * The LuminanceSource based API is now deprecated but still compiles.
  * A new BarcodeFormats flag type to specify the set of barcodes to look for.
  * Deprecated unrelyable Result::resultPoints in favor of well defined
    Result::position.
  * Deprecated Result::metadata() -> ORIENTATION in favor
    of Result::orientation.
  * New Binarizer enum in DecodeHints to specify the binarizer for
    the ReadBarcode API.
  * New DecodeHints::isPure property to speed up detection for
    'pure' input use-cases.
  * New 'unified' CMake structure to build (most) of the project from
    the top-level project.
  * New ZXingReader and ZXingWriter example code also meant for distributing.
  * New simplified and consistent Python API (breaking change)
  * ReedSolomon error detection code 2x speedup.
  * Enable basic MaxiCode support.
  * Fix coutry-code metatdata decoding for UPC/EAN codes.
  * Slightly improved QRCode detection for rotated symbols.

OBS-URL: https://build.opensuse.org/request/show/827103
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/zxing-cpp?expand=0&rev=9
This commit is contained in:
Dirk Mueller 2020-08-19 08:55:31 +00:00 committed by Git OBS Bridge
parent e3901fdcca
commit 0d03091bd3
6 changed files with 74 additions and 366 deletions

View File

@ -1,98 +0,0 @@
diff --git a/core/src/datamatrix/DMBitMatrixParser.cpp b/core/src/datamatrix/DMBitMatrixParser.cpp
index 4b8e94a..f4402d6 100644
--- a/core/src/datamatrix/DMBitMatrixParser.cpp
+++ b/core/src/datamatrix/DMBitMatrixParser.cpp
@@ -22,6 +22,8 @@
#include "DecodeStatus.h"
#include "ByteArray.h"
+#include <stdexcept>
+
namespace ZXing {
namespace DataMatrix {
diff --git a/core/src/oned/ODCode128Writer.cpp b/core/src/oned/ODCode128Writer.cpp
index fc3cac3..eb7bb2c 100644
--- a/core/src/oned/ODCode128Writer.cpp
+++ b/core/src/oned/ODCode128Writer.cpp
@@ -21,6 +21,7 @@
#include <list>
#include <numeric>
+#include <stdexcept>
namespace ZXing {
namespace OneD {
diff --git a/core/src/oned/ODCode39Writer.cpp b/core/src/oned/ODCode39Writer.cpp
index 30b5aba..e8472db 100644
--- a/core/src/oned/ODCode39Writer.cpp
+++ b/core/src/oned/ODCode39Writer.cpp
@@ -20,6 +20,7 @@
#include "ZXContainerAlgorithms.h"
#include <array>
+#include <stdexcept>
namespace ZXing {
namespace OneD {
diff --git a/core/src/oned/ODCode93Writer.cpp b/core/src/oned/ODCode93Writer.cpp
index 8ad8ca5..90970a5 100644
--- a/core/src/oned/ODCode93Writer.cpp
+++ b/core/src/oned/ODCode93Writer.cpp
@@ -21,6 +21,7 @@
#include "ZXTestSupport.h"
#include <array>
+#include <stdexcept>
namespace ZXing {
namespace OneD {
diff --git a/core/src/oned/ODITFWriter.cpp b/core/src/oned/ODITFWriter.cpp
index c33fba8..62c3f15 100644
--- a/core/src/oned/ODITFWriter.cpp
+++ b/core/src/oned/ODITFWriter.cpp
@@ -18,6 +18,7 @@
#include "oned/ODWriterHelper.h"
#include <array>
+#include <stdexcept>
namespace ZXing {
namespace OneD {
diff --git a/core/src/pdf417/PDFCodewordDecoder.cpp b/core/src/pdf417/PDFCodewordDecoder.cpp
index 1a15247..c96c60b 100644
--- a/core/src/pdf417/PDFCodewordDecoder.cpp
+++ b/core/src/pdf417/PDFCodewordDecoder.cpp
@@ -20,6 +20,7 @@
#include <vector>
#include <numeric>
#include <limits>
+#include <stdexcept>
namespace ZXing {
namespace Pdf417 {
diff --git a/core/src/pdf417/PDFEncoder.cpp b/core/src/pdf417/PDFEncoder.cpp
index 2d32147..1942fcd 100644
--- a/core/src/pdf417/PDFEncoder.cpp
+++ b/core/src/pdf417/PDFEncoder.cpp
@@ -21,6 +21,7 @@
#include <array>
#include <cmath>
#include <vector>
+#include <stdexcept>
namespace ZXing {
namespace Pdf417 {
diff --git a/core/src/qrcode/QRWriter.cpp b/core/src/qrcode/QRWriter.cpp
index c48e4b0..a480acc 100644
--- a/core/src/qrcode/QRWriter.cpp
+++ b/core/src/qrcode/QRWriter.cpp
@@ -22,6 +22,8 @@
#include "BitMatrix.h"
#include "CharacterSet.h"
+#include <stdexcept>
+
namespace ZXing {
namespace QRCode {

View File

@ -1,235 +0,0 @@
From 26fd669538f7c77bad1057b75e06184420ec0269 Mon Sep 17 00:00:00 2001
From: Huy Cuong Nguyen <huycn@users.noreply.github.com>
Date: Sun, 19 May 2019 10:21:03 -0400
Subject: [PATCH] Fixes #70 and fixes #71; shared library with version number
---
CMakeLists.txt | 77 ++++++++++++++++++++++++++++++++++++++++++++-
core/CMakeLists.txt | 69 +++++++++++++---------------------------
core/ZXVersion.h.in | 21 +++++++++++++
core/src/ZXConfig.h | 5 ---
4 files changed, 119 insertions(+), 53 deletions(-)
create mode 100644 core/ZXVersion.h.in
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8b00bf..4e38433 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,2 +1,77 @@
cmake_minimum_required (VERSION 3.1.3)
-add_subdirectory(core)
+
+set (ZXING_VERSION_MAJOR 1)
+set (ZXING_VERSION_MINOR 0)
+set (ZXING_VERSION_PATCH 5)
+
+project (ZXingCpp VERSION ${ZXING_VERSION_MAJOR}.${ZXING_VERSION_MINOR}.${ZXING_VERSION_PATCH})
+
+set (ENABLE_ENCODERS ON CACHE BOOL "Check to include encoders")
+set (ENABLE_DECODERS ON CACHE BOOL "Check to include decoders")
+set (LINK_CPP_STATICALLY OFF CACHE BOOL "MSVC only, check to link statically standard library (/MT and /MTd)")
+set (BUILD_SHARED_LIBRARY OFF CACHE BOOL "Check to build ZXingCore as shared library")
+
+add_definitions (-DUNICODE -D_UNICODE)
+
+if (MSVC)
+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GS-")
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GS-")
+ if (LINK_CPP_STATICALLY)
+ set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+ endif()
+else()
+ set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
+endif()
+
+set (DEFAULT_BUILD_TYPE "Release")
+
+if (NOT CMAKE_BUILD_TYPE)
+ message (STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
+ set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+endif()
+
+add_subdirectory (core)
+
+set_target_properties (ZXingCore PROPERTIES VERSION ${PROJECT_VERSION})
+set_target_properties (ZXingCore PROPERTIES SOVERSION ${ZXING_VERSION_MAJOR})
+
+set (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ZXing")
+
+install (
+ EXPORT ZXingTargets
+ DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAMESPACE ZXing::
+)
+
+install (
+ DIRECTORY core/src/
+ DESTINATION include/ZXing
+ FILES_MATCHING PATTERN "*.h"
+)
+
+configure_file (
+ core/ZXVersion.h.in
+ ZXVersion.h
+)
+
+install (
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/ZXVersion.h"
+ DESTINATION include/ZXing
+)
+
+include (CMakePackageConfigHelpers)
+
+configure_package_config_file (
+ core/ZXingConfig.cmake.in
+ ZXingConfig.cmake
+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
+
+install (
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/ZXingConfig.cmake"
+ DESTINATION ${CMAKECONFIG_INSTALL_DIR}
+)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index d566843..d383b12 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -1,32 +1,5 @@
cmake_minimum_required (VERSION 3.1.3)
-if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
- # this is the top level project
- project (ZXingCpp)
-
- set (ENABLE_ENCODERS OFF CACHE BOOL "Check to include encoders")
- set (ENABLE_DECODERS ON CACHE BOOL "Check to include decoders")
- set (LINK_CPP_STATICALLY OFF CACHE BOOL "MSVC only, check to link statically standard library (/MT and /MTd)")
- set (BUILD_SHARED_LIBRARY OFF CACHE BOOL "Check to build ZXingCore as shared library")
-
- add_definitions (-DUNICODE -D_UNICODE)
-
- if (MSVC)
- set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GS-")
- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GS-")
- if (LINK_CPP_STATICALLY)
- set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
- set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
- set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
- endif()
- else()
- set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
- set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
- endif()
-
-endif()
-
if (NOT DEFINED ENABLE_ENCODERS)
set (ENABLE_ENCODERS OFF)
endif()
@@ -473,14 +446,24 @@ target_compile_options (ZXingCore
PRIVATE ${ZXING_CORE_LOCAL_DEFINES}
)
-if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
- target_compile_options (ZXingCore PRIVATE
+include (CheckCXXCompilerFlag)
+
+CHECK_CXX_COMPILER_FLAG ("-std=c++11" COMPILER_SUPPORTS_CXX11)
+if (COMPILER_SUPPORTS_CXX11)
+ target_compile_options(ZXingCore PRIVATE
-std=c++11
+ )
+endif()
+
+CHECK_CXX_COMPILER_FLAG ("-ffloat-store" COMPILER_NEEDS_FLOAT_STORE)
+if (COMPILER_NEEDS_FLOAT_STORE)
+ target_compile_options(ZXingCore PRIVATE
-ffloat-store # same floating point precision in all optimization levels
)
-elseif (APPLE)
+endif()
+
+if (APPLE)
target_compile_options (ZXingCore PRIVATE
- -std=c++11
-stdlib=libc++
)
endif()
@@ -490,21 +473,13 @@ target_link_libraries (ZXingCore PUBLIC ${CMAKE_THREAD_LIBS_INIT})
add_library(ZXing::Core ALIAS ZXingCore)
set_target_properties(ZXingCore PROPERTIES EXPORT_NAME Core)
-set(CMAKECONFIG_INSTALL_DIR "lib/cmake/ZXing")
-install(TARGETS ZXingCore EXPORT ZXingTargets
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- INCLUDES DESTINATION include
-)
-install(EXPORT ZXingTargets DESTINATION ${CMAKECONFIG_INSTALL_DIR} NAMESPACE ZXing::)
+include (GNUInstallDirs)
-install(
- DIRECTORY src/
- DESTINATION include/ZXing
- FILES_MATCHING PATTERN "*.h"
+# Once we can require cmake 1.13, then we can move this to ../CMakeLists.txt, see: https://gitlab.kitware.com/cmake/cmake/merge_requests/2152
+install (
+ TARGETS ZXingCore EXPORT ZXingTargets
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION include
)
-
-include(CMakePackageConfigHelpers)
-configure_package_config_file(ZXingConfig.cmake.in ZXingConfig.cmake INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR})
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ZXingConfig.cmake DESTINATION ${CMAKECONFIG_INSTALL_DIR})
diff --git a/core/ZXVersion.h.in b/core/ZXVersion.h.in
new file mode 100644
index 0000000..7846d20
--- /dev/null
+++ b/core/ZXVersion.h.in
@@ -0,0 +1,21 @@
+#pragma once
+/*
+* Copyright 2019 Nu-book Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+// Version numbering
+#define ZXING_VERSION_MAJOR @ZXING_VERSION_MAJOR@
+#define ZXING_VERSION_MINOR @ZXING_VERSION_MINOR@
+#define ZXING_VERSION_PATCH @ZXING_VERSION_PATCH@
diff --git a/core/src/ZXConfig.h b/core/src/ZXConfig.h
index 34918d1..62cad97 100644
--- a/core/src/ZXConfig.h
+++ b/core/src/ZXConfig.h
@@ -21,11 +21,6 @@
#define ZX_HAVE_CONFIG
-// Version numbering
-#define ZXING_VERSION_MAJOR 1
-#define ZXING_VERSION_MINOR 0
-#define ZXING_VERSION_PATCH 5
-
#if !__has_attribute(cxx_rtti) && !defined(__RTTI) && !defined(_CPPRTTI) && !defined(__GXX_RTTI) && !defined(__INTEL_RTTI__)
#define ZX_NO_RTTI
#endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65bf1e7c45cc5330f8e399b6cff5a3e4e9190ce6fe389b9cc5c8fc180838c60a
size 128809943

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:283574a817a6efdb38e4f0480fb7697e9b1f90b55d6b16e92e1a2d2af9c43506
size 128856890

View File

@ -1,3 +1,42 @@
-------------------------------------------------------------------
Sun Aug 16 19:19:01 UTC 2020 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 1.1.0
* Add Python binding
* Bug fixes from upstream XZing project
* Many performance improvements for 1D readers
* More meta-data exported when reading specific format
* Minor bug fixes and improvements for corner cases
* Improve DataMatrix encoder
* Add interface to simplify basic usage
* WASM API to support pixels array as input
* Few minor bug fixes
* A new and (hopefully) 'future proof' single ReadBarcode entry point
into the decoding functionality.
* The LuminanceSource based API is now deprecated but still compiles.
* A new BarcodeFormats flag type to specify the set of barcodes to look for.
* Deprecated unrelyable Result::resultPoints in favor of well defined
Result::position.
* Deprecated Result::metadata() -> ORIENTATION in favor
of Result::orientation.
* New Binarizer enum in DecodeHints to specify the binarizer for
the ReadBarcode API.
* New DecodeHints::isPure property to speed up detection for
'pure' input use-cases.
* New 'unified' CMake structure to build (most) of the project from
the top-level project.
* New ZXingReader and ZXingWriter example code also meant for distributing.
* New simplified and consistent Python API (breaking change)
* ReedSolomon error detection code 2x speedup.
* Enable basic MaxiCode support.
* Fix coutry-code metatdata decoding for UPC/EAN codes.
* Slightly improved QRCode detection for rotated symbols.
* Faster PDF417 decoder.
* Lots of minor code readability and general cleanup improvements.
- Drop patches:
* add-missing-includes-of-stdexcept-header.patch
* fix-library-installation-and-versioning.patch
-------------------------------------------------------------------
Thu Dec 5 08:57:46 UTC 2019 - Martin Liška <mliska@suse.cz>

View File

@ -1,7 +1,7 @@
#
# spec file for package zxing-cpp
#
# Copyright (c) 2019 SUSE LLC
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -18,23 +18,42 @@
%define sover 1
Name: zxing-cpp
Version: 1.0.5
Version: 1.1.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
Group: Development/Languages/C and C++
URL: https://github.com/nu-book/zxing-cpp/
Source0: https://github.com/nu-book/zxing-cpp/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM
Patch1: fix-library-installation-and-versioning.patch
Patch2: add-missing-includes-of-stdexcept-header.patch
BuildRequires: cmake
BuildRequires: cmake >= 3.10
BuildRequires: gcc-c++
BuildRequires: pkgconfig
%description
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides a C++ implementation.
%package -n libZXing%{sover}
Summary: Library for processing 1D and 2D barcodes
Group: System/Libraries
# called libZXing in the 1.1.0 update
Provides: libZXingCore%{sover} = %{version}
Obsoletes: libZXingCore%{sover} < %{version}
%description -n libZXing%{sover}
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides a C++ implementation.
%package devel
Summary: Header files for zxing, a library for processing 1D and 2D barcodes
Group: Development/Languages/C and C++
Requires: libZXing%{sover} = %{version}
%description devel
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides header files to use ZXing in
other applications.
%prep
%autosetup -p1
@ -45,37 +64,20 @@ processing library. This package provides a C++ implementation.
%install
%cmake_install
%package -n libZXingCore%{sover}
Summary: Library for processing 1D and 2D barcodes
Group: System/Libraries
%post -n libZXing%{sover} -p /sbin/ldconfig
%postun -n libZXing%{sover} -p /sbin/ldconfig
%description -n libZXingCore%{sover}
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides a C++ implementation.
%post -n libZXingCore%{sover} -p /sbin/ldconfig
%postun -n libZXingCore%{sover} -p /sbin/ldconfig
%files -n libZXingCore%{sover}
%files -n libZXing%{sover}
%doc README.md
%license LICENSE.*
%{_libdir}/libZXingCore.so.%{sover}
%{_libdir}/libZXingCore.so.%{sover}.*
%package devel
Summary: Header files for zxing, a library for processing 1D and 2D barcodes
Group: Development/Languages/C and C++
Requires: libZXingCore%{sover} = %{version}
%description devel
ZXing ("zebra crossing") is an multi-format 1D/2D barcode image
processing library. This package provides header files to use ZXing in
other applications.
%{_libdir}/libZXing.so.%{sover}
%{_libdir}/libZXing.so.%{sover}.*
%files devel
%license LICENSE.*
%{_includedir}/ZXing/
%{_libdir}/cmake/ZXing/
%{_libdir}/libZXingCore.so
%{_libdir}/libZXing.so
%{_libdir}/pkgconfig/zxing.pc
%changelog