summaryrefslogtreecommitdiff
blob: d7c4064c5e2133d5f694d586b15c5245c10d3851 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="1"

inherit eutils kde-functions multilib

DESCRIPTION="ICQ Client with v8 support"
HOMEPAGE="http://www.licq.org/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="2"
KEYWORDS="~amd64 ~x86"
IUSE="crypt debug kde msn ncurses nls qt3 qt4 socks5 ssl xosd"

# we use kde as KDE4
RDEPEND="kde? (
		qt4? ( kde-base/kdelibs:4.1 )
		qt3? ( kde-base/kdelibs:3.5 )
	)
	ssl? ( dev-libs/openssl )
	qt3? ( x11-libs/qt:3 )
	qt4? ( x11-libs/qt-gui:4 )
	nls? ( sys-devel/gettext )
	ncurses? ( sys-libs/ncurses =dev-libs/cdk-5* )
	crypt? ( app-crypt/gpgme:1 )
	xosd? ( x11-libs/xosd )"
DEPEND="${RDEPEND}
	dev-libs/boost
	qt4? ( >=dev-util/cmake-2.6.2 )"

_generate_plugins_directories() {
	PLUGINS="auto-reply email rms"
	use msn && PLUGINS="${PLUGINS} msn"
	use ncurses && PLUGINS="${PLUGINS} console"
	use xosd &&  PLUGINS="${PLUGINS} osd"
	# QT4 is something extra. Uses cmake.
	use qt4 && PLUGINS_CMAKE="${PLUGINS_CMAKE} qt4-gui"
	use qt3 && PLUGINS="${PLUGINS} qt-gui"
	elog "I will generate these plugins/frontends for licq:"
	elog "${PLUGINS} ${PLUGINS_CMAKE}"
}

pkg_setup() {
	_generate_plugins_directories
}

src_compile() {
	local myconf myconf2 plugin
	# global config setup for automake
	myconf="$(use_enable crypt gpgme)
		$(use_enable ssl openssl)
		$(use_enable socks5)
		$(use_enable debug)
		$(use_enable nls)"

	einfo "Compiling Licq core."
	econf ${myconf} || die "econf failed"
	emake || die "emake failed"

	for plugin in ${PLUGINS}; do
		cd "${S}"/plugins/"${plugin}"
		einfo "Compiling Licq: \"${plugin}\"."
		if use qt3; then
			set-qtdir 3
			set-kdedir 3
			use kde && myconf2="${myconf} --with-kde"
			myconf2="${myconf2} --with-qt-libraries=${QTDIR}/$(get_libdir)"
		fi
		econf ${myconf} ${myconf2} || die "econf failed"
		emake || die "emake failed"
	done
	# we like qt4 it uses cmake
	if use qt4; then
		cd "${S}"/plugins/qt4-gui
		einfo "Compiling Licq: \"qt4-gui\"."
		# Possible error because of one tiny issue we introduce in kde
		# it is called kdeprefix and in that case you can't be sure where it
		# find kde stuff. This is working only for -kdeprefix so someone will
		# need to fix this later
		myconf2="-DCMAKE_INSTALL_PREFIX=/usr"
		# kde not yet workie
		# use kde && myconf2="${myconf2} -DWITH_KDE=1"
		use kde && ewarn "Sorry but kde4 support is duped and not working so not
		enabling for now"
		cmake . ${myconf2} || die "cmake failed"
		emake || die "emake failed"
	fi
}

src_install() {
	# install core
	einfo "Installing Licq core."
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc ChangeLog INSTALL README* doc/*
	# Install the plug-ins
	for plugin in ${PLUGINS}; do
		cd "${S}"/plugins/"${plugin}"
		einfo "Installing Licq: \"${plugin}\"."
		emake DESTDIR="${D}" install || die "emake install failed"
		dodoc README* *.conf
	done
	if use qt4; then
		cd "${S}"/plugins/qt4-gui
		einfo "Installing Licq: \"qt4-gui\"."
		emake DESTDIR="${D}" install || die
		docinto plugins/qt4-gui
		dodoc doc/README*
	fi

	exeinto /usr/share/${PN}/upgrade
	doexe "${S}"/upgrade/*

	# fixes bug #22136 and #149464
	rm -fR "${D}"/var
}