Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jul 2020 07:32:22 +0000 (UTC)
From:      Emanuel Haupt <ehaupt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r542479 - in head/graphics: . qtqr qtqr/files
Message-ID:  <202007180732.06I7WM4a077280@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ehaupt
Date: Sat Jul 18 07:32:22 2020
New Revision: 542479
URL: https://svnweb.freebsd.org/changeset/ports/542479

Log:
  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

Added:
  head/graphics/qtqr/
  head/graphics/qtqr/Makefile   (contents, props changed)
  head/graphics/qtqr/distinfo   (contents, props changed)
  head/graphics/qtqr/files/
  head/graphics/qtqr/files/patch-qrtools.py   (contents, props changed)
  head/graphics/qtqr/pkg-descr   (contents, props changed)
  head/graphics/qtqr/pkg-plist   (contents, props changed)
Modified:
  head/graphics/Makefile

Modified: head/graphics/Makefile
==============================================================================
--- head/graphics/Makefile	Sat Jul 18 07:31:28 2020	(r542478)
+++ head/graphics/Makefile	Sat Jul 18 07:32:22 2020	(r542479)
@@ -908,6 +908,7 @@
     SUBDIR += qt5-wayland
     SUBDIR += qtawesome
     SUBDIR += qtpbfimageplugin
+    SUBDIR += qtqr
     SUBDIR += quat
     SUBDIR += quat-gui
     SUBDIR += quesa

Added: head/graphics/qtqr/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/qtqr/Makefile	Sat Jul 18 07:32:22 2020	(r542479)
@@ -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>

Added: head/graphics/qtqr/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/qtqr/distinfo	Sat Jul 18 07:32:22 2020	(r542479)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1595005514
+SHA256 (qr-tools-2.0.bzr39.tar.gz) = 435d399839dedb93670bf85a306ac004fac4cc553f1de226fe0b769921b7224e
+SIZE (qr-tools-2.0.bzr39.tar.gz) = 280645

Added: head/graphics/qtqr/files/patch-qrtools.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/qtqr/files/patch-qrtools.py	Sat Jul 18 07:32:22 2020	(r542479)
@@ -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
+ 

Added: head/graphics/qtqr/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/qtqr/pkg-descr	Sat Jul 18 07:32:22 2020	(r542479)
@@ -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

Added: head/graphics/qtqr/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/qtqr/pkg-plist	Sat Jul 18 07:32:22 2020	(r542479)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007180732.06I7WM4a077280>