summaryrefslogtreecommitdiff
blob: fd3849c8be475fa583296c2661f68b1f7d716437 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/phantomjs/phantomjs-1.3.0.ebuild,v 1.2 2011/12/01 20:51:38 vapier Exp $

EAPI="2"

PYTHON_DEPEND="python? 2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.*"

inherit distutils qt4-r2

DESCRIPTION="headless WebKit with JavaScript API"
HOMEPAGE="http://www.phantomjs.org/"
SRC_URI="http://phantomjs.googlecode.com/files/${P}-source.tar.gz"

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

RDEPEND="x11-libs/qt-webkit
	python? ( dev-python/PyQt4 )"
DEPEND="${RDEPEND}"

# Call all the parent eclasses without having to worry
# about what funcs they actually export.
maybe() { set -- $(declare -F $1); $1; }
multi_eclass() {
	maybe qt4-r2_$1
	if use python ; then
		[[ -d python ]] && cd python
		maybe distutils_$1
	fi
}
pkg_setup()     { multi_eclass ${FUNCNAME} ; }
pkg_preinst()   { multi_eclass ${FUNCNAME} ; }
pkg_postinst()  { multi_eclass ${FUNCNAME} ; }
pkg_prerm()     { multi_eclass ${FUNCNAME} ; }
pkg_postrm()    { multi_eclass ${FUNCNAME} ; }
src_prepare()   { multi_eclass ${FUNCNAME} ; }
src_configure() { multi_eclass ${FUNCNAME} ; }
src_compile()   { multi_eclass ${FUNCNAME} ; }

src_install() {
	dobin bin/phantomjs || die
	dodoc ChangeLog README.md

	if use examples ; then
		docinto examples
		dodoc examples/* || die
	fi

	multi_eclass ${FUNCNAME}
}