From e03e65df7be6f1071edc9a67ea58db001d088b7a Mon Sep 17 00:00:00 2001
From: Andy Cobaugh <andrew.cobaugh@gmail.com>
Date: Sat, 18 May 2019 10:15:23 -0400
Subject: [PATCH 1/3] New package: wsjtx

---
 srcpkgs/wsjtx/template | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 srcpkgs/wsjtx/template

diff --git a/srcpkgs/wsjtx/template b/srcpkgs/wsjtx/template
new file mode 100644
index 00000000000..b9d21e2a3af
--- /dev/null
+++ b/srcpkgs/wsjtx/template
@@ -0,0 +1,14 @@
+# Template file for 'wsjtx'
+pkgname=wsjtx
+version=2.0.1
+revision=1
+build_style=cmake
+archs="i686 x86_64 x86_64-musl"
+hostmakedepends="git autoconf automake libtool gcc-fortran asciidoc ruby-asciidoctor qt5-plugin-mysql qt5-plugin-odbc qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds libgomp"
+makedepends="fftw-devel qt5-serialport-devel qt5-devel qt5-multimedia-devel libusb-devel libgomp-devel"
+short_desc="WSJT-X weak-signal radio communication program"
+maintainer="Andy Cobaugh <andrew.cobaugh@gmail.com>"
+license="GPL-3.0"
+homepage="http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html"
+distfiles="http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-${version}.tgz"
+checksum=18f18f93f7e0ecc631ff5f7e0002521c41b54322ea33e5d6ca3ab5144fe1a0cd

From 49275cf5c17e5263a5a72ac25bfc818603a9020c Mon Sep 17 00:00:00 2001
From: Andy Cobaugh <andrew.cobaugh@gmail.com>
Date: Sun, 19 May 2019 10:56:11 -0400
Subject: [PATCH 2/3] wsjtx: patch to allow the embedded hamlib to
 cross-compile

---
 .../wsjtx/patches/cmake_hamlib_cross.patch    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 srcpkgs/wsjtx/patches/cmake_hamlib_cross.patch

diff --git a/srcpkgs/wsjtx/patches/cmake_hamlib_cross.patch b/srcpkgs/wsjtx/patches/cmake_hamlib_cross.patch
new file mode 100644
index 00000000000..2e8d68ee92f
--- /dev/null
+++ b/srcpkgs/wsjtx/patches/cmake_hamlib_cross.patch
@@ -0,0 +1,22 @@
+--- CMakeLists.txt	2019-02-24 23:11:18.000000000 -0500
++++ CMakeLists.txt.fix	2019-05-19 00:43:03.724194227 -0400
+@@ -79,6 +79,10 @@
+ 
+ include (ExternalProject)
+ 
++if (DEFINED ENV{CROSS_BUILD})
++  get_filename_component(cross_triplet $ENV{XBPS_CROSS_BASE} NAME)
++  set (hamlib_cross "--host=${cross_triplet}")
++endif ()
+ 
+ #
+ # build and install hamlib locally so it can be referenced by the
+@@ -91,7 +95,7 @@
+   URL_HASH MD5=${hamlib_md5sum}
+   UPDATE_COMMAND ./bootstrap
+   PATCH_COMMAND ${PATCH_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/hamlib.patch
+-  CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-shared --enable-static --without-cxx-binding ${EXTRA_FLAGS} # LIBUSB_LIBS=${USB_LIBRARY}
++  CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-shared --enable-static --without-cxx-binding ${EXTRA_FLAGS} ${hamlib_cross} # LIBUSB_LIBS=${USB_LIBRARY}
+   BUILD_COMMAND $(MAKE) all V=1 # $(MAKE) is ExternalProject_Add() magic to do recursive make
+   INSTALL_COMMAND $(MAKE) install-strip V=1 DESTDIR=""
+   STEP_TARGETS update install

From 4420d1f572d3e63294587b02e25f4336b3ee06c3 Mon Sep 17 00:00:00 2001
From: Andy Cobaugh <andrew.cobaugh@gmail.com>
Date: Thu, 18 Jul 2019 21:27:41 -0400
Subject: [PATCH 3/3] wsjtx: update to 2.1.0.

---
 srcpkgs/wsjtx/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/wsjtx/template b/srcpkgs/wsjtx/template
index b9d21e2a3af..43618da735e 100644
--- a/srcpkgs/wsjtx/template
+++ b/srcpkgs/wsjtx/template
@@ -1,14 +1,14 @@
 # Template file for 'wsjtx'
 pkgname=wsjtx
-version=2.0.1
+version=2.1.0
 revision=1
 build_style=cmake
 archs="i686 x86_64 x86_64-musl"
 hostmakedepends="git autoconf automake libtool gcc-fortran asciidoc ruby-asciidoctor qt5-plugin-mysql qt5-plugin-odbc qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds libgomp"
-makedepends="fftw-devel qt5-serialport-devel qt5-devel qt5-multimedia-devel libusb-devel libgomp-devel"
+makedepends="fftw-devel qt5-serialport-devel qt5-devel qt5-multimedia-devel libusb-devel libgomp-devel qt5-tools-devel"
 short_desc="WSJT-X weak-signal radio communication program"
 maintainer="Andy Cobaugh <andrew.cobaugh@gmail.com>"
 license="GPL-3.0"
 homepage="http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html"
 distfiles="http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-${version}.tgz"
-checksum=18f18f93f7e0ecc631ff5f7e0002521c41b54322ea33e5d6ca3ab5144fe1a0cd
+checksum=9e6c5424b2c84534b9ae6b7cc8e014c9da6540a7c50df8f3b25636c09d87d411
