]> Pileus Git - ~andy/sunrise/blob - x11-misc/xneur/xneur-0.12.0-r1.ebuild
dev-libs/qextserialport: Fix qt deps, EAPI bump
[~andy/sunrise] / x11-misc / xneur / xneur-0.12.0-r1.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=2
6
7 inherit autotools eutils
8
9 DESCRIPTION="In-place conversion of text typed in with a wrong keyboard layout (Punto Switcher replacement)"
10 HOMEPAGE="http://www.xneur.ru/"
11 SRC_URI="http://dists.xneur.ru/release-${PV}/tgz/${P}.tar.bz2"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="aplay debug gstreamer keylogger libnotify nls openal openmp xosd +spell"
17
18 COMMON_DEPEND=">=dev-libs/libpcre-5.0
19         sys-libs/zlib
20         >=x11-libs/libX11-1.1
21         x11-libs/libXtst
22         gstreamer? ( >=media-libs/gstreamer-0.10.6 )
23         !gstreamer? (
24                 openal? ( >=media-libs/freealut-1.0.1 )
25                 !openal? (
26                         aplay? ( >=media-sound/alsa-utils-1.0.17 ) ) )
27         libnotify? ( >=x11-libs/libnotify-0.4.0 )
28         spell? ( app-text/enchant )
29         xosd? ( x11-libs/xosd )"
30 RDEPEND="${COMMON_DEPEND}
31         gstreamer? ( media-libs/gst-plugins-good
32                 media-plugins/gst-plugins-alsa )
33         nls? ( virtual/libintl )"
34 DEPEND="${COMMON_DEPEND}
35         virtual/pkgconfig
36         openmp? ( sys-devel/gcc[openmp] )
37         nls? ( sys-devel/gettext )"
38
39 src_prepare() {
40         # Fixes error/warning: no newline at end of file
41         find -name '*.c' -exec sed -i -e '${/[^ ]/s:$:\n:}' {} + || die
42         rm -f m4/{lt~obsolete,ltoptions,ltsugar,ltversion,libtool}.m4 \
43                 ltmain.sh aclocal.m4 || die
44
45         sed -i -e "s/-Werror -g0//" configure.in
46         epatch "${FILESDIR}/${P}-libnotify-0.7.patch"
47         eautoreconf
48 }
49
50 src_configure() {
51         local myconf
52
53         if use gstreamer; then
54                 elog "Using gstreamer for sound output."
55                 myconf="--with-sound=gstreamer"
56         elif use openal; then
57                 elog "Using openal for sound output."
58                 myconf="--with-sound=openal"
59         elif use aplay; then
60                 elog "Using aplay for sound output."
61                 myconf="--with-sound=aplay"
62         else
63                 elog "Sound support disabled."
64                 myconf="--with-sound=no"
65         fi
66
67         econf ${myconf} \
68                 $(use_with debug) \
69                 $(use_enable openmp) \
70                 $(use_enable nls) \
71                 $(use_with spell) \
72                 $(use_with xosd) \
73                 $(use_with libnotify) \
74                 $(use_with keylogger)
75 }
76
77 src_install() {
78         emake DESTDIR="${D}" install || die
79         dodoc AUTHORS ChangeLog README NEWS TODO || die
80 }
81
82 pkg_postinst() {
83         elog "This is command line tool. If you are looking for GUI frontend just"
84         elog "emerge gxneur, which uses xneur transparently as backend."
85
86         ewarn "If you upgraded from <=xneur-0.9.3, you need to remove"
87         ewarn "dictionary files in the home directory:"
88         ewarn " $ rm ~/.xneur/{ru,en,be,etc.}/dict"
89
90         ewarn
91         ewarn "Note: if xneur became slow, try to comment out AddBind options in config file."
92 }