···11+{ stdenv, fetchurl, asciidoc, asciidoctor, autoconf, automake, cmake,
22+ docbook_xsl, fftw, fftwFloat, gfortran, libtool, libpulseaudio, qtbase,
33+ qtmultimedia, qtserialport, texinfo, libusb1 }:
44+55+stdenv.mkDerivation rec {
66+ name = "wsjtx-${version}";
77+ version = "1.8.0";
88+99+ # This is a composite source tarball containing both wsjtx and a hamlib fork
1010+ src = fetchurl {
1111+ url = "http://physics.princeton.edu/pulsar/K1JT/wsjtx-${version}.tgz";
1212+ sha256 = "21603ad4d5f43cd9c79a6e8cf468bde88c554654012b2c6c1ef9144cfbf668ce";
1313+ };
1414+1515+ # Hamlib builds with autotools, wsjtx builds with cmake
1616+ # Omitting pkgconfig because it causes issues locating the built hamlib
1717+ nativeBuildInputs = [
1818+ asciidoc asciidoctor autoconf automake cmake docbook_xsl gfortran libtool
1919+ texinfo
2020+ ];
2121+ buildInputs = [ fftw fftwFloat libusb1 qtbase qtmultimedia qtserialport ];
2222+2323+ # Composite build has its own patch step after it extracts the inner archives
2424+ postPatch = "cp ${./wsjtx.patch} wsjtx.patch";
2525+2626+ meta = with stdenv.lib; {
2727+ description = "Weak-signal digital communication modes for amateur radio";
2828+ longDescription = ''
2929+ WSJT-X implements communication protocols or "modes" called FT8, JT4, JT9,
3030+ JT65, QRA64, ISCAT, MSK144, and WSPR, as well as one called Echo for
3131+ detecting and measuring your own radio signals reflected from the Moon.
3232+ These modes were all designed for making reliable, confirmed ham radio
3333+ contacts under extreme weak-signal conditions.
3434+ '';
3535+ homepage = http://physics.princeton.edu/pulsar/k1jt/wsjtx.html;
3636+ # Older licenses are for the statically-linked hamlib
3737+ license = with licenses; [ gpl3Plus gpl2Plus lgpl21Plus ];
3838+ platforms = platforms.linux;
3939+ maintainers = [ maintainers.lasandell ];
4040+ };
4141+}