update to 2.2.1

This commit is contained in:
topazus 2024-06-22 22:20:48 +08:00
commit 232a5156f8
4 changed files with 28 additions and 61 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
/zxing-cpp-2.0.0.tar.gz
/zxing-cpp-2.2.1.tar.gz

View file

@ -1 +1 @@
SHA512 (zxing-cpp-2.0.0.tar.gz) = fa22164f834a42194eafd0d3e9c09d953233c69843ac6e79c8d6513314be28d8082382b436c379368e687e0eed05cb5e566d2893ec6eb29233a36643904ae083
SHA512 (zxing-cpp-2.2.1.tar.gz) = f1de8df783061a152a18cd9102ac0c579c40c76ab4a5ba9f30bcb8ddb532f3fac08736840a631adbf7c30a7fa00ce8d65625c8cd695288620601708e8f256a53

View file

@ -1,37 +0,0 @@
diff -Naur zxing-cpp-1.2.0-original/wrappers/python/CMakeLists.txt zxing-cpp-1.2.0/wrappers/python/CMakeLists.txt
--- zxing-cpp-1.2.0-original/wrappers/python/CMakeLists.txt 2021-05-28 06:47:09.000000000 -0400
+++ zxing-cpp-1.2.0/wrappers/python/CMakeLists.txt 2021-12-13 20:31:22.286170793 -0500
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.14)
project(ZXingPython)
-set (pybind11_git_repo https://github.com/pybind/pybind11.git)
-set (pybind11_git_rev v2.10.2)
+find_package(pybind11)
# check if we are called from the top-level ZXing project
get_directory_property(hasParent PARENT_DIRECTORY)
@@ -21,14 +20,8 @@
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})
else()
# we don't have access to the top-level cmake helpers -> simply fetch it unconditional
- include(FetchContent)
- FetchContent_Declare (pybind11
- GIT_REPOSITORY ${pybind11_git_repo}
- GIT_TAG ${pybind11_git_rev})
- FetchContent_MakeAvailable (pybind11)
# Building from python source distribution (which does not include the whole repository but only python part)
# so we need to get c++ source git to build the python extension. The python distribution version (given in
@@ -54,8 +47,6 @@
add_subdirectory(${zxing-cpp_SOURCE_DIR}/core ZXing EXCLUDE_FROM_ALL)
endif()
endif()
-else()
- zxing_add_package(pybind11 pybind11 ${pybind11_git_repo} ${pybind11_git_rev})
endif()
# build the python module

View file

@ -1,41 +1,38 @@
Name: zxing-cpp
Version: 2.0.0
Release: %autorelease
Summary: C++ port of the ZXing ("Zebra Crossing") barcode scanning library
Name: zxing-cpp
Version: 2.2.1
Release: %autorelease
Summary: C++ port of the ZXing ("Zebra Crossing") barcode scanning library
# The entire source is ASL 2.0, except:
# - wrappers/wasm/base64ArrayBuffer.js is MIT (but is not used)
License: Apache-2.0 AND MIT
Url: https://github.com/nu-book/zxing-cpp
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
License: Apache-2.0 AND MIT
URL: https://github.com/zxing-cpp/zxing-cpp
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: cmake(fmt)
# Use the system copy of pybind11 rather than trying to download a copy. This
# patch is unconditional, so it is not, as-is, suitable for sending upstream.
Patch0: zxing-cpp-1.2.0-system-pybind11.patch
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: cmake(fmt)
%description
ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
image processing library implemented in C++.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n python3-%{name}
%package -n python3-%{name}
Summary: Python bindings for the %{name} barcode library
BuildRequires: python3-devel
BuildRequires: pybind11-devel
BuildRequires: chrpath
BuildRequires: python3-devel
BuildRequires: pybind11-devel
BuildRequires: chrpath
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python3-%{name}
%{summary}.
@ -47,6 +44,8 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
sed -r -i 's@(COMMAND )python@\1%{python3}@' wrappers/python/CMakeLists.txt
# we dont need cmake as a python dependency
sed -r -i '/cmake/d' wrappers/python/pyproject.toml
sed -i 's/pybind11\[global\]/pybind11/' wrappers/python/pyproject.toml
# build verbosely:
%generate_buildrequires
@ -62,7 +61,11 @@ popd &>/dev/null
# CMAKE_BUILD_TYPE=RelWithDebInfo prevents the build from stripping the
# python module after it is built. The stripping happens in
# pybind11_add_module.
%cmake -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON_MODULE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
%cmake \
-DZXING_DEPENDENCIES=LOCAL \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PYTHON_MODULE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
%cmake_build
pushd wrappers/python
# CMake respects this environment variable. We need to see the compiler