[neon/backports-jammy/zxing-cpp-jammy/Neon/release] debian/patches: add patches

Carlos De Maine null at kde.org
Mon Jan 16 12:36:01 GMT 2023


Git commit 1ab0370efa425bbc4b943e310e48a1d1091a21ab by Carlos De Maine.
Committed on 16/01/2023 at 12:35.
Pushed by carlosdem into branch 'Neon/release'.

add patches

A  +33   -0    debian/patches/0002-fix-python-wrapper-build.patch
A  +36   -0    debian/patches/0003-Disable-tests-without-test-file.patch

https://invent.kde.org/neon/backports-jammy/zxing-cpp-jammy/commit/1ab0370efa425bbc4b943e310e48a1d1091a21ab

diff --git a/debian/patches/0002-fix-python-wrapper-build.patch b/debian/patches/0002-fix-python-wrapper-build.patch
new file mode 100644
index 0000000..1ff6b02
--- /dev/null
+++ b/debian/patches/0002-fix-python-wrapper-build.patch
@@ -0,0 +1,33 @@
+From: Boyuan Yang <byang at debian.org>
+Date: Sat, 29 Jan 2022 13:58:06 -0500
+Subject: fix python wrapper build
+
+---
+ wrappers/python/CMakeLists.txt | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/wrappers/python/CMakeLists.txt b/wrappers/python/CMakeLists.txt
+index eadfc04..2fe924b 100644
+--- a/wrappers/python/CMakeLists.txt
++++ b/wrappers/python/CMakeLists.txt
+@@ -59,10 +59,20 @@ else()
+ endif()
+ 
+ # build the python module
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(python3 REQUIRED python3)
+ pybind11_add_module(zxingcpp zxing.cpp)
+ target_link_libraries(zxingcpp PRIVATE ZXing::ZXing)
++target_include_directories(zxingcpp PUBLIC ${python3_INCLUDE_DIRS})
++target_compile_options(zxingcpp PUBLIC ${python3_CFLAGS_OTHER})
+ 
+ if (BUILD_READERS AND BUILD_WRITERS)
+     add_test(NAME PythonTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py -v)
+     set_property(TEST PythonTest PROPERTY ENVIRONMENT PYTHONPATH=$<TARGET_FILE_DIR:zxingcpp>)
+ endif()
++
++install(TARGETS zxingcpp
++    COMPONENT python
++    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
++    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
++    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
diff --git a/debian/patches/0003-Disable-tests-without-test-file.patch b/debian/patches/0003-Disable-tests-without-test-file.patch
new file mode 100644
index 0000000..5b2316d
--- /dev/null
+++ b/debian/patches/0003-Disable-tests-without-test-file.patch
@@ -0,0 +1,36 @@
+From: Boyuan Yang <byang at debian.org>
+Date: Wed, 13 Jul 2022 16:29:38 -0400
+Subject: Disable tests without test file
+
+Also see: https://bugs.debian.org/1004653
+---
+ example/CMakeLists.txt       | 2 +-
+ test/blackbox/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
+index 36d663a..469eba3 100644
+--- a/example/CMakeLists.txt
++++ b/example/CMakeLists.txt
+@@ -20,7 +20,7 @@ if (BUILD_READERS)
+ 
+     target_link_libraries (ZXingReader ZXing::ZXing stb::stb)
+ 
+-    add_test(NAME ZXingReaderTest COMMAND ZXingReader -fast -format qrcode test.png) # see above
++#    add_test(NAME ZXingReaderTest COMMAND ZXingReader -fast -format qrcode test.png) # see above
+ 
+     install(TARGETS ZXingReader DESTINATION ${CMAKE_INSTALL_BINDIR})
+ endif()
+diff --git a/test/blackbox/CMakeLists.txt b/test/blackbox/CMakeLists.txt
+index 2d7d9e3..9bd0e89 100644
+--- a/test/blackbox/CMakeLists.txt
++++ b/test/blackbox/CMakeLists.txt
+@@ -17,7 +17,7 @@ if (BUILD_READERS)
+     )
+     target_compile_definitions(ReaderTest PRIVATE ZX_USE_UTF8)
+ 
+-    add_test(NAME ReaderTest COMMAND ReaderTest ${CMAKE_CURRENT_SOURCE_DIR}/../samples)
++#    add_test(NAME ReaderTest COMMAND ReaderTest ${CMAKE_CURRENT_SOURCE_DIR}/../samples)
+ endif()
+ 
+ if (BUILD_WRITERS)


More information about the Neon-commits mailing list