[gentoo-commits] repo/gentoo:master commit in: kde-frameworks/prison/, kde-frameworks/prison/files/

2023-01-09 Thread Andreas Sturmlechner
commit: 4eb458f6148a654b3670207fe0c0301bb4b24c07
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Mon Jan  9 23:04:26 2023 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Tue Jan 10 00:04:33 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4eb458f6

kde-frameworks/prison: backport patch for >=zxing-cpp-2.0.0

Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../prison/files/prison-5.99.0-zxing-2.patch   | 31 ++
 kde-frameworks/prison/prison-5.101.0.ebuild|  4 ++-
 kde-frameworks/prison/prison-5.99.0.ebuild |  4 ++-
 3 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/kde-frameworks/prison/files/prison-5.99.0-zxing-2.patch 
b/kde-frameworks/prison/files/prison-5.99.0-zxing-2.patch
new file mode 100644
index ..946cf9d1cc34
--- /dev/null
+++ b/kde-frameworks/prison/files/prison-5.99.0-zxing-2.patch
@@ -0,0 +1,31 @@
+From 14fb6f0a31373b242bdeb18cf9f3a36441bf86b5 Mon Sep 17 00:00:00 2001
+From: Volker Krause 
+Date: Tue, 3 Jan 2023 16:55:59 +0100
+Subject: [PATCH] Add support for ZXing 2.0
+
+As far as we are concerned that is source-compatible, so nothing we need
+to change here apart from adjusting the build system to accept the new
+major version.
+---
+ CMakeLists.txt | 5 -
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 365a1c9..961262e 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -44,7 +44,10 @@ find_package(Dmtx)
+ set_package_properties(Dmtx PROPERTIES
+ PURPOSE "Required for generation of Data Matrix barcodes."
+ TYPE RECOMMENDED)
+-find_package(ZXing 1.2.0)
++find_package(ZXing 2.0)
++if (NOT TARGET ZXing::ZXing)
++  find_package(ZXing 1.2.0)
++endif()
+ set_package_properties(ZXing PROPERTIES
+ PURPOSE "Required for generation of PDF417 barcodes and for scanning of 
barcodes from live video feed."
+ TYPE RECOMMENDED)
+-- 
+GitLab
+

diff --git a/kde-frameworks/prison/prison-5.101.0.ebuild 
b/kde-frameworks/prison/prison-5.101.0.ebuild
index 2972465702e6..f16d66fabd46 100644
--- a/kde-frameworks/prison/prison-5.101.0.ebuild
+++ b/kde-frameworks/prison/prison-5.101.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
 "
 
