summaryrefslogtreecommitdiff
blob: 93bfaa1d32e3f137363f011c2040430bbc9dce25 (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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

LANGS="ar be bg cs de en_GB es fr he nds ru sk uk uz zh_CN"

inherit qt4-r2 cmake-utils

MY_PV="${PV/_p/.p_}"
DESCRIPTION="Qt4-based multi-protocol instant messenger"
HOMEPAGE="http://www.qutim.org"
SRC_URI="http://www.qutim.org/dwnl/80/${PN}-${MY_PV}.tar.xz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 x86"

# general USE
IUSE="doc +sound tools"
# protocol uses
IUSE="$IUSE telepathy irc xmpp jingle mrim oscar purple vkontakte"
# plugins
IUSE="$IUSE antiboss aspell ayatana awn crypt dbus debug -espionage histman hunspell
	kde mobility otr plugman phonon purple qml sdl +ssl +xscreensaver webkit"

REQUIRED_USE="
	oscar? ( ssl )
	jingle? ( xmpp )
	qml? ( webkit )
"

# Minimum Qt version required
QT_PV="4.7.0:4"

CDEPEND="
	x11-libs/libqxt
	>=dev-qt/qtcore-${QT_PV}[ssl?]
	>=dev-qt/qtgui-${QT_PV}
	>=dev-qt/qtscript-${QT_PV}
	>=dev-qt/qtdeclarative-${QT_PV}

	telepathy? ( >=net-libs/telepathy-qt-0.3 )
	xmpp? (
		app-crypt/qca:2[qt4(+)]
		>=net-libs/jreen-1.2.0[qt4]
	)
	jingle? ( dev-qt/qt-mobility[multimedia] )
	oscar? ( app-crypt/qca:2[qt4(+)] )
	purple? ( net-im/pidgin )
	vkontakte? ( >=dev-qt/qtwebkit-${QT_PV} )

	aspell? ( app-text/aspell )
	awn? ( >=dev-qt/qtdbus-${QT_PV} )
	crypt? ( app-crypt/qca:2[qt4(+)] )
	dbus? ( >=dev-qt/qtdbus-${QT_PV} )
	espionage? ( app-crypt/qca:2[qt4(+)] )
	histman? ( >=dev-qt/qtsql-${QT_PV} )
	ayatana? ( >=dev-libs/libindicate-qt-0.2.2 )
	hunspell? ( app-text/hunspell )
	kde? ( kde-frameworks/kdelibs:4 )
	mobility? (
		dev-qt/qt-mobility[multimedia,feedback]
		>=dev-qt/qtbearer-${QT_PV}
	)
	otr? ( >=net-libs/libotr-4.0.0 )
	phonon? (
		kde? ( media-libs/phonon[qt4] )
		!kde? ( || ( >=dev-qt/qtphonon-${QT_PV} media-libs/phonon[qt4] ) )
	)
	plugman? (
		dev-libs/libattica
		app-arch/libarchive
	)
	qml? (
		>=dev-qt/qtopengl-${QT_PV}
	)
	sdl? ( media-libs/sdl-mixer )
	xscreensaver? ( x11-libs/libXScrnSaver )
	webkit? ( >=dev-qt/qtwebkit-${QT_PV} )
"
DEPEND="${CDEPEND}
	virtual/pkgconfig
	doc? ( app-doc/doxygen )
	kde? ( dev-util/automoc )
"
RDEPEND="${CDEPEND}
	xmpp? ( app-crypt/qca:2[gpg] )
	oscar? ( app-crypt/qca:2[ssl] )
	kde-frameworks/oxygen-icons
"

DOCS=( AUTHORS INSTALL ChangeLog )
PATCHES=(
	"${FILESDIR}/${PN}-0.3.2-astral-migrate-qt-telepaphy.patch"
)

S="${WORKDIR}/${PN}-${MY_PV}"

src_prepare() {
	# fix automagic dep on libXScrnSaver
	if ! use xscreensaver; then
		sed -i -e '/XSS xscrnsaver/d' \
			core/src/corelayers/idledetector/CMakeLists.txt || die
	fi

	# fix automagic dep on qt-mobility for jingle
	if ! use jingle; then
		sed -i -e '/find_package(QtMobility)/d' \
			protocols/jabber/CMakeLists.txt || die
	fi

	# remove unwanted translations
	local lang
	for lang in ${LANGS}; do
		use linguas_${lang} || rm -f translations/modules/*/${lang}.{po,ts}
	done

	cmake-utils_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DSYSTEM_JREEN=ON
		$(cmake-utils_use_with doc DOXYGEN)
		$(cmake-utils_use doc     QUTIM_GENERATE_DOCS)
		$(cmake-utils_use sound   QUTIM_INSTALL_SOUND_THEME  )
		$(cmake-utils_use tools   QUTIM_DEVELOPER_BUILD      )

		# protocols
		$(cmake-utils_use telepathy ASTRAL )
		$(cmake-utils_use irc              )
		$(cmake-utils_use xmpp JABBER      )
		$(cmake-utils_use mrim             )
		$(cmake-utils_use oscar            )
		$(cmake-utils_use purple QUETZAL   )
		$(cmake-utils_use vkontakte        )

		# plugins
		$(cmake-utils_use  webkit      ADIUMWEBVIEW      )
		$(cmake-utils_use  crypt       AESCRYPTO         )
		$(cmake-utils_use  antiboss    ANTIBOSS          )
		$(cmake-utils_use  aspell      ASPELLER          )
		$(cmake-utils_use  awn         AWN               )
		$(cmake-utils_use  espionage   CONTROL           ) # Also requires -DENABLE_ESPIONAGE=ON (see bellow)
		$(cmake-utils_use  dbus        DBUSAPI           )
		$(cmake-utils_use  dbus        DBUSNOTIFICATIONS )
		$(cmake-utils_use  histman     HISTMAN           )
		$(cmake-utils_use  hunspell    HUNSPELLER        )
		$(cmake-utils_use  ayatana     INDICATOR         )
		$(cmake-utils_use  kde         KDEINTEGRATION    )
		$(cmake-utils_use  qml         KINETICPOPUPS     )
		$(cmake-utils_use  phonon      PHONONSOUND       )
		$(cmake-utils_use  plugman     PLUGMAN           )
		$(cmake-utils_use  debug       LOGGER            )
		$(cmake-utils_use  mobility    MOBILITY          )
		$(cmake-utils_use  dbus        NOWPLAYING        )
		$(cmake-utils_use  otr         OFFTHERECORD      )
		$(cmake-utils_use  qml         QMLCHAT           )
		$(cmake-utils_use  sdl         SDLSOUND          )
		$(cmake-utils_use_enable espionage               )
		-DLINUXINTEGRATION=ON
		-DDOCKTILE=OFF	# QtDockTile currenly supports only unity;
						# consider to make it optional if it also support kde or whatever
		-DUPDATER=OFF
	)
	# NOTE: Integration plugins are autodisabled:
	# symbianintegration macintegration maemo5integration haikunotifications meegointegration winintegration

	cmake-utils_src_configure
}

pkg_postinst () {
	elog "Next qutim plugins are enabled by default:"
	elog "  antispam autopaster autoreply birthdayreminder blogimprover clconf"
	elog "  emoedit floaties formula highlighter imagepub massmessaging"
	elog "  oldcontactdelegate qrcicons screenshoter scriptapi unreadmessageskeeper urlpreview"
	elog "  weather webhistory yandexnarod"
	elog "If you have strong reasons to make their build optional feel free to fill bugrepot."

	if use espionage; then
		ewarn "You have enabled the control (espionage) plugin. It may "
		ewarn "deal negative security impact on the privacy of your client."
	fi
}