summaryrefslogtreecommitdiff
blob: e341772cdfb317528e0e10f5aab6bd26d240280c (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-im/psi/psi-0.11_pre20070314.ebuild,v 1.2 2007/05/05 05:05:17 jer Exp $

inherit confutils eutils qt4

MY_PV="${PV:8:4}-${PV:12:2}-${PV:14:2}"
MY_P="${PN}-dev-snapshot-${MY_PV}"

IUSE="doc jingle plugins sasl spell ssl xscreensaver"

DESCRIPTION="QT 4.x Jabber Client, with Licq-like interface"
HOMEPAGE="http://psi-im.org/"
SRC_URI="http://psi-im.org/files/snapshot/${MY_P}.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~hppa ~x86"

S="${WORKDIR}/${MY_P}"

PLUGINS="chess echo noughtsandcrosses"

RDEPEND="$(qt4_min_version 4.2)
	media-libs/libpng
	sys-libs/zlib
	dev-libs/glib
	jingle? ( ~net-libs/ortp-0.7.1
		media-libs/speex )
	sasl? ( dev-libs/cyrus-sasl )
	spell? ( app-text/aspell )
	ssl? ( dev-libs/openssl )
	xscreensaver? ( x11-libs/libXScrnSaver )"

DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

pkg_setup() {
	if ! (built_with_use x11-libs/qt qt3support); then
		eerror "In order to compile Psi, you will need to recompile"
		eerror "qt-4.2 with qt3support USE-flag enabled."
		die "Recompile qt4 with qt3support use flag enabled"
	fi;
}

src_unpack() {
	unpack ${A}

	cd ${S}
	use jingle && epatch ${FILESDIR}/psi-jingle-gcc4.patch

	if use plugins; then
		epatch ${FILESDIR}/psi-ptr_64bit_fix.patch
		epatch ${FILESDIR}/psi-echoplugin.patch
	fi;
}

src_compile() {
	# growl is mac osx extension only - maybe someday we will want this
	local myconf="--disable-growl"

	# jingle is still alpha code...
	if use jingle; then
		mv configure-jingle configure
		chmod +x configure

		myconf="${myconf}  --enable-jingle"
	else
		# xmms must die!
		myconf="${myconf}  --disable-xmms"
	fi;

	QTDIR=/usr/lib ./configure \
		--prefix=/usr \
		$(enable_extension_disable xss xscreensaver) \
		$(enable_extension_disable cyrussasl sasl) \
		$(enable_extension_disable aspell spell) \
		$(enable_extension_disable openssl ssl) \
		$(use_enable plugins) \
		${myconf} || die "configure failed"

	# for custom CXXFLAGS - should use eqmake in near future
	cd ${S}/src
	qmake src.pro \
		QTDIR=/usr/lib \
		QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
		QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
		QMAKE=/usr/bin/qmake \
		QMAKE_RPATH= \
		"CONFIG+=no_fixpath release" \
		|| die "qmake failed"

	cd ${S}
	qmake psi.pro \
		QTDIR=/usr/lib \
		QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
		QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
		QMAKE=/usr/bin/qmake \
		QMAKE_RPATH= \
		"CONFIG+=no_fixpath release" \
		|| die "qmake failed"

	# for now, we need bundled qca :/
	cd ${S}/third-party/qca
	qmake qca.pro \
		QTDIR=/usr/lib \
		QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
		QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
		QMAKE=/usr/bin/qmake \
		QMAKE_RPATH= \
		"CONFIG+=no_fixpath release" \
		|| die "qmake failed"

	if use jingle; then
		cd ${S}/third-party/libjingle
		qmake libjingle.pro \
			QTDIR=/usr/lib \
			QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
			QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
			QMAKE=/usr/bin/qmake \
			QMAKE_RPATH= \
			"CONFIG+=no_fixpath release" \
			|| die "qmake failed"

	fi;

	cd ${S}
	emake || die "make failed"

	use plugins && for pl in ${PLUGINS}; do
		cd ${S}/src/plugins/generic/${pl}
		qmake ${pl}plugin.pro \
			QTDIR=/usr/lib \
			QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
			QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
			QMAKE=/usr/bin/qmake \
			QMAKE_RPATH= \
			"CONFIG+=no_fixpath release" \
			|| die "qmake failed"
		make || die "make plugin ${pl} failed"
	done

	if use doc; then
		cd ${S}/doc
		make api_public
	fi;
}

src_install() {
	emake INSTALL_ROOT="${D}" install || die "emake install failed"

	#this way the docs will also be installed in the standard gentoo dir
	newdoc ${S}/iconsets/roster/README README.roster
	newdoc ${S}/iconsets/system/README README.system
	newdoc certs/README README.certs
	dodoc ChangeLog README TODO

	if use plugins; then
		dodir /usr/share/psi/plugins
		for pl in ${PLUGINS}; do
			cp ${S}/src/plugins/generic/${pl}/lib${pl}plugin.so ${D}/usr/share/psi/plugins
		done;
	fi;

	use doc && cp -ar ${S}/doc/api ${D}/usr/share/psi
}