Compare commits
21 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b15ae3c78 | ||
|
|
23c7a4eebb | ||
|
|
1408342a15 | ||
|
|
fc8305b0bb | ||
|
|
232a5156f8 | ||
|
|
8bb7a3aef0 | ||
|
|
25adcbcda4 | ||
|
|
8e28d49bf4 | ||
|
|
23be1c2ec4 | ||
|
|
613e9b95cb | ||
|
|
0e9e8b06b2 |
||
|
|
a5f5259d33 | ||
|
|
222570992b | ||
|
|
8e77e9ac64 | ||
|
|
ae793c41d7 | ||
|
|
423fd3e1d5 | ||
|
|
fa22c68b1e | ||
|
|
6925253fcf | ||
|
|
24db98bd07 | ||
|
|
d0095d5838 | ||
|
|
f50a91500d |
6 changed files with 131 additions and 1783 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
/zxing-cpp-1.2.0.tar.gz
|
/zxing-cpp-2.0.0.tar.gz
|
||||||
|
/zxing-cpp-2.2.1.tar.gz
|
||||||
|
|
|
||||||
|
|
@ -1,76 +0,0 @@
|
||||||
From 8db14eeead45e0f1961532f55061d5e4dd0f78be Mon Sep 17 00:00:00 2001
|
|
||||||
From: Paul Wise <pabs3@bonedaddy.net>
|
|
||||||
Date: Thu, 26 Aug 2021 22:03:00 +0800
|
|
||||||
Subject: [PATCH] Add a mode to build against system versions of dependencies
|
|
||||||
|
|
||||||
Make the default be to use system versions when available,
|
|
||||||
but allow always using them or never using them.
|
|
||||||
|
|
||||||
Add searching for and using system versions of fmt/googletest/pybind11,
|
|
||||||
which are currently pulled directly from git using FetchContent.
|
|
||||||
|
|
||||||
This will allow distributions that do not allow network access at build
|
|
||||||
time to depend on and build against these packages.
|
|
||||||
|
|
||||||
Fixes: https://github.com/nu-book/zxing-cpp/issues/248
|
|
||||||
---
|
|
||||||
CMakeLists.txt | 7 +++++++
|
|
||||||
test/blackbox/CMakeLists.txt | 18 +++++++++++++-----
|
|
||||||
1 files changed, 54 insertions(+), 21 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
||||||
index 1361792..2b522e0 100644
|
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -8,6 +8,7 @@ option (BUILD_EXAMPLES "Build the example barcode reader/writer applicatons" ON)
|
|
||||||
option (BUILD_BLACKBOX_TESTS "Build the black box reader/writer tests" ON)
|
|
||||||
option (BUILD_UNIT_TESTS "Build the unit tests (don't enable for production builds)" OFF)
|
|
||||||
option (BUILD_PYTHON_MODULE "Build the python module" OFF)
|
|
||||||
+set(BUILD_SYSTEM_DEPS "AUTO" CACHE STRING "Use system dependencies (AUTO/ALWAYS/NEVER)")
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
option (BUILD_SHARED_LIBS "Build and link as shared library" OFF)
|
|
||||||
@@ -53,6 +54,12 @@ if (BUILD_UNIT_TESTS)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
+set(BUILD_SYSTEM_DEPS_LIST AUTO ALWAYS NEVER)
|
|
||||||
+set_property(CACHE BUILD_SYSTEM_DEPS PROPERTY STRINGS ${BUILD_SYSTEM_DEPS_LIST})
|
|
||||||
+if(NOT BUILD_SYSTEM_DEPS IN_LIST BUILD_SYSTEM_DEPS_LIST)
|
|
||||||
+ message(FATAL_ERROR "BUILD_SYSTEM_DEPS must be one of ${BUILD_SYSTEM_DEPS_LIST}")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
add_subdirectory (core)
|
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt
|
|
||||||
index 3da26dd..9d79e8e 100644
|
|
||||||
--- a/test/blackbox/CMakeLists.txt
|
|
||||||
+++ b/test/blackbox/CMakeLists.txt
|
|
||||||
@@ -1,10 +1,18 @@
|
|
||||||
cmake_minimum_required(VERSION 3.14)
|
|
||||||
|
|
||||||
-include(FetchContent)
|
|
||||||
-FetchContent_Declare (fmtlib
|
|
||||||
- GIT_REPOSITORY https://github.com/fmtlib/fmt.git
|
|
||||||
- GIT_TAG 7.1.2)
|
|
||||||
-FetchContent_MakeAvailable (fmtlib) # Adds fmt::fmt
|
|
||||||
+if (BUILD_SYSTEM_DEPS STREQUAL "AUTO")
|
|
||||||
+ find_package (fmt)
|
|
||||||
+elseif (BUILD_SYSTEM_DEPS STREQUAL "ALWAYS")
|
|
||||||
+ find_package (fmt REQUIRED)
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+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
|
|
||||||
+endif()
|
|
||||||
|
|
||||||
if (BUILD_READERS)
|
|
||||||
add_executable (ReaderTest
|
|
||||||
--
|
|
||||||
2.33.1
|
|
||||||
|
|
||||||
48
changelog
Normal file
48
changelog
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 2.0.0-7
|
||||||
|
- Rebuilt for Python 3.13
|
||||||
|
|
||||||
|
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
|
* Sat Jul 01 2023 Python Maint <python-maint@redhat.com> - 2.0.0-4
|
||||||
|
- Rebuilt for Python 3.12
|
||||||
|
|
||||||
|
* Wed Jun 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 2.0.0-3
|
||||||
|
- Rebuilt due to fmt 10 update.
|
||||||
|
|
||||||
|
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.0.0-2
|
||||||
|
- Rebuilt for Python 3.12
|
||||||
|
|
||||||
|
* Fri Feb 24 2023 Caolán McNamara <caolanm@redhat.com> 2.0.0-1
|
||||||
|
- latest release
|
||||||
|
- migrated to SPDX license
|
||||||
|
|
||||||
|
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-9
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
* Wed Oct 26 2022 Tom Stellard <tstellar@redhat.com> - 1.2.0-8
|
||||||
|
- Prevent stripping of python module
|
||||||
|
|
||||||
|
* Tue Aug 02 2022 Caolán McNamara <caolanm@redhat.com> 1.2.0-7
|
||||||
|
- Resolves: rhbz#2113772 FTBFS in Fedora rawhide/f37
|
||||||
|
|
||||||
|
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.2.0-5
|
||||||
|
- Rebuilt for Python 3.11
|
||||||
|
|
||||||
|
* Sat Apr 23 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.2.0-4
|
||||||
|
- Security fix for CVE-2022-28041
|
||||||
|
|
||||||
|
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-3
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Dec 14 2021 Caolán McNamara <caolanm@redhat.com> 1.2.0-2
|
||||||
|
- build python bindings
|
||||||
|
|
||||||
|
* Fri Dec 10 2021 Caolán McNamara <caolanm@redhat.com> 1.2.0-1
|
||||||
|
- initial import
|
||||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
||||||
SHA512 (zxing-cpp-1.2.0.tar.gz) = e61b4e44ccaf0871b5d8badf9ce0a81576f55e5d6a9458907b9b599a66227adceabb8d51a0c47b32319d8aeff93e758b4785d3bd0440375247471d95999de487
|
SHA512 (zxing-cpp-2.2.1.tar.gz) = f1de8df783061a152a18cd9102ac0c579c40c76ab4a5ba9f30bcb8ddb532f3fac08736840a631adbf7c30a7fa00ce8d65625c8cd695288620601708e8f256a53
|
||||||
|
|
|
||||||
138
zxing-cpp.spec
138
zxing-cpp.spec
|
|
@ -1,85 +1,105 @@
|
||||||
Name: zxing-cpp
|
Name: zxing-cpp
|
||||||
Version: 1.2.0
|
Version: 2.2.1
|
||||||
Release: 1%{?dist}
|
Release: %autorelease
|
||||||
Summary: C++ port of the ZXing ("Zebra Crossing") barcode scanning library
|
Summary: C++ port of the ZXing ("Zebra Crossing") barcode scanning library
|
||||||
|
|
||||||
# The entire source is ASL 2.0, except:
|
# The entire source is ASL 2.0, except:
|
||||||
#
|
|
||||||
# - TextCodec files, that is, core/src/textcodec/*, are
|
|
||||||
# (LGPLv2 with exceptions or LGPLv3 with exceptions).
|
|
||||||
# - core/src/textcodec/JPText{En,De}coder.* are, formally,
|
|
||||||
# ((LGPLv2 with exceptions or LGPLv3 with exceptions) and BSD),
|
|
||||||
# which still forms an effective license of
|
|
||||||
# (LGPLv2 with exceptions or LGPLv3 with exceptions)
|
|
||||||
# - wrappers/wasm/base64ArrayBuffer.js is MIT (but is not used)
|
# - wrappers/wasm/base64ArrayBuffer.js is MIT (but is not used)
|
||||||
# - thirdparty/stb/stb_image.h and thirdparty/stb/stb_image_write.h are MIT
|
License: Apache-2.0 AND MIT
|
||||||
# (but are unbundled)
|
URL: https://github.com/zxing-cpp/zxing-cpp
|
||||||
#
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
# The resulting effective license for the combined library is:
|
|
||||||
License: LGPLv2 with exceptions or LGPLv3 with exceptions
|
|
||||||
Url: https://github.com/nu-book/zxing-cpp
|
|
||||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
||||||
|
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
BuildRequires: cmake(fmt)
|
BuildRequires: cmake(fmt)
|
||||||
# -static BR’s required by guidelines for tracking of header-only libraries:
|
|
||||||
BuildRequires: stb_image-devel
|
|
||||||
BuildRequires: stb_image-static
|
|
||||||
BuildRequires: stb_image_write-devel
|
|
||||||
BuildRequires: stb_image_write-static
|
|
||||||
# https://github.com/nu-book/zxing-cpp/issues/248
|
|
||||||
Patch0: 0001-Add-a-mode-to-build-against-system-versions-of-depen.patch
|
|
||||||
# Update stb_image/stb_image_write
|
|
||||||
# https://github.com/nu-book/zxing-cpp/pull/269
|
|
||||||
# Fixes CVE-2021-28021, CVE-2021-42715, and CVE-2021-42716, and adds a patch
|
|
||||||
# file for zxing-cpp-specific changes
|
|
||||||
Patch1: %{url}/pull/269.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
|
ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
|
||||||
image processing library implemented in C++.
|
image processing library implemented in C++.
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
# The entire contents are ASL 2.0, except:
|
Summary: Development files for %{name}
|
||||||
#
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
# - %%{_includedir}/ZXing/textcodec/*.h are exactly or effectively
|
|
||||||
# (LGPLv2 with exceptions or LGPLv3 with exceptions)
|
|
||||||
#
|
|
||||||
# See licensing breakdown above base package’s License field for further
|
|
||||||
# details.
|
|
||||||
License: ASL 2.0 and (LGPLv2 with exceptions or LGPLv3 with exceptions)
|
|
||||||
Summary: Development files for %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
The %{name}-devel package contains libraries and header files for
|
The %{name}-devel package contains libraries and header files for
|
||||||
developing applications that use %{name}.
|
developing applications that use %{name}.
|
||||||
|
|
||||||
|
%package -n python3-%{name}
|
||||||
|
Summary: Python bindings for the %{name} barcode library
|
||||||
|
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: pybind11-devel
|
||||||
|
BuildRequires: chrpath
|
||||||
|
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description -n python3-%{name}
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
# remove bundled stb libraries:
|
|
||||||
rm -v thirdparty/stb/stb_image_write.h thirdparty/stb/stb_image.h
|
# don’t use unversioned “python” interpreter in tests
|
||||||
# stb_image.h is trivially forked: reconstruct the changes with the latest
|
sed -r -i 's@(COMMAND )python@\1%{python3}@' wrappers/python/CMakeLists.txt
|
||||||
# unbundled copy
|
# we don’t need cmake as a python dependency
|
||||||
cp -p %{_includedir}/stb/stb_image.h thirdparty/stb/
|
sed -r -i '/cmake/d' wrappers/python/pyproject.toml
|
||||||
pushd thirdparty/stb
|
|
||||||
patch -p1 < stb_image.patch
|
sed -i 's/pybind11\[global\]/pybind11/' wrappers/python/pyproject.toml
|
||||||
popd
|
# build verbosely:
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
pushd wrappers/python &>/dev/null
|
||||||
|
%pyproject_buildrequires -r
|
||||||
|
popd &>/dev/null
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake -DBUILD_EXAMPLES=OFF
|
# Setting BUILD_PYTHON_MODULE builds a Python extension shared library module,
|
||||||
|
# but we don’t get any metadata (dist-info), so it’s not terribly useful for
|
||||||
|
# packaging purposes. Instead, it seems we must re-build the whole library
|
||||||
|
# through setuptools to get that.
|
||||||
|
# CMAKE_BUILD_TYPE=RelWithDebInfo prevents the build from stripping the
|
||||||
|
# python module after it is built. The stripping happens in
|
||||||
|
# pybind11_add_module.
|
||||||
|
%cmake \
|
||||||
|
-DZXING_DEPENDENCIES=LOCAL \
|
||||||
|
-DBUILD_EXAMPLES=OFF \
|
||||||
|
-DBUILD_PYTHON_MODULE=ON \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
%cmake_build
|
%cmake_build
|
||||||
|
pushd wrappers/python
|
||||||
|
# CMake respects this environment variable. We need to see the compiler
|
||||||
|
# invocations to verify the distro build flags are respected. Unfortunately,
|
||||||
|
# pybind11 does add -O3, and there doesn’t seem to be a way to turn that off.
|
||||||
|
# It’s a global pybind11 decision, not something in this package’s sources.
|
||||||
|
export VERBOSE=1
|
||||||
|
%pyproject_wheel
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%cmake_install
|
%cmake_install
|
||||||
|
pushd wrappers/python
|
||||||
|
%pyproject_install
|
||||||
|
# Now we do something sneaky: we substitute the Python extension that was built
|
||||||
|
# in the original CMake invocation, replacing the one built with setuptools. It
|
||||||
|
# is dynamically linked against the main libZXing.so, which makes it smaller,
|
||||||
|
# and it was not built with that pesky -O3 that was added by pybind11, so it
|
||||||
|
# better complies with packaging guidelines. The only problem is it contains an
|
||||||
|
# rpath that we need to remove.
|
||||||
|
popd
|
||||||
|
install -t '%{buildroot}%{python3_sitearch}' -p \
|
||||||
|
%{_vpath_builddir}/wrappers/python/zxingcpp.*.so
|
||||||
|
chrpath --delete %{buildroot}%{python3_sitearch}/zxingcpp.*.so
|
||||||
|
pushd wrappers/python
|
||||||
|
%pyproject_save_files zxingcpp
|
||||||
|
popd
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%ctest
|
%ctest
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE LICENSE.ZXing LICENSE.Qt LGPL_EXCEPTION.Qt NOTICE
|
%license LICENSE
|
||||||
%{_libdir}/libZXing.so.1
|
%{_libdir}/libZXing.so.3
|
||||||
%{_libdir}/libZXing.so.%{version}
|
%{_libdir}/libZXing.so.%{version}
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
|
|
@ -89,6 +109,8 @@ popd
|
||||||
%{_libdir}/cmake/ZXing/
|
%{_libdir}/cmake/ZXing/
|
||||||
%{_libdir}/pkgconfig/zxing.pc
|
%{_libdir}/pkgconfig/zxing.pc
|
||||||
|
|
||||||
|
%files -n python3-%{name} -f %{pyproject_files}
|
||||||
|
%{_libdir}/zxingcpp%{python3_ext_suffix}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Dec 10 2021 Caolán McNamara <caolanm@redhat.com> 1.2.0-1
|
%autochangelog
|
||||||
- initial import
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue