Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2019 06:34:43 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r518077 - in head/misc/openhantek: . files
Message-ID:  <201911210634.xAL6YhL4081886@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Thu Nov 21 06:34:43 2019
New Revision: 518077
URL: https://svnweb.freebsd.org/changeset/ports/518077

Log:
  misc/openhantek: Change to a more mantained fork OpenHantek/OpenHantek6022
  
  This fork has some FreeBSD-specific patches in it.
  Add the patch that removes libusb_set_auto_detach_kernel_driver because it causes libusb_claim_interface to fail.
  
  Made sure that it works with the DSO-6022BE device.

Added:
  head/misc/openhantek/files/
  head/misc/openhantek/files/patch-openhantek_src_usb_uploadFirmware.cpp   (contents, props changed)
  head/misc/openhantek/pkg-message   (contents, props changed)
Modified:
  head/misc/openhantek/Makefile
  head/misc/openhantek/distinfo

Modified: head/misc/openhantek/Makefile
==============================================================================
--- head/misc/openhantek/Makefile	Thu Nov 21 05:37:53 2019	(r518076)
+++ head/misc/openhantek/Makefile	Thu Nov 21 06:34:43 2019	(r518077)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	openhantek
-DISTVERSION=	g20190903
+DISTVERSION=	3.0.0
 CATEGORIES=	misc
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -15,13 +15,10 @@ LIB_DEPENDS=	libfftw3.so:math/fftw3
 USES=		cmake compiler:c++11-lang gl localbase qt:5
 USE_GITHUB=	yes
 GH_ACCOUNT=	OpenHantek
-GH_TAGNAME=	e7e0c7b
-USE_QT=		core gui opengl printsupport widgets buildtools_build qmake_build
+GH_PROJECT=	OpenHantek6022 # there's also the openhantek account
+USE_QT=		core gui opengl printsupport widgets buildtools_build linguist_build qmake_build
 USE_GL=		gl glu
 
 PLIST_FILES=	bin/OpenHantek
-
-post-patch:
-	@${GREP} -rl "<libusb-1.0/libusb.h>" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} 's|<libusb-1.0/libusb.h>|<libusb.h>|'
 
 .include <bsd.port.mk>

Modified: head/misc/openhantek/distinfo
==============================================================================
--- head/misc/openhantek/distinfo	Thu Nov 21 05:37:53 2019	(r518076)
+++ head/misc/openhantek/distinfo	Thu Nov 21 06:34:43 2019	(r518077)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1573368045
-SHA256 (OpenHantek-openhantek-g20190903-e7e0c7b_GH0.tar.gz) = c4237a4a84f0efaa889bda570f442eb08bcf1b157f0aae8da0979e6fd59d9ef5
-SIZE (OpenHantek-openhantek-g20190903-e7e0c7b_GH0.tar.gz) = 11613267
+TIMESTAMP = 1574309115
+SHA256 (OpenHantek-OpenHantek6022-3.0.0_GH0.tar.gz) = 7c756a6d3861b08a48a15fe14f633018c7ce8fba2f6a4961d5b403144f71f9e9
+SIZE (OpenHantek-OpenHantek6022-3.0.0_GH0.tar.gz) = 19666574

Added: head/misc/openhantek/files/patch-openhantek_src_usb_uploadFirmware.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/openhantek/files/patch-openhantek_src_usb_uploadFirmware.cpp	Thu Nov 21 06:34:43 2019	(r518077)
@@ -0,0 +1,12 @@
+--- openhantek/src/usb/uploadFirmware.cpp.orig	2019-11-21 06:06:23 UTC
++++ openhantek/src/usb/uploadFirmware.cpp
+@@ -39,7 +39,9 @@ bool UploadFirmware::startUpload(USBDevice *device) {
+     temp_firmware_path->open();
+ 
+     /* We need to claim the first interface */
++#if !defined(__FreeBSD__)
+     libusb_set_auto_detach_kernel_driver(handle, 1);
++#endif
+     int status = libusb_claim_interface(handle, 0);
+     if (status != LIBUSB_SUCCESS) {
+         errorMessage = TR("libusb_claim_interface() failed: %1").arg(libusb_error_name(status));

Added: head/misc/openhantek/pkg-message
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/misc/openhantek/pkg-message	Thu Nov 21 06:34:43 2019	(r518077)
@@ -0,0 +1,38 @@
+[
+{ type: install
+  message: <<EOM
+You installed OpenHantek: the client for Hantek PC-oscilloscope.
+
+In order for OpenHantek to work you need:
+1. Have compatible device: DSO-6022, DSO-2020, etc.
+2. Make sure that your USB device has permissions for your user.
+   You can achieve this by adding a records like this to your
+   /etc/devd.conf:
+
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"	"0x04b4";
+	match "product"	"0x6022";
+	action "/usr/sbin/chown {your-user}:users /dev/usb/8.5.*";
+};
+notify 100 {
+	match "system"		"USB";
+	match "subsystem"	"DEVICE";
+	match "type"		"ATTACH";
+	match "vendor"	"0x04b5";
+	match "product"	"0x6022";
+	action "/usr/sbin/chown {your-user}:users /dev/usb/8.5.*";
+};
+
+The "action" above doesn't use $device-name due to:
+https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242111
+
+Also please note that devices like this have two vendor/product id
+combinations, before and after loading the firmware, hence two
+commands above.
+
+EOM
+}
+]



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