summaryrefslogtreecommitdiff
blob: cab18807691d726c49ad63e65ecb27de9ef68d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils gnome2

DESCRIPTION="H.323 and SIP VoIP softphone"
HOMEPAGE="http://www.ekiga.org/"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~ppc ~x86"
IUSE="avahi dbus debug doc eds gconf gnome +h323 ldap libnotify mmx nls +shm
+sip static v4l xv"

RDEPEND=">=dev-libs/glib-2.8.0:2
	dev-libs/libsigc++:2
	dev-libs/libxml2:2
	=net-libs/ptlib-2.4*[debug=]
	=net-libs/opal-3.4*[debug=,h323?,sip?,wav]
	>=x11-libs/gtk+-2.12.0:2
	sys-devel/gettext
	avahi? ( >=net-dns/avahi-0.6[dbus] )
	dbus? ( >=sys-apps/dbus-0.36 >=dev-libs/dbus-glib-0.36 )
	eds? ( >=gnome-extra/evolution-data-server-1.2 )
	gconf? ( >=gnome-base/gconf-2.6.0:2 )
	gnome? ( >=gnome-base/libgnome-2.14.0
		>=gnome-base/libgnomeui-2.14.0 )
	ldap? ( net-nds/openldap )
	libnotify? ( x11-libs/libnotify )
	shm? ( x11-libs/libXext )
	xv? ( x11-libs/libXv )"
DEPEND="${RDEPEND}
	>=sys-devel/make-3.81
	>=dev-util/pkgconfig-0.20
	>=dev-util/intltool-0.35
	doc? ( app-text/scrollkeeper
		app-text/gnome-doc-utils )
	v4l? ( sys-kernel/linux-headers )"

DOCS="AUTHORS ChangeLog FAQ NEWS README TODO"

# NOTES:
#
# make 3.80 is breaking installation phase, need make 3.81 at least
# gettext is required for glib and intltool so not directly but painless to add
# ekiga doesn't work with opal-3.5* and ptlib-2.5*

pkg_setup() {
	# dbus-service: always enable if dbus is enabled, no reason to disable it
	# scrollkeeper: updates scrollkeeper database
	# schemas-install: install gconf schemas
	G2CONF="${G2CONF}
		--disable-dependency-tracking
		--enable-fast-install
		--disable-maintainer-mode
		--enable-libtool-lock
		$(use_enable avahi)
		$(use_enable dbus)
		$(use_enable dbus dbus_service)
		$(use_enable debug)
		$(use_enable doc gdu)
		$(use_enable doc scrollkeeper)
		$(use_enable eds)
		$(use_enable gconf)
		$(use_enable gconf schemas-install)
		$(use_enable gnome)
		$(use_enable ldap)
		$(use_enable libnotify notify)
		$(use_enable nls)
		$(use_enable static static-libs)
		$(use_enable xv)"
}

src_prepare() {
	# remove call to gconftool-2 --shutdown
	# upstream has been contacted, see bug 555976 in their bugtracker
	# TODO: ekiga team don't agree with this patch
	sed -i -e '/gconftool-2 --shutdown/d' Makefile.in \
		|| die "patching Makefile.in failed"

	# fix ekiga-helper dbus service .in file
	# has been fixed by upstream, see bug 555974 in their bug tracker
	# TODO: check for fix in new releases
	sed -i -e 's/@PACKAGE_NAME@/ekiga/'\
		src/components/org.ekiga.Helper.service.in \
		|| die "patching src/components/org.ekiga.Helper.service.in failed"

	# fix compilation issues when PTRACING is disabled in ptlib
	# upstream has been contacted, see bug 575433 in their bugtracker
	epatch "${FILESDIR}"/${P}-ptracing.patch

	# mmx is automatically enabled for some arch, want it to be a user choice
	# upstream has been contacted, see bug 575831 in their bugtracker
	if use mmx; then
		sed -i -e "s/use_x86_asm=no/use_x86_asm=yes/" configure \
			|| die "patching configure failed"
	else
		sed -i -e "s/use_x86_asm=yes/use_x86_asm=no/" configure \
			|| die "patching configure failed"
	fi

	# SIP is automatically enabled with opal[sip], want it to be a user choice
	# upstream has been contacted, see bug 575832 in their bugtracker
	if ! use sip; then
		sed -i -e "s/SIP=\"yes\"/SIP=\"no\"/" configure \
			|| die "patching configure failed"
		sed -i -e \
			"s:SIP=\`\$PKG_CONFIG --variable=OPAL_SIP opal\`:SIP=\"no\":" \
			configure || die "patching configure failed"
	fi

	# H323 is automatically enabled with opal[h323], want it to be a user choice
	# upstream has been contacted, see bug 575833 in their bugtracker
	if ! use h323; then
		sed -i -e "s/H323=\"yes\"/H323=\"no\"/" configure \
			|| die "patching configure failed"
		sed -i -e \
			"s:H323=\`\$PKG_CONFIG --variable=OPAL_H323 opal\`:H323=\"no\":" \
			configure || die "patching configure failed"
	fi

	# SHM support from libXext is auto-enabled, want it to be a user choice
	# upstream has been contacted, see bug 575835 in their bugtracker
	if ! use shm; then
		sed -i -e "s/with_shm=\"yes\"/with_shm=\"no\"/" configure \
			 || die "patching configure failed"
	fi

	# V4L support is auto-enabled, want it to be a user choice
	# do not contact upstream because that's a hack
	# TODO: check if upstream has removed this hack
	if ! use v4l; then
		sed -i -e "s/V4L=\"enabled\"/V4L=\"disabled\"/" configure \
			|| die "patching configure failed"
	fi
}

pkg_postinst() {
	gnome2_pkg_postinst

	if ! use gnome; then
		ewarn "USE=-gnome is experimental, some weirdness with the UI and"
		ewarn "config keys should appear."
	fi
}