summaryrefslogtreecommitdiff
blob: 687e6fd7eacd617b5e39d33a3d11e526a5a42c1d (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-text/kchmviewer/kchmviewer-3.1_p2.ebuild,v 1.3 2008/11/22 09:18:20 pva Exp $

inherit autotools kde-functions eutils versionator

MY_P=${PN}-$(replace_version_separator 2 '-')
MY_P=${MY_P/p}

DESCRIPTION="KchmViewer is a feature rich chm file viewer, based on Qt."
HOMEPAGE="http://www.kchmviewer.net/"
SRC_URI="mirror://sourceforge/kchmviewer/${MY_P}.tar.gz"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="arts kde"

DEPEND="=x11-libs/qt-3*
	dev-libs/chmlib
	kde? ( =kde-base/kdelibs-3.5* )"

S=${WORKDIR}/${PN}-$(get_version_component_range 1-2)

pkg_setup() {
	if use kde; then
		if use arts && ! built_with_use =kde-base/kdelibs-3.5* arts ; then
			eerror "You are trying to compile ${CATEGORY}/${PF} with the \"arts\" USE flag enabled."
			eerror "However, $(best_version =kde-base/kdelibs-3.5*) was compiled with this flag disabled."
			eerror
			eerror "You must either disable this use flag, or recompile"
			eerror "$(best_version kde-base/kdelibs) with this use flag enabled."
			die "Impossible to build kde package with different from kdelibs arts setting"
		elif ! use arts && built_with_use =kde-base/kdelibs-3.5* arts ; then
			eerror "You are trying to compile ${CATEGORY}/${PF} with the \"arts\" USE flag disabled."
			eerror "However, $(best_version =kde-base/kdelibs-3.5*) was compiled with this flag enabled."
			eerror
			eerror "You must either enable this use flag, or recompile"
			eerror "$(best_version =kde-base/kdelibs-3.5*) with this use flag disabled."
			die "Impossible to build kde package with different from kdelibs arts setting"
		fi
	fi
}

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}/${P}-gcc43.patch" #218812

	# broken configure script, assure it doesn't fall back to internal libs
	echo "# We use the external chmlib!" > lib/chmlib/chm_lib.h
}

src_compile() {
	set-kdedir 3

	econf \
		--includedir=${KDEDIR}/include \
		$(use_with kde) \
		$(use_with arts)
	emake || die
}

src_install() {
	emake DESTDIR="${D}" install || die "installation failed"
	dodoc ChangeLog FAQ DCOP-bingings README || die "installing docs failed"
}