[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#652618: cwdaemon: FTBFS, build-depends can no longer be fullfilled



On 21.12.2011 21:26, Kamal Mostafa wrote:
The good news is that I kind of fixed it.  The bad news is, that I can't
test the resulting package.  Also just replacing the build-depens on
unixcw-dev with libcw3-dev didn't solved the issue, I guess that means
that the "Provides: unixcw-dev" of libcw3-dev is not true.

You're correct.  the renamed libcw3{-dev} packages don't properly
Provide unixcw{-dev}, but they should.  We'll fix that.
I'm by no means an expert on packaging, but since there were so many changes in libcw3, shouldn't we stress this by *not* providing unixcw{-dev} Debian package?


I had to do some further changes (see attached debdiff).  To my
understanding the calls cw_set_soundcard_sound and cw_set_console_sound
are no longer necessary, as libcw automatically picks the right one?

Lets ask the new upstream author/maintainer...  Kamil, can you comment
on that?  Did you eliminate those routines from the new libcw?
The two functions are missing from libcw3 because:
a) you can't have console output and soundcard output at the same time (this should be reflected in cwdaemon.c which at this point allows "b(oth)" option), b) selection of sound output is made at library initialization time with call of cw_generator_new(<sound system>, <optional alternative sound device name>);

2) Is the patch correct? Anyone can test it?
I've created my own patch (attached), only for cwdaemon.c, but I was unable to test it at the moment: my only machine with serial port is somewhere in my apartment, but bringing it back to life would take some time. Not in this week, for certain. The patch is my best effort at the moment, but it may not work 100% correctly. I can't confirm its full correctness without tests.


And for the Debian Hamradio Maintainers:
3) Shouldn't libcw3-dev have a dependency on libasound2-dev?  Apparently
    that's needed for successfull linking.
4) Are libcw's pc files correct?  As you can see, I also had to add also
    to the CFLAGS and lib calls.
5) Wouldn't you like to adopt cwdaemon, if it's worth to be kept?

I do think cwdaemon is worth keeping, and I will adopt it.

Kamil and I will fix unixcw/libcw3 and then I will apply whatever
remaining bits of your patch to cwdaemon are still necessary.
IMHO the only things that should be fixed in libcw are:
 - dependency on libasound2-dev,
 - pc file.
Should I handle this? I could start doing this no sooner than next Tuesday (28.12).

One final note: when updating unixcw package I was careful enough to check what Debian packages depend on unixcw(-dev). "apt-cache rdepends" showed only programs from unixcw source package (cw, cwcp, xcwcp), so did "apt-cache search unixcw". This page doesn't mention unixcw either:
http://packages.debian.org/sid/cwdaemon

I would be happy to test libcw3 with some application not coming from unixcw source package, provided that it can be tested on a machine with fairly modern hardware requirements. My machine with serial port has been gathering dust for a long time, and will stop cooperating sooner or later :/

Best regards,
Kamil
--- before/cwdaemon-0.9.4/cwdaemon.c	2006-11-09 10:23:11.000000000 +0100
+++ after/cwdaemon-0.9.4/cwdaemon.c	2011-12-21 22:29:57.000000000 +0100
@@ -89,7 +89,7 @@
 #endif
 #include <limits.h>

-#include <cwlib.h>
+#include <libcw.h>
 #include "cwdaemon.h"

 /* network vars */
@@ -165,6 +165,9 @@
 cwdevice *cwdev;
 static void playmorsestring (char *x);

+static int set_libcw_output (void);
+static void close_libcw (void);
+
 /* catch ^C when running in foreground */
 static RETSIGTYPE
 catchint (int signal)
@@ -299,18 +302,52 @@
 	}
 }

-/* initialize unixcw */
+/* (re)set initial parameters of libcw */
 static void
-initmorse (void)
+reset_libcw (void)
 {
+	/* just in case if an old generator exists */
+	close_libcw ();
+
+	set_libcw_output ();
+
 	cw_set_frequency (morse_tone);
 	cw_set_send_speed (morse_speed);
-	cw_set_soundcard_sound (soundcard_sound);
-	cw_set_console_sound (console_sound);
 	cw_set_volume (morse_volume);
 	cw_set_gap (0);
 }

+static void
+close_libcw (void)
+{
+	cw_generator_stop ();
+	cw_generator_delete ();
+}
+
+/* set up output of libcw */
+static int
+set_libcw_output (void)
+{
+	int rv = 0;
+	if (soundcard_sound && !console_sound)
+       {
+		rv = cw_generator_new (CW_AUDIO_SOUNDCARD, NULL);
+	}
+	else if (!soundcard_sound && console_sound)
+	{
+		rv = cw_generator_new (CW_AUDIO_CONSOLE, NULL);
+	}
+	else
+	{
+		/* libcw can't do both soundcard and console,
+		   and it has to have one and only one sound
+		   system specified */
+		errmsg ("Sound output specified incorrectly");
+	        rv = CW_FAILURE;
+	}
+	return rv == CW_FAILURE ? -1 : 0;
+}
+
 /* properly parse a 'long' integer */
 static int
 get_long(const char *buf, long *lvp)
@@ -371,7 +408,7 @@
 				morse_volume = 70;
 				console_sound = 1;
 				soundcard_sound = 0;
-				initmorse ();
+				reset_libcw ();
 				wordmode = 0;
 				async_abort = 0;
 				cwdev->reset (cwdev);
@@ -559,8 +596,7 @@
 				if (valid_sdevice == 1)
 				{
 					debug ("Sound device: %s", message + 2);
-					cw_set_soundcard_sound (soundcard_sound);
-					cw_set_console_sound (console_sound);
+					set_libcw_output ();
 				}
 				break;
 			case 'g':	/* volume */
@@ -858,7 +894,9 @@
 	}
 	cwdev->desc = keydev;

-	initmorse ();
+	reset_libcw ();
+	atexit (close_libcw);
+
 	cw_register_keying_callback (keyingevent, NULL);

 	debug ("Device used: %s", cwdev->desc);

Reply to: