Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f41b2b1ea |
2 changed files with 3 additions and 82 deletions
|
|
@ -1,18 +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,13 +1,7 @@
|
|
||||||
cmake_minimum_required(VERSION 3.14)
|
|
||||||
project(ZXingPython)
|
|
||||||
|
|
||||||
-# get pybind11
|
|
||||||
-include(FetchContent)
|
|
||||||
-#set(FETCHCONTENT_QUIET Off)
|
|
||||||
-FetchContent_Declare (pybind11
|
|
||||||
- GIT_REPOSITORY https://github.com/pybind/pybind11.git
|
|
||||||
- GIT_TAG v2.6.2)
|
|
||||||
-FetchContent_MakeAvailable (pybind11)
|
|
||||||
+find_package(pybind11)
|
|
||||||
|
|
||||||
# check if we are called from the top-level ZXing project
|
|
||||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Name: zxing-cpp
|
Name: zxing-cpp
|
||||||
Version: 1.2.0
|
Version: 1.2.0
|
||||||
Release: 3%{?dist}
|
Release: 1%{?dist}
|
||||||
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:
|
||||||
|
|
@ -35,9 +35,6 @@ Patch0: 0001-Add-a-mode-to-build-against-system-versions-of-depen.patch
|
||||||
# Fixes CVE-2021-28021, CVE-2021-42715, and CVE-2021-42716, and adds a patch
|
# Fixes CVE-2021-28021, CVE-2021-42715, and CVE-2021-42716, and adds a patch
|
||||||
# file for zxing-cpp-specific changes
|
# file for zxing-cpp-specific changes
|
||||||
Patch1: %{url}/pull/269.patch
|
Patch1: %{url}/pull/269.patch
|
||||||
# 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.
|
|
||||||
Patch2: zxing-cpp-1.2.0-system-pybind11.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
|
||||||
|
|
@ -59,73 +56,23 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
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:
|
# remove bundled stb libraries:
|
||||||
rm -v thirdparty/stb/stb_image_write.h thirdparty/stb/stb_image.h
|
rm -v thirdparty/stb/stb_image_write.h thirdparty/stb/stb_image.h
|
||||||
# stb_image.h is trivially forked: reconstruct the changes with the latest
|
# stb_image.h is trivially forked: reconstruct the changes with the latest
|
||||||
# unbundled copy
|
# unbundled copy
|
||||||
cp -p /usr/include/stb/stb_image.h thirdparty/stb/
|
cp -p %{_includedir}/stb/stb_image.h thirdparty/stb/
|
||||||
pushd thirdparty/stb
|
pushd thirdparty/stb
|
||||||
patch -p1 < stb_image.patch
|
patch -p1 < stb_image.patch
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# don’t use unversioned “python” interpreter in tests
|
|
||||||
sed -r -i 's@(COMMAND )python@\1%{python3}@' wrappers/python/CMakeLists.txt
|
|
||||||
# we don’t need cmake as a python dependency
|
|
||||||
sed -r -i '/cmake/d' wrappers/python/pyproject.toml
|
|
||||||
# build verbosely:
|
|
||||||
|
|
||||||
%generate_buildrequires
|
|
||||||
pushd wrappers/python &>/dev/null
|
|
||||||
%pyproject_buildrequires -r
|
|
||||||
popd &>/dev/null
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Setting BUILD_PYTHON_MODULE builds a Python extension shared library module,
|
%cmake -DBUILD_EXAMPLES=OFF
|
||||||
# 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 -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON_MODULE=ON
|
|
||||||
%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
|
||||||
|
|
@ -142,14 +89,6 @@ popd
|
||||||
%{_libdir}/cmake/ZXing/
|
%{_libdir}/cmake/ZXing/
|
||||||
%{_libdir}/pkgconfig/zxing.pc
|
%{_libdir}/pkgconfig/zxing.pc
|
||||||
|
|
||||||
%files -n python3-%{name} -f %{pyproject_files}
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* 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
|
* Fri Dec 10 2021 Caolán McNamara <caolanm@redhat.com> 1.2.0-1
|
||||||
- initial import
|
- initial import
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue