summaryrefslogtreecommitdiff
blob: d11805cba94df8bb8663ec07a59a918a2ea9dcc5 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="1"
inherit qt4 eutils

DESCRIPTION="A drawing editor which creates figures for inclusion in LaTeX documents and makes PDF presentations."
HOMEPAGE="http://tclab.kaist.ac.kr/ipe/"
SRC_URI="mirror://sourceforge/ipe7/ipe/${P}-src.tar.gz"

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

DEPEND=">=x11-libs/qt-core-4.2:4
	>=x11-libs/qt-gui-4.2:4
	>=media-libs/freetype-2.1.8
	>=x11-libs/cairo-1.8.0
	>=dev-lang/lua-5.1
	>=x11-libs/qt-core-4.5
	>=x11-libs/qt-gui-4.5"

RDEPEND="${DEPEND}
	virtual/latex-base
	!seamonkey? ( || ( www-client/mozilla-firefox
		www-client/mozilla-firefox-bin ) )
	seamonkey? ( || ( www-client/seamonkey
		www-client/seamonkey-bin ) )"

S="${WORKDIR}/${P}/src"

search_urw_fonts() {
	local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"	# colon-separated list of paths
	local urwdir=fonts/type1/urw	# according to TeX directory structure
	local IFS="${IFS}:"		# add colon as field separator
	for dir in ${texmfdist}; do
		if [[ -d "${dir}/${urwdir}" ]]; then
			URWFONTDIR="${dir}/${urwdir}"
			return 0
		fi
	done

	return 1
}

pkg_setup() {
	if search_urw_fonts; then
		einfo "URW fonts found in ${URWFONTDIR}."
	else
		ewarn "Could not find directory containing URW fonts.  Ipe will not"
		ewarn "function properly without them."
	fi
}

src_compile() {
	# Ipe's default browser is Firefox
	local myconf
	use seamonkey && myconf="IPEBROWSER=seamonkey"
	# fix detection of lua
	sed -i -e 's/lua5.1/lua/g' config.mak
	# don't strip installed binaries
	sed -i -e 's/install -s/install/' common.mak

	# -j1, since there are no deps in the Makefiles on libipe
	emake -j1 $myconf IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" || die "emake failed"
}

src_install() {
	emake install IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" INSTALL_ROOT="${D}" || die "emake install failed"
	cd "${WORKDIR}/${P}"
	dodoc install.txt news.txt readme.txt
}