Sat May 7 06:00:18 2022 UTC ()
comms/minimodem: import minimodem-0.24

Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.

Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.

Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using
radio, telephone, or another audio communications medium.


(wiz)
diff -r0 -r1.1 pkgsrc/comms/minimodem/DESCR
diff -r0 -r1.1 pkgsrc/comms/minimodem/Makefile
diff -r0 -r1.1 pkgsrc/comms/minimodem/PLIST
diff -r0 -r1.1 pkgsrc/comms/minimodem/distinfo
diff -r0 -r1.1 pkgsrc/comms/minimodem/patches/patch-configure
diff -r0 -r1.1 pkgsrc/comms/minimodem/patches/patch-src_simpleaudio-alsa.c

File Added: pkgsrc/comms/minimodem/DESCR
Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, using various framing protocols.
It acts a general-purpose software FSK modem, and includes support for
various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.

Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.

Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using
radio, telephone, or another audio communications medium.

File Added: pkgsrc/comms/minimodem/Makefile
# $NetBSD: Makefile,v 1.1 2022/05/07 06:00:17 wiz Exp $

DISTNAME=	minimodem-0.24
CATEGORIES=	comms audio
MASTER_SITES=	http://www.whence.com/minimodem/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.whence.com/minimodem/
COMMENT=	General-purpose software audio FSK modem
LICENSE=	gnu-gpl-v3 # or later

GNU_CONFIGURE=	yes

USE_TOOLS+=	pkg-config

.include "../../audio/alsa-lib/buildlink3.mk"
.include "../../audio/libsndfile/buildlink3.mk"
.include "../../audio/pulseaudio/buildlink3.mk"
.include "../../math/fftw/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/comms/minimodem/PLIST
@comment $NetBSD: PLIST,v 1.1 2022/05/07 06:00:17 wiz Exp $
bin/minimodem
man/man1/minimodem.1

File Added: pkgsrc/comms/minimodem/distinfo
$NetBSD: distinfo,v 1.1 2022/05/07 06:00:17 wiz Exp $

BLAKE2s (minimodem-0.24.tar.gz) = e625176fcb04c852d3cfe260e34a8640705ae6e2a55b8b5ae40a3d502c070f56
SHA512 (minimodem-0.24.tar.gz) = 5c3a5e6f185d4b09c5f24d776393f2e2d5d787c097c44490905119513b9b39db53b7f2f7e624a4b527e8e8e827a5b99af6b0df5ca525046f60b49fe9ba2b0ceb
Size (minimodem-0.24.tar.gz) = 159508 bytes
SHA1 (patch-configure) = 51c686781707e34f29126f53d98e6b1f1abffb69
SHA1 (patch-src_simpleaudio-alsa.c) = 02c80a9c528fc01c8620e70507558492d0647022

File Added: pkgsrc/comms/minimodem/patches/patch-configure
$NetBSD: patch-configure,v 1.1 2022/05/07 06:00:17 wiz Exp $

Fix unportable test(1) operator.

--- configure.orig	2016-04-23 17:48:01.000000000 +0000
+++ configure
@@ -3596,7 +3596,7 @@ if test "${with_alsa+set}" = set; then :
   withval=$with_alsa;
 fi
 
-if test "x$with_alsa" == "xno"; then :
+if test "x$with_alsa" = "xno"; then :
 
     use_alsa=0
 
@@ -3619,7 +3619,7 @@ if test "${with_pulseaudio+set}" = set; 
   withval=$with_pulseaudio;
 fi
 
-if test "x$with_pulseaudio" == "xno"; then :
+if test "x$with_pulseaudio" = "xno"; then :
 
     use_pulseaudio=0
 
@@ -3642,7 +3642,7 @@ if test "${with_sndfile+set}" = set; the
   withval=$with_sndfile;
 fi
 
-if test "x$with_sndfile" == "xno"; then :
+if test "x$with_sndfile" = "xno"; then :
 
     use_sndfile=0
 
@@ -3665,7 +3665,7 @@ if test "${with_benchmarks+set}" = set; 
   withval=$with_benchmarks;
 fi
 
-if test "x$with_benchmarks" == "xno"; then :
+if test "x$with_benchmarks" = "xno"; then :
 
     use_benchmarks=0
 

File Added: pkgsrc/comms/minimodem/patches/patch-src_simpleaudio-alsa.c
$NetBSD: patch-src_simpleaudio-alsa.c,v 1.1 2022/05/07 06:00:17 wiz Exp $

Non-Linux portability.

--- src/simpleaudio-alsa.c.orig	2015-04-22 23:56:58.000000000 +0000
+++ src/simpleaudio-alsa.c
@@ -59,7 +59,11 @@ sa_alsa_read( simpleaudio *sa, void *buf
 	    snd_pcm_prepare(pcm);
 	} else  {
 	    fprintf(stderr, "snd_pcm_readi: %s\n", snd_strerror(r));
+#if defined(ESTRPIPE)
 	    if (r == -EAGAIN || r== -ESTRPIPE)
+#else
+	    if (r == -EAGAIN)
+#endif
 		snd_pcm_wait(pcm, 1000);
 	    else
 		return r;