Index: head/comms/nanovna-saver/Makefile =================================================================== --- head/comms/nanovna-saver/Makefile (revision 552597) +++ head/comms/nanovna-saver/Makefile (revision 552598) @@ -1,30 +1,32 @@ # $FreeBSD$ PORTNAME= nanovna-saver DISTVERSIONPREFIX= v -DISTVERSION= 0.2.2 -PORTREVISION= 2 +DISTVERSION= 0.3.7 CATEGORIES= comms hamradio MAINTAINER= hamradio@FreeBSD.org COMMENT= Multiplatform tool to save Touchstone files from the NanoVNA LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE PY_DEPENDS= ${PYNUMPY} \ ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pyserial>0:comms/py-pyserial@${PY_FLAVOR} BUILD_DEPENDS= ${PY_DEPENDS} RUN_DEPENDS= ${PY_DEPENDS} USES= python:3.3+ pyqt:5 USE_PYTHON= distutils autoplist noflavors USE_PYQT= core_run gui_run widgets_run USE_GITHUB= yes GH_ACCOUNT= mihtjel NO_ARCH= yes + +post-extract: + ${CP} ${FILESDIR}/Sysctl.py ${WRKSRC}/NanoVNASaver/Hardware/ .include Index: head/comms/nanovna-saver/distinfo =================================================================== --- head/comms/nanovna-saver/distinfo (revision 552597) +++ head/comms/nanovna-saver/distinfo (revision 552598) @@ -1,3 +1,3 @@ -TIMESTAMP = 1578812631 -SHA256 (mihtjel-nanovna-saver-v0.2.2_GH0.tar.gz) = 82fa37fcd487cbafebd07751f76fc5bad42f7e6f1276008f5463f0256e17748f -SIZE (mihtjel-nanovna-saver-v0.2.2_GH0.tar.gz) = 178819 +TIMESTAMP = 1602611094 +SHA256 (mihtjel-nanovna-saver-v0.3.7_GH0.tar.gz) = 4b2cb4e736855452ef0fcc198f4f467ab042857b7844aac973fa99de7eb128ad +SIZE (mihtjel-nanovna-saver-v0.3.7_GH0.tar.gz) = 359208 Property changes on: head/comms/nanovna-saver/distinfo ___________________________________________________________________ Modified: fbsd:nokeywords ## -1 +1 ## -on \ No newline at end of property +1 \ No newline at end of property Index: head/comms/nanovna-saver/files/patch-NanoVNASaver_NanoVNASaver.py =================================================================== --- head/comms/nanovna-saver/files/patch-NanoVNASaver_NanoVNASaver.py (revision 552597) +++ head/comms/nanovna-saver/files/patch-NanoVNASaver_NanoVNASaver.py (nonexistent) @@ -1,15 +0,0 @@ ---- NanoVNASaver/NanoVNASaver.py.orig 2019-12-04 11:05:36 UTC -+++ NanoVNASaver/NanoVNASaver.py -@@ -540,11 +540,7 @@ class NanoVNASaver(QtWidgets.QWidget): - return_ports = [] - device_list = list_ports.comports() - for d in device_list: -- if (d.vid == VID and -- d.pid == PID): -- port = d.device -- logger.info("Found NanoVNA (%04x %04x) on port %s", d.vid, d.pid, d.device) -- return_ports.append(port) -+ return_ports.append(d.device) - return return_ports - - def exportFileS1P(self): Property changes on: head/comms/nanovna-saver/files/patch-NanoVNASaver_NanoVNASaver.py ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -on \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/comms/nanovna-saver/files/Sysctl.py =================================================================== --- head/comms/nanovna-saver/files/Sysctl.py (nonexistent) +++ head/comms/nanovna-saver/files/Sysctl.py (revision 552598) @@ -0,0 +1,23 @@ +import re +from ctypes import * +from ctypes.util import find_library + +libc = cdll.LoadLibrary(find_library("c")) +sysctlbyname = libc.sysctlbyname + +def posix_sysctlbyname(name): + _len = c_uint(0) + result = sysctlbyname(name,None , byref(_len), None, 0) + _mem = create_string_buffer(_len.value) + result = sysctlbyname(name, _mem, byref(_len), None, 0) + if result != 0: + raise Exception('sysctlbyname returned with error %s' % result) + return _mem.value + +def usb_vid_pid(name): + digit = (re.search(r'\d',name)).group() + result = (posix_sysctlbyname(b'dev.umodem.'+bytes(digit,'ascii')+b'.%pnpinfo')).decode('ascii') + items=result.split(' ') + vendor=int(items[0].split('=')[1],0) + product=int(items[1].split('=')[1],0) + return([vendor,product]) Property changes on: head/comms/nanovna-saver/files/Sysctl.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +1 \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py =================================================================== --- head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py (nonexistent) +++ head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py (revision 552598) @@ -0,0 +1,33 @@ +--- NanoVNASaver/Hardware/Hardware.py.orig 2020-08-13 17:01:29 UTC ++++ NanoVNASaver/Hardware/Hardware.py +@@ -32,6 +32,7 @@ from NanoVNASaver.Hardware.NanoVNA_H import NanoVNA_H + from NanoVNASaver.Hardware.NanoVNA_H4 import NanoVNA_H4 + from NanoVNASaver.Hardware.NanoVNA_V2 import NanoVNA_V2 + from NanoVNASaver.Hardware.Serial import drain_serial, Interface ++from NanoVNASaver.Hardware.Sysctl import usb_vid_pid + + logger = logging.getLogger(__name__) + +@@ -61,8 +62,12 @@ def get_interfaces() -> List[Interface]: + interfaces = [] + # serial like usb interfaces + for d in list_ports.comports(): +- if platform.system() == 'Windows' and d.vid is None: +- d = _fix_v2_hwinfo(d) ++ if platform.system() == 'FreeBSD': ++ logger.debug("Found FreeBSD USB port %s", d.device) ++ vid_pid = usb_vid_pid(d.device) ++ d.vid = vid_pid[0] ++ d.pid = vid_pid[1] ++ + for t in USBDEVICETYPES: + if d.vid != t.vid or d.pid != t.pid: + continue +@@ -72,7 +77,6 @@ def get_interfaces() -> List[Interface]: + iface.port = d.device + interfaces.append(iface) + return interfaces +- + + def get_VNA(iface: Interface) -> 'VNA': + # serial_port.timeout = TIMEOUT Property changes on: head/comms/nanovna-saver/files/patch-NanoVNASaver_Hardware_Hardware.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +1 \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/comms/nanovna-saver/files/patch-setup.py =================================================================== --- head/comms/nanovna-saver/files/patch-setup.py (revision 552597) +++ head/comms/nanovna-saver/files/patch-setup.py (revision 552598) @@ -1,36 +1,16 @@ ---- setup.py.orig 2019-12-04 11:05:36 UTC +--- setup.py.orig 2020-08-13 17:01:29 UTC +++ setup.py -@@ -15,10 +15,11 @@ - # along with this program. If not, see . - - import sys -+import io - from NanoVNASaver.about import version - --if sys.version_info < (3, 7): -- print("You need at least Python 3.7 for this application!") -+if sys.version_info < (3, 3): -+ print("You need at least Python 3.3 for this application!") - if sys.version_info[0] < 3: - print("try running with python3 {}".format(" ".join(sys.argv))) - sys.exit(1) -@@ -30,7 +31,7 @@ except ImportError: - print("Try installing them with pip install setuptools") - sys.exit(1) - --with open("README.md", "r") as fh: -+with io.open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - - setup( -@@ -48,10 +49,4 @@ setup( +@@ -37,12 +37,5 @@ setup( + 'console_scripts': [ 'NanoVNASaver = NanoVNASaver.__main__:main' ], - }, +- }, - install_requires=[ - 'pyserial', - 'PyQt5', - 'numpy', -- 'scipy' +- 'scipy<1.5', +- 'cython', - ], ++ } ) Property changes on: head/comms/nanovna-saver/files/patch-setup.py ___________________________________________________________________ Modified: fbsd:nokeywords ## -1 +1 ## -on \ No newline at end of property +1 \ No newline at end of property