Skip to content

Commit

Permalink
deskutils/kodaskanna: prepare for textproc/zxing-cpp 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tcberner committed Jan 10, 2023
1 parent b8c31f5 commit 49c02cd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
5 changes: 4 additions & 1 deletion deskutils/kodaskanna/Makefile
Expand Up @@ -4,14 +4,17 @@ PORTREVISION= 1
CATEGORIES= deskutils
MASTER_SITES= KDE/unstable/${PORTNAME}/${DISTVERSION}/src

PATCH_SITES= https://invent.kde.org/graphics/kodaskanna/-/commit/
PATCHFILES= 1656f7e66aec20ecd4a66f041bd7fc1850721e08.diff:-p1

MAINTAINER= adridg@FreeBSD.org
COMMENT= Barcode and QR-code scanner
WWW= https://invent.kde.org/graphics/kodaskanna

LICENSE= LGPL21+
LICENSE_FILE= ${WRKSRC}/LICENSES/LGPL-2.1-or-later.txt

LIB_DEPENDS= libZXing.so.1:textproc/zxing-cpp
LIB_DEPENDS= libZXing.so:textproc/zxing-cpp

USES= cmake compiler:c++17-lang gl kde:5 pkgconfig qt:5 tar:xz xorg
USE_GL= gl
Expand Down
4 changes: 3 additions & 1 deletion deskutils/kodaskanna/distinfo
@@ -1,3 +1,5 @@
TIMESTAMP = 1643278462
TIMESTAMP = 1673343046
SHA256 (kodaskanna-0.1.0.tar.xz) = 2860cfdae922a29749421f3b4e3281ef88fc5713002345bc725082fb47cd627f
SIZE (kodaskanna-0.1.0.tar.xz) = 40656
SHA256 (1656f7e66aec20ecd4a66f041bd7fc1850721e08.diff) = 198a2f22fd574bb6a9e4b02406d04847921caacf9c709f974f1e9025438940a5
SIZE (1656f7e66aec20ecd4a66f041bd7fc1850721e08.diff) = 463
27 changes: 27 additions & 0 deletions deskutils/kodaskanna/files/patch-src_core_scanimagerunner.cpp
@@ -0,0 +1,27 @@
--- src/core/scanimagerunner.cpp.orig 2022-01-24 22:35:35 UTC
+++ src/core/scanimagerunner.cpp
@@ -10,6 +10,9 @@
#include "scanresult.hpp"
#include "scanresult_p.hpp"
// ZXing
+#include <ZXing/ZXVersion.h>
+#define ZXING_VERSION \
+ QT_VERSION_CHECK(ZXING_VERSION_MAJOR, ZXING_VERSION_MINOR, ZXING_VERSION_PATCH)
#include <ZXing/ReadBarcode.h>

namespace Kodaskanna
@@ -63,8 +66,13 @@ void ScanImageRunner::run()

resultData->isSuccess = result.isValid();
if (resultData->isSuccess) {
- resultData->text = QString::fromStdWString(result.text());
+#if ZXING_VERSION < QT_VERSION_CHECK(2, 0, 0)
+ resultData->text = QString::fromStdWString(result.text());
resultData->bytes = QByteArray(reinterpret_cast<const char *>(result.rawBytes().data()), result.rawBytes().size());
+#else
+ resultData->text = QString::fromStdString(result.text());
+ resultData->bytes = QByteArray(reinterpret_cast<const char *>(result.bytes().data()), result.bytes().size());
+#endif
}

Q_EMIT scanFinished(scanResult);

0 comments on commit 49c02cd

Please sign in to comment.