+PATCHES=( "${FILESDIR}/${PN}-5.99.0-zxing-2.patch" )
+
 src_configure() {
local mycmakeargs=(
$(cmake_use_find_package qml Qt5Quick)

diff --git a/kde-frameworks/prison/prison-5.99.0.ebuild 
b/kde-frameworks/prison/prison-5.99.0.ebuild
index da509e07e78b..0de668735817 100644
--- a/kde-frameworks/prison/prison-5.99.0.ebuild
+++ b/kde-frameworks/prison/prison-5.99.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -25,6 +25,8 @@ DEPEND="${RDEPEND}
test? ( >=dev-qt/qtwidgets-${QTMIN}:5 )
 "
 
+PATCHES=( "${FILESDIR}/${P}-zxing-2.patch" )
+
 src_configure() {
local mycmakeargs=(
$(cmake_use_find_package qml Qt5Quick)



[gentoo-commits] repo/gentoo:master commit in: kde-frameworks/prison/, kde-frameworks/prison/files/

2022-07-14 Thread Andreas Sturmlechner
commit: a8bb28b162de0908f9cc23b1a0bc04a986d8
Author: Andreas Sturmlechner  gentoo  org>
AuthorDate: Thu Jul 14 08:23:40 2022 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Thu Jul 14 09:27:39 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8bb28b1

kde-frameworks/prison: Slot op, build w/ media-libs/zxing-cpp-1.4.0

Upstream commit 74e34fa35a59098db7c4358b788ad3ac0a5745f7

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 .../files/prison-5.96.0-zxing-cpp-1.4.0.patch  | 107 +
 kde-frameworks/prison/prison-5.96.0-r1.ebuild  |  36 +++
 2 files changed, 143 insertions(+)

diff --git a/kde-frameworks/prison/files/prison-5.96.0-zxing-cpp-1.4.0.patch 
b/kde-frameworks/prison/files/prison-5.96.0-zxing-cpp-1.4.0.patch
new file mode 100644
index ..8971bd919a08
--- /dev/null
+++ b/kde-frameworks/prison/files/prison-5.96.0-zxing-cpp-1.4.0.patch
@@ -0,0 +1,107 @@
+From 74e34fa35a59098db7c4358b788ad3ac0a5745f7 Mon Sep 17 00:00:00 2001
+From: Volker Krause 
+Date: Fri, 8 Jul 2022 16:18:47 +0200
+Subject: [PATCH] Support ZXing 1.4.0
+
+The previous code doesn't build (and when made to build, crashes) with
+ZXing 1.4.0.
+---
+ src/scanner/CMakeLists.txt |  2 ++
+ src/scanner/config-prison-scanner.h.in | 14 ++
+ src/scanner/videoscannerworker.cpp | 17 +
+ 3 files changed, 33 insertions(+)
+ create mode 100644 src/scanner/config-prison-scanner.h.in
+
+diff --git a/src/scanner/CMakeLists.txt b/src/scanner/CMakeLists.txt
+index d5b9cf5..ef690c5 100644
+--- a/src/scanner/CMakeLists.txt
 b/src/scanner/CMakeLists.txt
+@@ -1,6 +1,8 @@
+ # SPDX-FileCopyrightText: 2022 Volker Krause 
+ # SPDX-License-Identifier: BSD-3-Clause
+ 
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-prison-scanner.h.in 
${CMAKE_CURRENT_BINARY_DIR}/config-prison-scanner.h)
++
+ add_library(KF5PrisonScanner)
+ add_library(KF5::PrisonScanner ALIAS KF5PrisonScanner)
+ 
+diff --git a/src/scanner/config-prison-scanner.h.in 
b/src/scanner/config-prison-scanner.h.in
+new file mode 100644
+index 000..d80ceaf
+--- /dev/null
 b/src/scanner/config-prison-scanner.h.in
+@@ -0,0 +1,14 @@
++/*
++   SPDX-FileCopyrightText: 2022 Volker Krause 
++   SPDX-License-Identifier: LGPL-2.0-or-later
++*/
++
++#ifndef CONFIG_PRISON_SCANNER_H
++#define CONFIG_PRISON_SCANNER_H
++
++#define ZXING_VERSION_MAJOR @ZXing_VERSION_MAJOR@
++#define ZXING_VERSION_MINOR @ZXing_VERSION_MINOR@
++#define ZXING_VERSION_PATCH @ZXing_VERSION_PATCH@
++#define ZXING_VERSION 
((@ZXing_VERSION_MAJOR@<<16)|(@ZXing_VERSION_MINOR@<<8)|(@ZXing_VERSION_PATCH@))
++
++#endif // CONFIG_PRISON_SCANNER_H
+diff --git a/src/scanner/videoscannerworker.cpp 
b/src/scanner/videoscannerworker.cpp
+index 45792dc..947367c 100644
+--- a/src/scanner/videoscannerworker.cpp
 b/src/scanner/videoscannerworker.cpp
+@@ -3,6 +3,7 @@
+ SPDX-License-Identifier: MIT
+ */
+ 
++#include "config-prison-scanner.h"
+ #include "format_p.h"
+ #include "scanresult_p.h"
+ #include "videoscannerframe_p.h"
+@@ -12,6 +13,7 @@
+ #include 
+ #include 
+ 
++#define ZX_USE_UTF8 1
+ #include 
+ #include 
+ 
+@@ -25,7 +27,11 @@ VideoScannerWorker::VideoScannerWorker(QObject *parent)
+ 
+ void VideoScannerWorker::slotScanFrame(VideoScannerFrame frame)
+ {
++#if ZXING_VERSION < QT_VERSION_CHECK(1, 4, 0)
+ ZXing::Result zxRes(ZXing::DecodeStatus::FormatError);
++#else
++ZXing::Result zxRes;
++#endif
+ ZXing::DecodeHints hints;
+ hints.setFormats(frame.formats() == Format::NoFormat ? 
ZXing::BarcodeFormats::all() : Format::toZXing(frame.formats()));
+ 
+@@ -173,6 +179,7 @@ void VideoScannerWorker::slotScanFrame(VideoScannerFrame 
frame)
+ if (zxRes.isValid()) {
+ auto res = ScanResultPrivate::get(scanResult);
+ 
++#if ZXING_VERSION < QT_VERSION_CHECK(1, 4, 0)
+ // distinguish between binary and text content
+ const auto hasWideChars = std::any_of(zxRes.text().begin(), 
zxRes.text().end(), [](auto c) {
+ return c > 255;
+@@ -188,6 +195,16 @@ void VideoScannerWorker::slotScanFrame(VideoScannerFrame 
frame)
+ std::copy(zxRes.text().begin(), zxRes.text().end(), b.begin());
+ res->content = b;
+ }
++#else
++if (zxRes.contentType() == ZXing::ContentType::Text) {
++res->content = QString::fromStdString(zxRes.text());
++} else {
++QByteArray b;
++b.resize(zxRes.bytes().size());
++std::copy(zxRes.bytes().begin(), zxRes.bytes().end(), b.begin());
++res->content = b;
++}
++#endif
+ 
+ // determine the bounding rect
+ // the cooridinates we get from ZXing are a polygon, we need to 
determine the
+-- 
+GitLab
+

diff --git a/kde-frameworks/prison/prison-5.96.0-r1.ebuild 
b/kde-frameworks/prison/prison-5.96.0-r1.ebuild
new file mode 100644
index ..4173c4d0a8ba