multimedia/w_scan2: add working fork of expiring multimedia/w_scan

w_scan2 is a small channel scan tool which generates ATSC, DVB-C,
DVB-S/S2 and DVB-T/T2 channels.conf files.

It's based on the old "scan" tool from linuxtv-dvb-apps-1.1.0. The
differences are:
* no initial tuning data needed, because scanning without this data
  is exactly what a scan tool like this should do.
* it detects automatically which DVB/ATSC card to use.
* much more output formats, interfacing to other dtv software.

w_scan2 is a fork of the original w_scan from
https://www.gen2vdr.de/wirbel/w_scan/index2.html

Main changes from w_scan to w_scan2:
* keep duplicate transponders by default because a stronger transponder
  with the same ID might have a higher frequency and be discarded simply
  because it's scanned later. Also don't replace the current transponder
  with an advertised one by default. The latter may have a lower signal
  strength. More details here:
  https://stefantalpalaru.wordpress.com/2016/02/04/scan-all-the-things/
  The old behaviour can be enabled with -d (--delete-duplicate-transponders).
* re-enable VHF band III in Europe

WWW: https://github.com/stefantalpalaru/w_scan2

Suggested by:	hselasky
This commit is contained in:
Rene Ladan 2020-08-22 16:08:11 +00:00
parent 740666f50d
commit 35abb7189a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=545773
5 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# Created by: Juergen Lock <nox@FreeBSD.org>
# $FreeBSD$
PORTNAME= w_scan2
PORTVERSION= 1.0.9
CATEGORIES= multimedia
MAINTAINER= rene@FreeBSD.org
COMMENT= Perform frequency scans for DVB and ATSC transmissions
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= v4l_compat>=1.0.20120501:multimedia/v4l_compat
GNU_CONFIGURE= yes
USES= autoreconf gettext iconv localbase
LDFLAGS+= ${ICONV_LIB}
USE_GITHUB= yes
GH_ACCOUNT= stefantalpalaru
PORTDOCS= COPYING ChangeLog README.md
PLIST_FILES= bin/${PORTNAME} \
man/man1/${PORTNAME}.1.gz
OPTIONS_DEFINE= DOCS
post-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1598103820
SHA256 (stefantalpalaru-w_scan2-1.0.9_GH0.tar.gz) = a2718e922302297f845961af54e615852be4f575bea63f3a90ed19a04d955f36
SIZE (stefantalpalaru-w_scan2-1.0.9_GH0.tar.gz) = 232486

View File

@ -0,0 +1,35 @@
--- src/char-coding.c.orig 2020-08-22 13:49:25 UTC
+++ src/char-coding.c
@@ -340,14 +340,31 @@ void char_coding(char **inbuf, size_t * inbytesleft, c
// Fallback method: copy all printable chars from *inbuf to *outbuf.
size_t i;
size_t pos = 0;
-
+#ifdef __FreeBSD__
+ int to_utf = user_charset_id < iconv_codes_count() &&
+ !strncmp(iconv_codes[user_charset_id], "UTF", sizeof "UTF" - 1);
+#endif
for (i = 0; i < nsrc; i++) {
switch ((uint8_t) * (psrc + i)) {
//case 0x20 ... 0x7E:
//case 0xA0 ... 0xFF:
// printable chars ISO-6937-2
// Figure A.1: Character code table 00 - Latin alphabet
+#ifdef __FreeBSD__
+ case 0x80 ... 0xFF:
+ // the iconv used on FreeBSD doesn't know about the
+ // default DVB charset ISO-6397-2 so we'll end up here
+ // for 8-bit chars in channel names that are (usually
+ // wrongly) specified as the default charset - and if
+ // we are converting to UTF those will create invalid
+ // encodings.
+ if (to_utf)
+ continue;
+ // FALLTHRU
+ case 0x01 ... 0x7F:
+#else
case 0x01 ... 0xFF: // 20121202: don't touch anything; leave it as it is.
+#endif
*(pdest + pos++) = *(psrc + i);
default:;
}

View File

@ -0,0 +1,10 @@
--- src/si_types.h.orig 2020-08-22 13:49:25 UTC
+++ src/si_types.h
@@ -23,6 +23,7 @@
#define __SI_TYPES_H
#include <stdint.h>
+#include <sys/types.h>
#include "descriptors.h"
#include "tools.h"

View File

@ -0,0 +1,24 @@
w_scan2 is a small channel scan tool which generates ATSC, DVB-C,
DVB-S/S2 and DVB-T/T2 channels.conf files.
It's based on the old "scan" tool from linuxtv-dvb-apps-1.1.0. The
differences are:
* no initial tuning data needed, because scanning without this data
is exactly what a scan tool like this should do.
* it detects automatically which DVB/ATSC card to use.
* much more output formats, interfacing to other dtv software.
w_scan2 is a fork of the original w_scan from
https://www.gen2vdr.de/wirbel/w_scan/index2.html
Main changes from w_scan to w_scan2:
* keep duplicate transponders by default because a stronger transponder
with the same ID might have a higher frequency and be discarded simply
because it's scanned later. Also don't replace the current transponder
with an advertised one by default. The latter may have a lower signal
strength. More details here:
https://stefantalpalaru.wordpress.com/2016/02/04/scan-all-the-things/
The old behaviour can be enabled with -d (--delete-duplicate-transponders).
* re-enable VHF band III in Europe
WWW: https://github.com/stefantalpalaru/w_scan2