Add Ipe tools and change Ipe homepage
[shuber-gentoo-overlay.git] / media-gfx / ipe / ipe-7.0.10.ebuild
1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6 inherit eutils toolchain-funcs qt4-r2
7
8 DESCRIPTION="A drawing editor which creates figures for inclusion in LaTeX documents and makes PDF presentations."
9 HOMEPAGE="http://ipe7.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/ipe7/ipe/${P}-src.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="seamonkey"
16
17 DEPEND=">=x11-libs/qt-core-4.5:4
18 >=x11-libs/qt-gui-4.5:4
19 >=media-libs/freetype-2.1.8
20 >=x11-libs/cairo-1.8.0
21 >=dev-lang/lua-5.1
22 app-text/texlive-core"
23
24 RDEPEND="${DEPEND}
25 !seamonkey? ( || ( www-client/mozilla-firefox
26 www-client/firefox-bin ) )
27 seamonkey? ( || ( www-client/seamonkey
28 www-client/seamonkey-bin ) )"
29
30 S=${S}/src
31
32 search_urw_fonts() {
33 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)" # colon-separated list of paths
34 local urwdir=fonts/type1/urw # according to TeX directory structure
35 local IFS="${IFS}:" # add colon as field separator
36 for dir in ${texmfdist}; do
37 if [[ -d "${dir}/${urwdir}" ]]; then
38 URWFONTDIR="${dir}/${urwdir}"
39 return 0
40 fi
41 done
42
43 return 1
44 }
45
46 pkg_setup() {
47 if search_urw_fonts; then
48 einfo "URW fonts found in ${URWFONTDIR}."
49 else
50 ewarn "Could not find directory containing URW fonts. Ipe will not"
51 ewarn "function properly without them."
52 fi
53 }
54
55 src_compile() {
56 # Ipe's default browser is Firefox
57 local myconf
58 use seamonkey && myconf="IPEBROWSER=seamonkey"
59 # fix detection of lua
60 sed -i -e 's/lua5.1/lua/g' config.mak || die
61 # don't strip installed binaries
62 sed -i -e 's/install -s/install/' common.mak || die
63 # use moc instead of moc-qt4
64 sed -i -e 's/moc-qt4/moc/' config.mak || die
65
66 # -j1, since there are no deps in the Makefiles on libipe
67 emake -j1 CXX=$(tc-getCXX) $myconf IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" || die "emake failed"
68 }
69
70 src_install() {
71 emake install IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" INSTALL_ROOT="${D}" || die "emake install failed"
72 dodoc ../{news,readme}.txt || die
73 }