diff --git a/comms/wsjtx/Makefile b/comms/wsjtx/Makefile index ecb09ed2a572..6b7b0decbf5b 100644 --- a/comms/wsjtx/Makefile +++ b/comms/wsjtx/Makefile @@ -1,87 +1,88 @@ PORTNAME= wsjtx DISTVERSION= 2.5.4 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= comms hamradio MASTER_SITES= SF/wsjt/${PORTNAME}-${PORTVERSION}${DISTVERSIONSUFFIX} MAINTAINER= hamradio@FreeBSD.org COMMENT= Weak signal ham radio communication package WWW= https://physics.princeton.edu/pulsar/k1jt/wsjtx.html LICENSE= GPLv3 BUILD_DEPENDS= asciidoctor:textproc/rubygem-asciidoctor \ a2x:textproc/asciidoc \ git:devel/git \ ${LOCALBASE}/share/xsl/docbook:textproc/docbook-xsl LIB_DEPENDS= libfftw3.so:math/fftw3 \ libfftw3f.so:math/fftw3-float \ libboost_log_setup.so:devel/boost-libs \ libxslt.so:textproc/libxslt USES= cmake:noninja compiler:c++11-lang fortran gl libedit \ makeinfo pkgconfig qt:5 readline tar:tgz USE_GL= glu USE_QT= core gui network widgets \ multimedia concurrent printsupport serialport sql sql-sqlite3 \ buildtools:build linguisttools:build qmake:build testlib CONFLICTS_INSTALL= wsjtz # for detailed debugging uncomment the next line #CMAKE_ARGS+= --debug-output --trace PLIST_SUB+= PORTVERSION="${PORTVERSION}" _PATCHES= wsjtx.patch hamlib.patch .include .if ${GCC_DEFAULT} >= 10 # workaround for More actual than formal arguments in procedure call at (1) FFLAGS+= -fallow-argument-mismatch .endif _HAMLIB_PATCHES= configure hamlib.pc.in tests/rigtestlibusb.c src/misc.c make-hamlib-patch: ${MV} ${FILESDIR}/hamlib.patch ${FILESDIR}/hamlib.patch.old . for f in ${_HAMLIB_PATCHES} (cd ${WRKDIR}/.build/hamlib-prefix/src;diff -u hamlib/$f.orig hamlib/$f >> ${FILESDIR}/hamlib.patch || true) . endfor -_WSJTX_PATCHES= CMakeLists.txt Radio.cpp widgets/FrequencyLineEdit.cpp \ +_WSJTX_PATCHES= wsjtx_config.h.in CMakeLists.txt Radio.cpp \ + widgets/FrequencyLineEdit.cpp \ widgets/FrequencyDeltaLineEdit.cpp \ CMake/Modules/FindUsb.cmake \ CMake/Modules/FindHamlib.cmake make-wsjtx-patch: ${MV} ${FILESDIR}/wsjtx.patch ${FILESDIR}/wsjtx.patch.old . for f in ${_WSJTX_PATCHES} (cd ${WRKDIR}/.build/wsjtx-prefix/src;diff -u wsjtx/$f.orig wsjtx/$f >> ${FILESDIR}/wsjtx.patch || true) . endfor post-patch: . for _patch in ${_PATCHES} # Keep a copy of the blank patch for the post-build target below ${MV} ${WRKSRC}/${_patch} ${WRKSRC}/${_patch}.orig # Copy the patch provided by the ports system ${CP} ${FILESDIR}/${_patch} ${WRKSRC} . endfor post-build: # With cmake 3.18, the patching stage in the internal build # is run again, trick it by removing the patch again. . for _patch in ${_PATCHES} ${MV} ${WRKSRC}/${_patch}.orig ${WRKSRC}/${_patch} . endfor do-install: (cd ${CONFIGURE_WRKSRC};${MAKE} -f Makefile DESTDIR=${STAGEDIR} install) post-install: .for f in fcal fmeasure fmtave fst4sim ft8code jt4code jt65code jt9 jt9code \ message_aggregator msk144code rigctld-wsjtx rigctlcom-wsjtx \ rigctl-wsjtx udp_daemon q65code q65sim \ wsjtx wsjtx_app_version wsprd ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f} .endfor .include diff --git a/comms/wsjtx/files/hamlib.patch b/comms/wsjtx/files/hamlib.patch index 335e13502141..c4a39324ad9c 100644 --- a/comms/wsjtx/files/hamlib.patch +++ b/comms/wsjtx/files/hamlib.patch @@ -1,74 +1,74 @@ --- hamlib/configure.orig 2022-01-02 05:10:19.000000000 -0500 -+++ hamlib/configure 2023-02-17 16:55:21.413328000 -0500 ++++ hamlib/configure 2023-09-03 10:33:52.838742000 -0400 @@ -19135,7 +19135,7 @@ case "$host_os" in #( freebsd*) : - AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" + AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include" AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib" ;; #( darwin* | rhapsody*) : @@ -19211,6 +19211,7 @@ fi +LIBUSB_LIBS="-lusb" LIBUSB="" --- hamlib/hamlib.pc.in.orig 2022-01-02 05:10:11.000000000 -0500 -+++ hamlib/hamlib.pc.in 2023-02-17 16:55:21.413939000 -0500 ++++ hamlib/hamlib.pc.in 2023-09-03 10:33:52.839354000 -0400 @@ -7,7 +7,6 @@ Description: Library to control radio and rotator equipment. URL: @PACKAGE_URL@ Version: @PACKAGE_VERSION@ -Requires.private: @LIBUSB@ Cflags: -I${includedir} @PTHREAD_CFLAGS@ -Libs: -L${libdir} -lhamlib -Libs.private: @MATH_LIBS@ @DL_LIBS@ @NET_LIBS@ @PTHREAD_LIBS@ +Libs: -L${libdir} ${libdir}/libhamlib.a +Libs.private: @MATH_LIBS@ @DL_LIBS@ @NET_LIBS@ @PTHREAD_LIBS@ -lusb --- hamlib/tests/rigtestlibusb.c.orig 2022-01-02 05:10:11.000000000 -0500 -+++ hamlib/tests/rigtestlibusb.c 2023-02-17 16:55:21.414509000 -0500 ++++ hamlib/tests/rigtestlibusb.c 2023-09-03 10:33:52.839923000 -0400 @@ -115,7 +115,10 @@ printf(" wSpeedSupported: %u\n", ss_usb_cap->wSpeedSupported); printf(" bFunctionalitySupport: %u\n", ss_usb_cap->bFunctionalitySupport); printf(" bU1devExitLat: %u\n", ss_usb_cap->bU1DevExitLat); - printf(" bU2devExitLat: %u\n", ss_usb_cap->bU2DevExitLat); +/* + * does not exist on FreeBSD libusb.h yet + * printf(" bU2devExitLat: %u\n", ss_usb_cap->bU2DevExitLat); + */ } static void print_bos(libusb_device_handle *handle) @@ -133,6 +136,7 @@ printf(" Binary Object Store (BOS):\n"); printf(" wTotalLength: %u\n", bos->wTotalLength); +#if 0 printf(" bNumDeviceCaps: %u\n", bos->bNumDeviceCaps); for (i = 0; i < bos->bNumDeviceCaps; i++) @@ -170,7 +174,7 @@ libusb_free_ss_usb_device_capability_descriptor(ss_dev_cap); } } - +#endif libusb_free_bos_descriptor(bos); } ---- hamlib/src/misc.c.orig 2023-02-17 18:06:57.171679000 -0500 -+++ hamlib/src/misc.c 2023-02-17 18:13:49.377881000 -0500 +--- hamlib/src/misc.c.orig 2022-01-02 05:10:11.000000000 -0500 ++++ hamlib/src/misc.c 2023-09-03 10:33:52.841041000 -0400 @@ -2550,7 +2550,8 @@ if (localtime) { mytm = localtime_r(&t, &result); - mytimezone = timezone; + /* For FreeBSD */ + mytimezone = mytm->tm_gmtoff; } else { diff --git a/comms/wsjtx/files/wsjtx.patch b/comms/wsjtx/files/wsjtx.patch index 64bdf7ac06ac..4cd6321db885 100644 --- a/comms/wsjtx/files/wsjtx.patch +++ b/comms/wsjtx/files/wsjtx.patch @@ -1,172 +1,215 @@ ---- wsjtx/CMakeLists.txt.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/CMakeLists.txt 2021-12-31 07:53:05.900792000 -0500 +--- wsjtx/wsjtx_config.h.in.orig 2023-09-03 10:51:04.025598000 -0400 ++++ wsjtx/wsjtx_config.h.in 2023-09-03 10:51:06.011258000 -0400 +@@ -18,7 +18,6 @@ + + #cmakedefine CMAKE_INSTALL_DATAROOTDIR "@CMAKE_INSTALL_DATAROOTDIR@" + #cmakedefine CMAKE_INSTALL_DOCDIR "@CMAKE_INSTALL_DOCDIR@" +-#cmakedefine CMAKE_INSTALL_DATADIR "@CMAKE_INSTALL_DATADIR@" + #cmakedefine CMAKE_PROJECT_NAME "@CMAKE_PROJECT_NAME@" + #cmakedefine PROJECT_VENDOR "@PROJECT_VENDOR@" + #cmakedefine PROJECT_NAME "@PROJECT_NAME@" +@@ -58,16 +57,23 @@ + #endif + + /* typedef for consistent gfortran ABI for charlen type hidden arguments */ +-#if __GNUC__ > 7 +-#ifdef __cplusplus +-#include +-#else +-#include +-#endif +- typedef size_t fortran_charlen_t; +-#else ++#if (__GNUC__ > 7) ++ #ifdef __cplusplus ++ #include ++ #else ++ #include ++ #endif ++ typedef size_t fortran_charlen_t; ++ #else + typedef int fortran_charlen_t; +-#endif ++/* typedef for consistent gfortran ABI for charlen type hidden arguments */ ++ #if defined(__clang__) ++ #include ++ typedef size_t fortran_charlen_t; ++ #else ++ typedef int fortran_charlen_t; ++ #endif ++ #endif + + #ifdef __cplusplus + } +--- wsjtx/CMakeLists.txt.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/CMakeLists.txt 2023-09-03 10:35:34.257208000 -0400 @@ -41,7 +41,7 @@ endif () if (POLICY CMP0075) - cmake_policy (SET CMP0075 NEW) # honour CMAKE_REQUIRED_LIBRARIES in config checks + cmake_policy (SET CMP0075 NEW) # honour CMAKE_REQUIRED_LIBRARIES in config che,cks endif () project (wsjtx -@@ -867,7 +867,7 @@ +@@ -868,7 +868,7 @@ # OpenMP # find_package (OpenMP) - +set (OpenMP_C_FLAGS "-fopenmp") # # fftw3 single precision library # -@@ -884,7 +884,7 @@ +@@ -885,7 +885,7 @@ check_type_size (CACHE_ALL HAMLIB_OLD_CACHING) check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING) -find_package (Usb REQUIRED) +#find_package (Usb REQUIRED) # # Qt5 setup -@@ -914,7 +914,7 @@ +@@ -915,7 +915,7 @@ # set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti") +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fexceptions -frtti") if (NOT APPLE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") -@@ -1160,7 +1160,7 @@ +@@ -1161,7 +1161,7 @@ target_link_libraries (encode77 wsjt_fort wsjt_cxx) add_executable (wsprsim ${wsprsim_CSRCS}) -target_link_libraries (wsprsim ${LIBM_LIBRARIES}) +target_link_libraries (wsprsim "-lm") add_executable (jt4code lib/jt4code.f90) target_link_libraries (jt4code wsjt_fort wsjt_cxx) ---- wsjtx/Radio.cpp.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/Radio.cpp 2021-12-31 07:48:03.411318000 -0500 +--- wsjtx/Radio.cpp.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/Radio.cpp 2023-09-03 10:35:34.257683000 -0400 @@ -54,7 +54,8 @@ value *= std::pow (10., scale); if (ok) { - if (value < 0. || value > std::numeric_limits::max ()) +#define MAXDOUBLEFREQUENCY 18446744073709551616.0 + if (value < 0. || value > MAXDOUBLEFREQUENCY) { value = 0.; *ok = false; @@ -92,7 +93,7 @@ if (ok) { if (value < -std::numeric_limits::max () - || value > std::numeric_limits::max ()) + || value > MAXDOUBLEFREQUENCY) { value = 0.; *ok = false; ---- wsjtx/widgets/FrequencyLineEdit.cpp.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/widgets/FrequencyLineEdit.cpp 2021-12-31 07:48:03.411740000 -0500 +--- wsjtx/widgets/FrequencyLineEdit.cpp.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/widgets/FrequencyLineEdit.cpp 2023-09-03 10:35:34.258093000 -0400 @@ -39,7 +39,8 @@ FrequencyLineEdit::FrequencyLineEdit (QWidget * parent) : QLineEdit (parent) { - setValidator (new MHzValidator {0., std::numeric_limits::max () / 10.e6, this}); +#define MAXDOUBLEFREQUENCY 18446744073709551616.0 + setValidator (new MHzValidator {0., MAXDOUBLEFREQUENCY / 10.e6, this}); } auto FrequencyLineEdit::frequency () const -> Frequency ---- wsjtx/widgets/FrequencyDeltaLineEdit.cpp.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/widgets/FrequencyDeltaLineEdit.cpp 2021-12-31 07:48:03.412129000 -0500 +--- wsjtx/widgets/FrequencyDeltaLineEdit.cpp.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/widgets/FrequencyDeltaLineEdit.cpp 2023-09-03 10:35:34.258484000 -0400 @@ -39,8 +39,8 @@ FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent) : QLineEdit (parent) { - setValidator (new MHzValidator {-std::numeric_limits::max () / 10.e6, - std::numeric_limits::max () / 10.e6, this}); + setValidator (new MHzValidator {(-(std::numeric_limits::max ())&-0xF) / 10.e6, + (std::numeric_limits::max ()&~0xF) / 10.e6, this}); } auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta ---- wsjtx/CMake/Modules/FindUsb.cmake.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/CMake/Modules/FindUsb.cmake 2021-12-31 07:48:03.412537000 -0500 +--- wsjtx/CMake/Modules/FindUsb.cmake.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/CMake/Modules/FindUsb.cmake 2023-09-03 10:35:34.258886000 -0400 @@ -13,25 +13,35 @@ # Usb::Usb - The libusb library # +if ( CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) + message ( Status "FreeBSD libusb is built in") + set (Usb_FOUND True) + set(Usb_LIBRARY "usb") + set(Usb_INCLUDE_DIR "/usr/include") + set(Usb_LIBRARIES "") + add_library (Usb "usb") +else() include (LibFindMacros) -if (WIN32) - # Use path suffixes on MS Windows as we probably shouldn't - # trust the PATH envvar. PATH will still be searched to find the - # library as last resort. - if (CMAKE_SIZEOF_VOID_P MATCHES "8") - set (_library_options PATH_SUFFIXES MinGW64/dll MinGW64/static) - else () - set (_library_options PATH_SUFFIXES MinGW32/dll MinGW32/static) - endif () -endif () -libfind_pkg_detect (Usb usb-1.0 - FIND_PATH libusb.h PATH_SUFFIXES libusb-1.0 - FIND_LIBRARY usb-1.0 ${_library_options} - ) + if (WIN32) + # Use path suffixes on MS Windows as we probably shouldn't + # trust the PATH envvar. PATH will still be searched to find the + # library as last resort. + if (CMAKE_SIZEOF_VOID_P MATCHES "8") + set (_library_options PATH_SUFFIXES MinGW64/dll MinGW64/static) + else () + set (_library_options PATH_SUFFIXES MinGW32/dll MinGW32/static) + endif () + endif () -libfind_process (Usb) + libfind_pkg_detect (Usb usb-1.0 + FIND_PATH libusb.h PATH_SUFFIXES libusb-1.0 + FIND_LIBRARY usb-1.0 ${_library_options} + ) + libfind_process (Usb) +endif() + if (Usb_FOUND AND NOT TARGET Usb::Usb) add_library (Usb::Usb UNKNOWN IMPORTED) set_target_properties (Usb::Usb PROPERTIES @@ -40,10 +50,12 @@ INTERFACE_INCLUDE_DIRECTORIES "${Usb_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "${Usb_LIBRARIES}" ) -endif () +endif() +if ( NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) mark_as_advanced ( Usb_INCLUDE_DIR Usb_LIBRARY Usb_LIBRARIES ) +endif() ---- wsjtx/CMake/Modules/FindHamlib.cmake.orig 2021-11-03 19:53:01.000000000 -0400 -+++ wsjtx/CMake/Modules/FindHamlib.cmake 2021-12-31 07:48:03.412916000 -0500 +--- wsjtx/CMake/Modules/FindHamlib.cmake.orig 2021-12-28 04:31:58.000000000 -0500 ++++ wsjtx/CMake/Modules/FindHamlib.cmake 2023-09-03 10:35:34.259262000 -0400 @@ -18,7 +18,9 @@ FIND_LIBRARY hamlib ) +if ( NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" ) libfind_package (Hamlib Usb) +endif() libfind_process (Hamlib)