1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-16 03:24:07 +00:00

Update unixcw and xcwcp to latest release.

This is also the first version where all the issues are fixed, and support
has been included for ALSA and Pulseaudio.  The ioctl() issue is resolved,
and gettext is properly controlled by the NLS option.

I'll be submitting these patches upstream, but due to the low rate of
releases, want to get them into ports first.

This is heavily modified from the submitted patch as every time anything
was tested, a new issue cropped up.

PR:		229782
Reported by:	Yuri Victorovich <yuri@freebsd.org>
This commit is contained in:
Stephen Hurd 2018-08-08 04:35:54 +00:00
parent b247116cf6
commit fb1feb30a1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=476626
15 changed files with 289 additions and 10 deletions

View File

@ -4,7 +4,7 @@
# it still works as well.
PORTNAME?= unixcw
PORTVERSION= 3.5.0
PORTVERSION= 3.5.1
CATEGORIES= comms hamradio
MASTER_SITES= SF/unixcw/unixcw-${PORTVERSION}
DISTNAME= unixcw_${PORTVERSION}.orig
@ -20,21 +20,32 @@ GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-xcwcp
.endif
CONFIGURE_ARGS+= --includedir="${LOCALBASE}/include" \
--libdir="${LOCALBASE}/lib" \
--disable-alsa --disable-pulseaudio
--libdir="${LOCALBASE}/lib"
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
#CONFIGURE_ENV+= LDFLAGS=-L${LOCALBASE}/lib CPPFLAGS=-I${LOCALBASE}/include
USES+= gmake libtool ncurses pathfix pkgconfig autoreconf
USE_LDCONFIG= yes
USES+= gmake libtool ncurses pathfix pkgconfig
USE_CSTD= gnu99
WRKSRC= ${WRKDIR}/unixcw-${PORTVERSION}
MAJOR_LIB_VER= 6
MINOR_LIB_VER= 5.1
MINOR_LIB_VER= 6.1
PLIST_SUB= MAJOR_LIB_VER=${MAJOR_LIB_VER}
PLIST_SUB+= MINOR_LIB_VER=${MINOR_LIB_VER}
post-patch:
${REINPLACE_CMD} -e 's|curses|ncurses|g' ${WRKSRC}/configure \
${WRKSRC}/src/cwcp/Makefile.in
OPTIONS_DEFINE= NLS
OPTIONS_DEFAULT= NLS
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls
.ifndef XCWCP
OPTIONS_DEFINE+= ALSA PULSEAUDIO
OPTIONS_DEFAULT+= ALSA PULSEAUDIO
ALSA_CONFIGURE_ENABLE= alsa
PULSEAUDIO_CONFIGURE_ENABLE= pulseaudio
ALSA_BUILD_DEPENDS= ${LOCALBASE}/include/alsa/asoundlib.h:audio/alsa-lib
PULSEAUDIO_BUILD_DEPENDS= ${LOCALBASE}/include/pulse/simple.h:audio/portaudio
.endif
post-install:
.ifndef XCWCP

View File

@ -1,2 +1,3 @@
SHA256 (unixcw_3.5.0.orig.tar.gz) = ca94e54ce7e6da458aba13ecdea05e4ec7db50c482abf78201403c718680ac0c
SIZE (unixcw_3.5.0.orig.tar.gz) = 719974
TIMESTAMP = 1533663632
SHA256 (unixcw_3.5.1.orig.tar.gz) = 5f3aacd8a26e16e6eff437c7ae1e9b389956fb137eeb3de24670ce05de479e7a
SIZE (unixcw_3.5.1.orig.tar.gz) = 720369

View File

@ -0,0 +1,7 @@
--- Makefile.am.orig 2018-08-07 19:21:10 UTC
+++ Makefile.am
@@ -1,3 +1,4 @@
+ACLOCAL_AMFLAGS = -I m4
SUBDIRS=src
EXTRA_DIST = \

View File

