aboutsummaryrefslogtreecommitdiffstats
path: root/comms/linpsk
diff options
context:
space:
mode:
authorshurd <shurd@FreeBSD.org>2015-01-10 03:33:26 +0800
committershurd <shurd@FreeBSD.org>2015-01-10 03:33:26 +0800
commit15e717c038cd69268f057098f52ded65f10161e0 (patch)
tree0e76669c4432ba2f5595e45faec77075963ed176 /comms/linpsk
parent5f592f37bb90680c05e9396fd5eae0f636e71de8 (diff)
downloadfreebsd-ports-gnome-15e717c038cd69268f057098f52ded65f10161e0.tar.gz
freebsd-ports-gnome-15e717c038cd69268f057098f52ded65f10161e0.tar.zst
freebsd-ports-gnome-15e717c038cd69268f057098f52ded65f10161e0.zip
Re-create comms/linpsk
Simple Qt PSK31, RTTY, and MSK31 client
Diffstat (limited to 'comms/linpsk')
-rw-r--r--comms/linpsk/Makefile33
-rw-r--r--comms/linpsk/distinfo2
-rw-r--r--comms/linpsk/files/patch-src_csound.cpp80
-rw-r--r--comms/linpsk/files/patch-src_csound.h19
-rw-r--r--comms/linpsk/files/patch-src_textinput.cpp11
-rw-r--r--comms/linpsk/files/patch-src_waveinput.cpp11
-rw-r--r--comms/linpsk/pkg-descr16
7 files changed, 172 insertions, 0 deletions
diff --git a/comms/linpsk/Makefile b/comms/linpsk/Makefile
new file mode 100644
index 000000000000..8516eb4da745
--- /dev/null
+++ b/comms/linpsk/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME= linpsk
+PORTVERSION= 1.2
+CATEGORIES= comms hamradio
+MASTER_SITES= SF
+MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= hamradio@freebsd.org
+COMMENT= Simple Qt PSK31, RTTY, and MSK31 client
+
+LIB_DEPENDS= libfftw3.so:${PORTSDIR}/math/fftw3 \
+ libasound.so:${PORTSDIR}/audio/alsa-lib
+
+USES= qmake tar:tgz
+USE_QT4= gui network corelib moc_build uic_build rcc_build qmake_build
+DESKTOP_ENTRIES="LinPsk" "${COMMENT}" \
+ "${DATADIR}/linpsk.png" "linpsk" "Audio;HamRadio;" \
+ false
+
+PLIST_FILES= bin/linpsk \
+ %%DATADIR%%/linpsk.png
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>|<!-- & -->|g' \
+ ${WRKSRC}/gui/*.ui
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/images/linpsk.png ${STAGEDIR}${DATADIR}
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/linpsk
+
+.include <bsd.port.mk>
diff --git a/comms/linpsk/distinfo b/comms/linpsk/distinfo
new file mode 100644
index 000000000000..9e9518d9ba4c
--- /dev/null
+++ b/comms/linpsk/distinfo
@@ -0,0 +1,2 @@
+SHA256 (linpsk-1.2.tgz) = be02a5dcb2168ad60d1e450fe77346a9aa8480669fe11e209fc94f26835aaec8
+SIZE (linpsk-1.2.tgz) = 126171
diff --git a/comms/linpsk/files/patch-src_csound.cpp b/comms/linpsk/files/patch-src_csound.cpp
new file mode 100644
index 000000000000..e9683dd3f7c0
--- /dev/null
+++ b/comms/linpsk/files/patch-src_csound.cpp
@@ -0,0 +1,80 @@
+--- src/csound.cpp.orig 2013-12-24 23:45:41.000000000 -0800
++++ src/csound.cpp 2015-01-09 11:00:21.000000000 -0800
+@@ -21,7 +21,7 @@
+
+ using namespace std;
+ extern Parameter settings;
+-CSound::CSound ( int ptt = -1 ) : Input ( ptt )
++CSound::CSound ( int ptt ) : Input ( ptt )
+ {
+ started = false;
+ output = false;
+@@ -41,7 +41,13 @@
+ return 0;
+ if ( anzahl > available )
+ return 0;
+- memcpy ( sample, &buffer[readPointer], anzahl*sizeof ( double ) ) ;
++ for (int i=0; i<anzahl; i++) {
++ sample[i] = (double)buffer[readPointer+i] / 0x7fffffff;
++ if (sample[i] < -1.0)
++ sample[i] = -1.0;
++ else if(sample[i] > 1.0)
++ sample[i] = 1.0;
++ }
+ LockPointers.lock();
+ available -= anzahl;
+ free += anzahl;
+@@ -101,10 +107,10 @@
+ return false;
+ }
+ /* Set the sample format */
+- err = snd_pcm_hw_params_set_format ( handle, hwparams, SND_PCM_FORMAT_FLOAT_LE );
++ err = snd_pcm_hw_params_set_format ( handle, hwparams, SND_PCM_FORMAT_S32 );
+ if ( err < 0 )
+ {
+- *errorstring = QString ( "Sample format Float not available : " ) + QString ( snd_strerror ( err ) );
++ *errorstring = QString ( "Sample format Signed 32-bit not available : " ) + QString ( snd_strerror ( err ) );
+ return false;
+ }
+ /* Set the count of channels, most soundcards only support stereo */
+@@ -229,10 +235,10 @@
+ return false;
+ }
+ /* Set the sample format */
+- err = snd_pcm_hw_params_set_format ( handle, hwparams, SND_PCM_FORMAT_FLOAT_LE );
++ err = snd_pcm_hw_params_set_format ( handle, hwparams, SND_PCM_FORMAT_S32 );
+ if ( err < 0 )
+ {
+- *errorstring = QString ( "Sample format Float not available : " ) + QString ( snd_strerror ( err ) );
++ *errorstring = QString ( "Sample format Signed 32-bit not available : " ) + QString ( snd_strerror ( err ) );
+ return false;
+ }
+ /* Set the count of channels */
+@@ -305,7 +311,8 @@
+ {
+ if ( anzahl <= free )
+ {
+- memcpy ( &buffer[freePointer], sample, anzahl*sizeof ( double ) );
++ for (int i=0; i<anzahl; i++)
++ buffer[freePointer+i] = sample[i] * 0x7fffffff;
+ LockPointers.lock();
+ toBePlayed += anzahl;
+ free -= anzahl;
+@@ -394,7 +401,7 @@
+ void CSound::record()
+ {
+ int toBeRead, err;
+- float SampleBuffer[256];
++ int32_t SampleBuffer[256];
+ qDebug ( "Start recording" );
+ while ( started )
+ {
+@@ -447,7 +454,7 @@
+
+ void CSound::play()
+ {
+- float SampleBuffer[256], x;
++ int32_t SampleBuffer[256], x;
+ bool signaled;
+ int err, laenge;
+ laenge = 128;
diff --git a/comms/linpsk/files/patch-src_csound.h b/comms/linpsk/files/patch-src_csound.h
new file mode 100644
index 000000000000..d2cd129171e5
--- /dev/null
+++ b/comms/linpsk/files/patch-src_csound.h
@@ -0,0 +1,19 @@
+--- src/csound.h.orig 2013-12-24 23:45:41.000000000 -0800
++++ src/csound.h 2015-01-07 07:38:09.000000000 -0800
+@@ -22,6 +22,7 @@
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <inttypes.h>
+
+ #include <QMutex>
+ #include <QWaitCondition>
+@@ -49,7 +50,7 @@
+ private: // Private attributes
+ snd_pcm_t *handle;
+ bool output;
+- double buffer[2*BUF_SIZE]; // 16 bit , stereo
++ int32_t buffer[2*BUF_SIZE]; // 16 bit , stereo
+ QMutex LockPointers;
+ QWaitCondition WakeUp;
+ void record();
diff --git a/comms/linpsk/files/patch-src_textinput.cpp b/comms/linpsk/files/patch-src_textinput.cpp
new file mode 100644
index 000000000000..b6ac51915ff4
--- /dev/null
+++ b/comms/linpsk/files/patch-src_textinput.cpp
@@ -0,0 +1,11 @@
+--- src/textinput.cpp.orig 2015-01-07 06:35:27.000000000 -0800
++++ src/textinput.cpp 2015-01-07 06:35:36.000000000 -0800
+@@ -22,7 +22,7 @@
+ extern Parameter settings;
+ extern int errno;
+
+-TextInput::TextInput ( int ptt = -1 ) : Input ( ptt )
++TextInput::TextInput ( int ptt ) : Input ( ptt )
+ {
+ }
+ TextInput::~TextInput()
diff --git a/comms/linpsk/files/patch-src_waveinput.cpp b/comms/linpsk/files/patch-src_waveinput.cpp
new file mode 100644
index 000000000000..56582c307a32
--- /dev/null
+++ b/comms/linpsk/files/patch-src_waveinput.cpp
@@ -0,0 +1,11 @@
+--- src/waveinput.cpp.orig 2015-01-07 06:36:15.000000000 -0800
++++ src/waveinput.cpp 2015-01-07 06:36:25.000000000 -0800
+@@ -19,7 +19,7 @@
+
+ extern Parameter settings;
+
+-WaveInput::WaveInput(int ptt = -1): Input(ptt)
++WaveInput::WaveInput(int ptt): Input(ptt)
+ {
+ EightBits=false;
+ }
diff --git a/comms/linpsk/pkg-descr b/comms/linpsk/pkg-descr
new file mode 100644
index 000000000000..cb0be9a1e05c
--- /dev/null
+++ b/comms/linpsk/pkg-descr
@@ -0,0 +1,16 @@
+LinPsk is a program for operating on digital modes running on Linux.
+
+LinPsk supports BPSK , QPSK and RTTY at the moment.
+
+Main features are:
+
+ the simultaneuos decoding of up to four channels.
+ The different digital modes may be mixed
+ You can define a trigger on each channel to be notified if a text of your choice is detected.
+ You can log each received channel at a file.
+ For easy qso'ing you can define macros and for larger texts to be send you can use two files.
+ You can view the signal as spectrum or in a waterfall display. Both are scalable in the frequency domain.
+
+At the Moment RTTY only supports 45 baud and 1.5 stopbits.
+
+WWW: http://linpsk.sourceforge.net/