summaryrefslogtreecommitdiff
blob: 69b0a28bea6db1aeaa4d11004d583428f49d0be6 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-libs/qwt/qwt-4.2.0-r3.ebuild,v 1.8 2009/05/05 08:20:09 ssuominen Exp $

EAPI=1

inherit multilib qt3

SRC_URI="mirror://sourceforge/qwt/${P}.tar.bz2"
HOMEPAGE="http://qwt.sourceforge.net/"
DESCRIPTION="2D plotting library for Qt"
LICENSE="qwt"
KEYWORDS="amd64 ia64 ppc ppc64 x86"
SLOT="0"
IUSE="doc examples"

RDEPEND="x11-libs/qt:3"
DEPEND="${RDEPEND}"

src_compile () {
	# Remove hardcoded -fno-exceptions from CXXFLAGS
	find . -type f -name "*.pro" | while read file; do
		sed -i -e 's/-fno-exceptions//g' ${file} \
			|| die "sed failed"
	done

	# Set include path for bundled examples
	find examples -type f -name "*.pro" | while read file; do
		echo >> ${file} "INCLUDEPATH += /usr/include/qwt"
	done

	eqmake3
	emake || die "emake failed"

	cd designer
	eqmake3 qwtplugin.pro
	emake || die "emake designer failed"
}

src_install () {
	local QWTVER="${PV}"

	# Library and symlinks
	dolib.so lib/libqwt.so.${QWTVER} \
		|| die "dolib libqwt.so.${QWTVER} failed"
	dosym libqwt.so.${QWTVER} /usr/$(get_libdir)/libqwt.so.${QWTVER%%.*}
	dosym libqwt.so.${QWTVER} /usr/$(get_libdir)/libqwt.so.${QWTVER%.*}

	# Header files
	dodir /usr/include/qwt
	insinto /usr/include/qwt
	doins include/* || die "headers installation failed"

	# Designer plugin
	insinto "${QTDIR}"/plugins/designer
	insopts -m0755
	doins designer/plugins/designer/libqwtplugin.so \
		|| die "designer plugin installation failed"

	dodoc CHANGES README

	if use doc; then
		doman doc/man/man3/* || die "doman failed"
		dohtml doc/html/* || die "dohtml failed"
	fi

	if use examples; then
		cp -pPR examples "${D}"/usr/share/doc/${PF}/
	fi
}