diff options
author | Emanuel Haupt <ehaupt@FreeBSD.org> | 2020-07-18 15:32:22 +0800 |
---|---|---|
committer | Emanuel Haupt <ehaupt@FreeBSD.org> | 2020-07-18 15:32:22 +0800 |
commit | e3ffb1d2cb23b2c6a28f47dff10646eb34e54117 (patch) | |
tree | 35b0be6ba90c8ffc81de50eab8029e168df60b5c | |
parent | d59e12e9b4ca08facc7fcf0c539e38513815d7b9 (diff) | |
download | freebsd-ports-gnome-e3ffb1d2cb23b2c6a28f47dff10646eb34e54117.tar.gz freebsd-ports-gnome-e3ffb1d2cb23b2c6a28f47dff10646eb34e54117.tar.zst freebsd-ports-gnome-e3ffb1d2cb23b2c6a28f47dff10646eb34e54117.zip |
QtQR is a Qt based software that let's you generate QR Codes easily, scan an
image file for QR Codes and decode them or use your webcam to scan a printed
one.
WWW: https://launchpad.net/qr-tools
-rw-r--r-- | graphics/Makefile | 1 | ||||
-rw-r--r-- | graphics/qtqr/Makefile | 39 | ||||
-rw-r--r-- | graphics/qtqr/distinfo | 3 | ||||
-rw-r--r-- | graphics/qtqr/files/patch-qrtools.py | 53 | ||||
-rw-r--r-- | graphics/qtqr/pkg-descr | 5 | ||||
-rw-r--r-- | graphics/qtqr/pkg-plist | 23 |
6 files changed, 124 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile index 2c1ef5437f90..b5e1b2a12467 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -908,6 +908,7 @@ SUBDIR += qt5-wayland SUBDIR += qtawesome SUBDIR += qtpbfimageplugin + SUBDIR += qtqr SUBDIR += quat SUBDIR += quat-gui SUBDIR += quesa diff --git a/graphics/qtqr/Makefile b/graphics/qtqr/Makefile new file mode 100644 index 000000000000..bdbf1e2d5eb9 --- /dev/null +++ b/graphics/qtqr/Makefile @@ -0,0 +1,39 @@ +# Created by: Emanuel Haupt <ehaupt@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= qtqr +DISTVERSION= 2.0.bzr39 +CATEGORIES= graphics python +MASTER_SITES= LOCAL/ehaupt +DISTNAME= qr-tools-${DISTVERSION} + +MAINTAINER= ehaupt@FreeBSD.org +COMMENT= GUI that makes easy creating and decoding the QR Codes + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENCE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}zbar-py>=1.0.4:graphics/py-zbar-py@${PY_FLAVOR} + +USES= desktop-file-utils pyqt:5 python:3.6+ shebangfix +USE_PYQT= core_run gui_run network_run widgets_run +USE_PYTHON= autoplist distutils + +SHEBANG_FILES= qtqr.py + +NO_BUILD= yes + +OPTIONS_DEFINE= EXAMPLES + +post-install: + ${INSTALL_SCRIPT} ${WRKSRC}/qtqr.py ${STAGEDIR}${PREFIX}/bin/qtqr + ${INSTALL_DATA} ${WRKSRC}/icon.png ${STAGEDIR}${PREFIX}/share/pixmaps/qtqr.png + ${INSTALL_DATA} ${WRKSRC}/qtqr.desktop ${STAGEDIR}${DESKTOPDIR} + ${MKDIR} ${STAGEDIR}${PREFIX}/share/qt5/translations + ${INSTALL_DATA} ${WRKSRC}/*.qm ${STAGEDIR}${PREFIX}/share/qt5/translations + +post-install-EXAMPLES-on: + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/samples/* ${STAGEDIR}${EXAMPLESDIR} + +.include <bsd.port.mk> diff --git a/graphics/qtqr/distinfo b/graphics/qtqr/distinfo new file mode 100644 index 000000000000..ffdb272542e1 --- /dev/null +++ b/graphics/qtqr/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1595005514 +SHA256 (qr-tools-2.0.bzr39.tar.gz) = 435d399839dedb93670bf85a306ac004fac4cc553f1de226fe0b769921b7224e +SIZE (qr-tools-2.0.bzr39.tar.gz) = 280645 diff --git a/graphics/qtqr/files/patch-qrtools.py b/graphics/qtqr/files/patch-qrtools.py new file mode 100644 index 000000000000..24f3ceb102fd --- /dev/null +++ b/graphics/qtqr/files/patch-qrtools.py @@ -0,0 +1,53 @@ +--- qrtools.py.orig 2020-07-15 18:00:04 UTC ++++ qrtools.py +@@ -29,6 +29,7 @@ import sys + import time + import shutil + import hashlib ++import numpy as np + try: + import zbar + except ImportError: +@@ -210,35 +211,19 @@ class QR(object): + def decode(self, filename=None, image=None): + self.filename = filename or self.filename + if self.filename is not None or image is not None: +- scanner = zbar.ImageScanner() +- # configure the reader +- scanner.parse_config('enable') +- # obtain image data +- if image is not None: +- pil = image.convert('L') +- else: +- pil = Image.open(self.filename).convert('L') +- width, height = pil.size +- try: +- raw = pil.tostring() +- except: +- raw = pil.tobytes() +- # wrap image data +- image = zbar.Image(width, height, 'Y800', raw) +- # scan the image for barcodes ++ image = np.array(Image.open(self.filename).convert('L')) ++ scanner = zbar.Scanner() + result = scanner.scan(image) ++ + # extract results + if result == 0: + return False + else: +- for symbol in image: +- pass +- # clean up + del(image) +- #Assuming data is encoded in utf8 +- self.data = symbol.data +- self.data_type = self.data_recognise() +- return True ++ for res in result: ++ self.data = res.data.decode('utf8') ++ self.data_type = self.data_recognise() ++ return True + else: + return False + diff --git a/graphics/qtqr/pkg-descr b/graphics/qtqr/pkg-descr new file mode 100644 index 000000000000..6eae53315ac2 --- /dev/null +++ b/graphics/qtqr/pkg-descr @@ -0,0 +1,5 @@ +QtQR is a Qt based software that let's you generate QR Codes easily, scan an +image file for QR Codes and decode them or use your webcam to scan a printed +one. + +WWW: https://launchpad.net/qr-tools diff --git a/graphics/qtqr/pkg-plist b/graphics/qtqr/pkg-plist new file mode 100644 index 000000000000..2482d7f13ea7 --- /dev/null +++ b/graphics/qtqr/pkg-plist @@ -0,0 +1,23 @@ +bin/qtqr +share/applications/qtqr.desktop +share/pixmaps/qtqr.png +share/qt5/translations/qtqr_de_DE.qm +share/qt5/translations/qtqr_en_GB.qm +share/qt5/translations/qtqr_es.qm +share/qt5/translations/qtqr_es_AR.qm +share/qt5/translations/qtqr_fr.qm +share/qt5/translations/qtqr_is_IS.qm +share/qt5/translations/qtqr_it_IT.qm +share/qt5/translations/qtqr_ja.qm +share/qt5/translations/qtqr_ru.qm +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/bookmark.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/email-address.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/email-message.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/geo.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mms.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/phonebook.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sms.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/telephone.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text-non-ascii.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text-plain.png +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/url.png |