summaryrefslogtreecommitdiff
blob: 688f6f26b36fa2a5aee3b6049859f46c18df016b (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/qmf/qmf-2.0_p201209-r1.ebuild,v 1.1 2013/02/09 09:00:11 pesa Exp $

EAPI=5

inherit qt4-r2

if [[ ${PV} == *9999* ]]; then
	inherit git-2
	EGIT_REPO_URI="git://gitorious.org/qt-labs/messagingframework.git
		https://git.gitorious.org/qt-labs/messagingframework.git"
else
	SRC_URI="http://dev.gentoo.org/~pesa/distfiles/${P}.tar.gz"
	S=${WORKDIR}/qt-labs-messagingframework
fi

DESCRIPTION="The Qt Messaging Framework"
HOMEPAGE="http://qt.gitorious.org/qt-labs/messagingframework"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug doc examples test"

RDEPEND="
	dev-libs/icu:=
	sys-libs/zlib
	>=x11-libs/qt-core-4.6.0:4
	>=x11-libs/qt-gui-4.6.0:4
	>=x11-libs/qt-sql-4.6.0:4
	examples? ( >=x11-libs/qt-webkit-4.6.0:4 )
"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	test? ( >=x11-libs/qt-test-4.6.0:4 )
	!!<net-libs/qmf-2.0_p201209
"

DOCS="CHANGES"

PATCHES=(
	"${FILESDIR}/${PN}-tests.patch"
)

src_prepare() {
	qt4-r2_src_prepare

	# fix libdir
	find "${S}" -name '*.pro' -type f -print0 | xargs -0 \
		sed -i -re "s:/lib(/|$):/$(get_libdir)\1:" || die

	sed -i	-e '/benchmarks/d' \
		-e '/tests/d' \
		messagingframework.pro || die

	if ! use examples; then
		sed -i -e '/examples/d' messagingframework.pro || die
	fi
}

src_configure() {
	eqmake4 QMF_INSTALL_ROOT="${EPREFIX}/usr"
}

src_test() {
	echo ">>> Test phase [QTest]: ${CATEGORY}/${PF}"
	cd "${S}"/tests

	einfo "Building tests"
	eqmake4 QMF_INSTALL_ROOT="${EPREFIX}/usr"
	emake

	einfo "Running tests"
	export QMF_DATA="${T}"
	local fail=false test=
	for test in locks longstream longstring python_email qcop qlogsystem \
			qmailaddress qmailcodec qmaillog qmailmessage \
			qmailmessagebody qmailmessageheader qmailmessagepart \
			qmailnamespace qprivateimplementation; do
		if ! LC_ALL=C ./tst_${test}/tst_${test}; then
			eerror "'${test}' test failed!"
			fail=true
		fi
		echo
	done
	${fail} && die "some tests have failed!"
}

src_install() {
	qt4-r2_src_install

	if use doc; then
		emake docs

		dohtml -r doc/html/*
		dodoc doc/html/qmf.qch
		docompress -x /usr/share/doc/${PF}/qmf.qch
	fi
}