summaryrefslogtreecommitdiff
blob: bd0fc2b72b14cb60a9588a7c8aec3ffa6b038105 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/cppcheck/cppcheck-1.43.ebuild,v 1.1 2010/05/18 10:13:31 patrick Exp $

EAPI=2
inherit eutils toolchain-funcs qt4-r2

DESCRIPTION="static analyzer of C/C++ code"
HOMEPAGE="http://apps.sourceforge.net/trac/cppcheck/"
SRC_URI="mirror://sourceforge/cppcheck/${P}.tar.bz2"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="qt4"

DEPEND="qt4? ( x11-libs/qt-gui:4 )"

src_prepare() {
	sed -i \
		-e '/^CXXFLAGS/d' \
		-e '/^CXX=/d' \
		Makefile \
		|| die
	tc-export CXX
}

src_configure() {
	if use qt4; then
		pushd gui
		eqmake4 gui.pro
		popd
	fi
}

src_compile() {
	emake || die "make failed"
	if use qt4; then
		pushd gui
		emake || die "make gui failed"
		popd
	fi
}

src_install() {
	emake install DESTDIR="${D}" || die
	dodoc readme.txt
	if use qt4; then
		newbin gui/gui cppcheck-gui
		dodoc readme_gui.txt gui/projectfile.txt gui/gui.cppcheck
	fi
}