diff options
author | Thomas Beierlein <tomjbe@gentoo.org> | 2012-06-25 18:37:35 +0000 |
---|---|---|
committer | Thomas Beierlein <tomjbe@gentoo.org> | 2012-06-25 18:37:35 +0000 |
commit | 9a1854e99d0c24a171af3a1d6218b5eb3543a2e4 (patch) | |
tree | 6ec451f4217dc1f9d3620c901d8f1c8a997bc708 /media-radio | |
parent | Make libsamplerate mandatory and phonon optional. Require imagemagick/graphic... (diff) | |
download | gentoo-2-9a1854e99d0c24a171af3a1d6218b5eb3543a2e4.tar.gz gentoo-2-9a1854e99d0c24a171af3a1d6218b5eb3543a2e4.tar.bz2 gentoo-2-9a1854e99d0c24a171af3a1d6218b5eb3543a2e4.zip |
Adapt to new unixcw-3. Bug #423389. Thanks Diego
(Portage version: 2.1.11.1/cvs/Linux x86_64)
Diffstat (limited to 'media-radio')
-rw-r--r-- | media-radio/cwdaemon/ChangeLog | 6 | ||||
-rw-r--r-- | media-radio/cwdaemon/cwdaemon-0.9.4.ebuild | 12 | ||||
-rw-r--r-- | media-radio/cwdaemon/files/cwdaemon-0.9.4-unixcw3.patch | 134 |
3 files changed, 147 insertions, 5 deletions
diff --git a/media-radio/cwdaemon/ChangeLog b/media-radio/cwdaemon/ChangeLog index b1199a76ae02..f02d1daa6e7a 100644 --- a/media-radio/cwdaemon/ChangeLog +++ b/media-radio/cwdaemon/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-radio/cwdaemon # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-radio/cwdaemon/ChangeLog,v 1.17 2012/05/03 03:48:57 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-radio/cwdaemon/ChangeLog,v 1.18 2012/06/25 18:37:35 tomjbe Exp $ + + 25 Jun 2012; Thomas Beierlein <tomjbe@gentoo.org> cwdaemon-0.9.4.ebuild, + +files/cwdaemon-0.9.4-unixcw3.patch: + Adapt to new unixcw-3. Bug #423389. Thanks Diego 03 May 2012; Jeff Horelick <jdhore@gentoo.org> cwdaemon-0.9.4.ebuild: dev-util/pkgconfig -> virtual/pkgconfig diff --git a/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild b/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild index 47487d3b4db8..f7cda092c20c 100644 --- a/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild +++ b/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild @@ -1,6 +1,9 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild,v 1.4 2012/05/03 03:48:57 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-radio/cwdaemon/cwdaemon-0.9.4.ebuild,v 1.5 2012/06/25 18:37:35 tomjbe Exp $ + +EAPI=4 +inherit eutils DESCRIPTION="A morse daemon for the parallel or serial port" HOMEPAGE="http://www.ibiblio.org/pub/linux/apps/ham/morse" @@ -11,10 +14,11 @@ SLOT="0" KEYWORDS="~alpha ~amd64 ~ppc ~x86" IUSE="" -RDEPEND=">=media-radio/unixcw-2.3" +RDEPEND=">=media-radio/unixcw-3.0.2" DEPEND="$RDEPEND virtual/pkgconfig" -src_install() { - make DESTDIR="${D}" install || die "install failed" +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-unixcw3.patch } diff --git a/media-radio/cwdaemon/files/cwdaemon-0.9.4-unixcw3.patch b/media-radio/cwdaemon/files/cwdaemon-0.9.4-unixcw3.patch new file mode 100644 index 000000000000..c9b7acc8d9e0 --- /dev/null +++ b/media-radio/cwdaemon/files/cwdaemon-0.9.4-unixcw3.patch @@ -0,0 +1,134 @@ +# Changes to adapt to new unixcw-3 package thanks to AAPI changes in libcw +# Taken from debians patches from Kamil Ignacak, the maintainer of unixcw +--- cwdaemon.c.orig 2012-06-25 20:00:23.000000000 +0200 ++++ cwdaemon.c 2012-06-25 20:00:30.000000000 +0200 +@@ -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,17 +302,59 @@ + } + } + +-/* 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_ALSA, NULL); ++ if (rv != CW_FAILURE) ++ { ++ rv = cw_generator_start(); ++ } ++ } ++ else if (!soundcard_sound && console_sound) ++ { ++ rv = cw_generator_new (CW_AUDIO_CONSOLE, NULL); ++ if (rv != CW_FAILURE) ++ { ++ rv = cw_generator_start(); ++ } ++ } ++ 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 +@@ -320,7 +365,7 @@ + + errno = 0; + lv = strtol(buf, &ep, 10); +- if (buf[0] == '\0' || *ep != '\0') ++ if (buf[0] == '\0' || (*ep != '\0' && *ep != '\n')) + return (-1); + if (errno == ERANGE && (lv == LONG_MAX || lv == LONG_MIN)) + return (-1); +@@ -371,7 +416,7 @@ + morse_volume = 70; + console_sound = 1; + soundcard_sound = 0; +- initmorse (); ++ reset_libcw (); + wordmode = 0; + async_abort = 0; + cwdev->reset (cwdev); +@@ -559,8 +604,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 */ +@@ -640,6 +684,7 @@ + debug ("Morse = %c", c); + cw_send_character (c); + if (cw_get_gap () == 2) cw_set_gap (0); ++ cw_wait_for_tone_queue(); + } + x++; + i++; +@@ -858,7 +903,9 @@ + } + cwdev->desc = keydev; + +- initmorse (); ++ reset_libcw (); ++ atexit (close_libcw); ++ + cw_register_keying_callback (keyingevent, NULL); + + debug ("Device used: %s", cwdev->desc); |