@ -0,0 +1,39 @@
--- configure.ac.orig 2017-02-12 10:41:29 UTC
+++ configure.ac
@@ -22,6 +22,8 @@ AC_PREREQ(2.57)
AC_INIT([unixcw], [3.5.1])
AC_CONFIG_SRCDIR([src/libcw/libcw_gen.c])
AM_INIT_AUTOMAKE
+AC_CONFIG_MACRO_DIR([m4])
+AC_USE_SYSTEM_EXTENSIONS
# Libtool initialization, added during tests on FreeBSD
LT_INIT
@@ -41,6 +43,9 @@ AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AM_PROG_CC_C_O
+AC_GNU_SOURCE
+AM_GNU_GETTEXT(external)
+AM_GNU_GETTEXT_VERSION([0.18])
@@ -409,8 +414,6 @@ AC_SUBST(LIBCW_NDEBUG)
-
-
# #####
# end
# #####
@@ -427,7 +430,7 @@ AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h strings.h sys/ioctl.h \
- sys/param.h sys/time.h unistd.h locale.h libintl.h])
+ sys/param.h sys/time.h unistd.h locale.h])
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([string.h strings.h])
if test "$ac_cv_header_string_h" = 'no' \

View File

@ -0,0 +1,11 @@
--- src/cw/Makefile.am.orig 2018-08-07 19:08:14 UTC
+++ src/cw/Makefile.am
@@ -26,7 +26,7 @@ cw_SOURCES = cw.c cw.h
# target-specific preprocessor flags (#defs and include dirs)
# cw_CPPFLAGS = -I$(top_srcdir)/src/cwutils -I$(top_srcdir)/src/libcw/
# target-specific linker flags (objects to link)
-cw_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cw.a
+cw_LDADD = $(LTLIBINTL) -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cw.a

View File

