···1+{ stdenv, fetchurl, asciidoc, asciidoctor, autoconf, automake, cmake,
2+ docbook_xsl, fftw, fftwFloat, gfortran, libtool, libpulseaudio, qtbase,
3+ qtmultimedia, qtserialport, texinfo, libusb1 }:
4+5+stdenv.mkDerivation rec {
6+ name = "wsjtx-${version}";
7+ version = "1.8.0";
8+9+ # This is a composite source tarball containing both wsjtx and a hamlib fork
10+ src = fetchurl {
11+ url = "http://physics.princeton.edu/pulsar/K1JT/wsjtx-${version}.tgz";
12+ sha256 = "21603ad4d5f43cd9c79a6e8cf468bde88c554654012b2c6c1ef9144cfbf668ce";
13+ };
14+15+ # Hamlib builds with autotools, wsjtx builds with cmake
16+ # Omitting pkgconfig because it causes issues locating the built hamlib
17+ nativeBuildInputs = [
18+ asciidoc asciidoctor autoconf automake cmake docbook_xsl gfortran libtool
19+ texinfo
20+ ];
21+ buildInputs = [ fftw fftwFloat libusb1 qtbase qtmultimedia qtserialport ];
22+23+ # Composite build has its own patch step after it extracts the inner archives
24+ postPatch = "cp ${./wsjtx.patch} wsjtx.patch";
25+26+ meta = with stdenv.lib; {
27+ description = "Weak-signal digital communication modes for amateur radio";
28+ longDescription = ''
29+ WSJT-X implements communication protocols or "modes" called FT8, JT4, JT9,
30+ JT65, QRA64, ISCAT, MSK144, and WSPR, as well as one called Echo for
31+ detecting and measuring your own radio signals reflected from the Moon.
32+ These modes were all designed for making reliable, confirmed ham radio
33+ contacts under extreme weak-signal conditions.
34+ '';
35+ homepage = http://physics.princeton.edu/pulsar/k1jt/wsjtx.html;
36+ # Older licenses are for the statically-linked hamlib
37+ license = with licenses; [ gpl3Plus gpl2Plus lgpl21Plus ];
38+ platforms = platforms.linux;
39+ maintainers = [ maintainers.lasandell ];
40+ };
41+}