@ -0,0 +1,20 @@
--- src/cw/cw.c.orig 2018-08-08 04:24:25 UTC
+++ src/cw/cw.c
@@ -598,7 +598,9 @@ int main (int argc, char *const argv[])
}
}
+#ifndef __FreeBSD__
if (config->audio_system == CW_AUDIO_ALSA
+ ) {
&& cw_is_pa_possible(NULL)) {
fprintf(stdout, "Selected audio system is ALSA, but audio on your system is handled by PulseAudio. Expect problems with timing.\n");
@@ -607,6 +609,7 @@ int main (int argc, char *const argv[])
fprintf(stdout, "Press Enter key to continue\n");
getchar();
}
+#endif
generator = cw_generator_new_from_config(config);
if (!generator) {

View File

@ -0,0 +1,11 @@
--- src/cwcp/Makefile.am.orig 2018-08-07 19:10:59 UTC
+++ src/cwcp/Makefile.am
@@ -26,7 +26,7 @@ cwcp_SOURCES = cwcp.c
# target-specific preprocessor flags (#defs and include dirs)
#cwcp_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/
# target-specific linker flags (objects to link)
-cwcp_LDADD = -lcurses -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwcp.a
+cwcp_LDADD = -lcurses $(LTLIBINTL) -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwcp.a
# copy man page to proper directory during installation

View File

@ -0,0 +1,18 @@
--- src/cwcp/cwcp.c.orig 2018-08-08 04:24:32 UTC
+++ src/cwcp/cwcp.c
@@ -1732,6 +1732,7 @@ int main(int argc, char **argv)
}
}
+#ifndef __FreeBSD__
if (config->audio_system == CW_AUDIO_ALSA
&& cw_is_pa_possible(NULL)) {
@@ -1741,6 +1742,7 @@ int main(int argc, char **argv)
fprintf(stdout, "Press Enter key to continue\n");
getchar();
}
+#endif
generator = cw_generator_new_from_config(config);
if (!generator) {

View File

@ -0,0 +1,11 @@
--- src/cwgen/Makefile.am.orig 2018-08-07 19:09:07 UTC
+++ src/cwgen/Makefile.am
@@ -26,7 +26,7 @@ cwgen_SOURCES = cwgen.c
# target-specific preprocessor flags (#defs and include dirs)
#cwgen_CPPFLAGS = -I$(top_srcdir)/src/cwutils/ -I$(top_srcdir)/src/libcw/
# target-specific linker flags (objects to link)
-cwgen_LDADD = -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwgen.a
+cwgen_LDADD = $(LTLIBINTL) -L$(top_builddir)/src/libcw/.libs -lcw $(top_builddir)/src/cwutils/lib_cwgen.a
# copy man page to proper directory during installation

View File

@ -0,0 +1,11 @@
--- src/cwutils/Makefile.am.orig 2018-08-07 19:05:29 UTC
+++ src/cwutils/Makefile.am
@@ -29,7 +29,7 @@ cw_dictionary_tests_SOURCES = dictionary
cw_dictionary_tests_CPPFLAGS = $(AM_CPPFLAGS) -DCW_DICTIONARY_UNIT_TESTS
# target-specific linker flags (objects to link)
-cw_dictionary_tests_LDADD=-L$(top_builddir)/src/libcw/.libs -lcw #-lm -lpthread -ldl
+cw_dictionary_tests_LDADD=$(LTLIBINTL) -L$(top_builddir)/src/libcw/.libs -lcw #-lm -lpthread -ldl
# target-specific compiler flags
cw_dictionary_tests_CFLAGS = -rdynamic

View File

@ -0,0 +1,11 @@
--- src/cwutils/i18n.c.orig 2018-08-07 18:50:26 UTC
+++ src/cwutils/i18n.c
@@ -50,7 +50,7 @@ i18n_initialize (void)
const char *
i18n_gettext (const char *msgid)
{
-#if defined(HAVE_LIBINTL_H)
+#if defined(HAVE_GETTEXT)
static int is_initialized = FALSE;
if (!is_initialized)

View File

@ -0,0 +1,11 @@
--- src/cwutils/i18n.h.orig 2018-08-07 18:50:31 UTC
+++ src/cwutils/i18n.h
@@ -20,7 +20,7 @@
#ifndef _CWI18N_H
#define _CWI18N_H
-#if defined(HAVE_LIBINTL_H)
+#if defined(HAVE_GETTEXT)
# include <libintl.h>
# define _(STR) i18n_gettext (STR)

View File

@ -0,0 +1,83 @@
--- src/libcw/libcw_oss.c.orig 2018-08-08 04:17:27 UTC
+++ src/libcw/libcw_oss.c
@@ -243,7 +243,7 @@ int cw_oss_open_device_internal(cw_gen_t
/* Get fragment size in bytes, may be different than requested
with ioctl(..., SNDCTL_DSP_SETFRAGMENT), and, in particular,
can be different than 2^N. */
- if ((rv = ioctl(soundcard, (int) SNDCTL_DSP_GETBLKSIZE, &size)) == -1) {
+ if ((rv = ioctl(soundcard, SNDCTL_DSP_GETBLKSIZE, &size)) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_GETBLKSIZE): \"%s\"", strerror(errno));
close(soundcard);
@@ -322,7 +322,7 @@ int cw_oss_open_device_ioctls_internal(i
#endif
/* Set the audio format to 8-bit unsigned. */
parameter = CW_OSS_SAMPLE_FORMAT;
- if (ioctl(*fd, (int) SNDCTL_DSP_SETFMT, &parameter) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_SETFMT, &parameter) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_SETFMT): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -335,7 +335,7 @@ int cw_oss_open_device_ioctls_internal(i
/* Set up mono mode - a single audio channel. */
parameter = CW_AUDIO_CHANNELS;
- if (ioctl(*fd, (int) SNDCTL_DSP_CHANNELS, &parameter) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_CHANNELS, &parameter) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_CHANNELS): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -352,7 +352,7 @@ int cw_oss_open_device_ioctls_internal(i
bool success = false;
for (int i = 0; cw_supported_sample_rates[i]; i++) {
rate = cw_supported_sample_rates[i];
- if (!ioctl(*fd, (int) SNDCTL_DSP_SPEED, &rate)) {
+ if (!ioctl(*fd, SNDCTL_DSP_SPEED, &rate)) {
if (rate != cw_supported_sample_rates[i]) {
cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_oss: imprecise sample rate:");
cw_debug_msg ((&cw_debug_object_dev), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_WARNING, "cw_oss: asked for: %u", cw_supported_sample_rates[i]);
@@ -373,7 +373,7 @@ int cw_oss_open_device_ioctls_internal(i
audio_buf_info buff;
- if (ioctl(*fd, (int) SNDCTL_DSP_GETOSPACE, &buff) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &buff) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_GETOSPACE): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -402,7 +402,7 @@ int cw_oss_open_device_ioctls_internal(i
/* parameter = 0x7fff << 16 | CW_OSS_SETFRAGMENT; */
parameter = 0x0032 << 16 | CW_OSS_SETFRAGMENT;
- if (ioctl(*fd, (int) SNDCTL_DSP_SETFRAGMENT, &parameter) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_SETFRAGMENT, &parameter) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_SETFRAGMENT): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -411,7 +411,7 @@ int cw_oss_open_device_ioctls_internal(i
"cw_oss: fragment size is 2^%d = %d", parameter & 0x0000ffff, 2 << ((parameter & 0x0000ffff) - 1));
/* Query fragment size just to get the driver buffers set. */
- if (ioctl(*fd, (int) SNDCTL_DSP_GETBLKSIZE, &parameter) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_GETBLKSIZE, &parameter) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_DSP_GETBLKSIZE): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -432,7 +432,7 @@ int cw_oss_open_device_ioctls_internal(i
}
#endif
- if (ioctl(*fd, (int) SNDCTL_DSP_GETOSPACE, &buff) == -1) {
+ if (ioctl(*fd, SNDCTL_DSP_GETOSPACE, &buff) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl(SNDCTL_GETOSPACE): \"%s\"", strerror(errno));
return CW_FAILURE;
@@ -480,7 +480,7 @@ int cw_oss_get_version_internal(int fd,
assert (fd);
int parameter = 0;
- if (ioctl(fd, (int) OSS_GETVERSION, &parameter) == -1) {
+ if (ioctl(fd, OSS_GETVERSION, &parameter) == -1) {
cw_debug_msg ((&cw_debug_object), CW_DEBUG_SOUND_SYSTEM, CW_DEBUG_ERROR,
"cw_oss: ioctl OSS_GETVERSION");
return CW_FAILURE;

View File

@ -0,0 +1,16 @@
--- src/xcwcp/Makefile.am.orig 2018-08-07 21:13:40 UTC
+++ src/xcwcp/Makefile.am
@@ -61,13 +61,8 @@ CLEANFILES = moc_application.cc
# Qt5 magic
-if HOST_IS_FREEBSD
-moc_application.cc: application.h
- $(AC_QT5_MOC) application.h -o application.cc
-else
moc_application.cc: application.h
$(AC_QT5_MOC) $< -o $@
-endif

View File

@ -0,0 +1,18 @@
--- src/xcwcp/application.cc.orig 2018-08-08 04:24:39 UTC
+++ src/xcwcp/application.cc
@@ -1126,6 +1126,7 @@ void Application::make_auxiliaries_end(v
void Application::check_audio_system(cw_config_t *config)
{
+#ifndef __FreeBSD__
if (config->audio_system == CW_AUDIO_ALSA
&& cw_is_pa_possible(NULL)) {
@@ -1137,6 +1138,7 @@ void Application::check_audio_system(cw_
msgBox.setText(message1 + " " + message2 + message3.arg(config->program_name).arg(config->program_name));
msgBox.exec();
}
+#endif
return;
}