ipe-7.0.11: new version of prec patch
[shuber-gentoo-overlay.git] / media-gfx / ipe / ipe-7.0.11.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 RESTRICT="mirror"
16 IUSE="seamonkey"
17
18 DEPEND="
19 app-text/texlive-core
20 >=dev-lang/lua-5.1
21 >=media-libs/freetype-2.1.8
22 sys-libs/zlib
23 >=x11-libs/cairo-1.8.0
24 >=x11-libs/qt-core-4.5:4
25 >=x11-libs/qt-gui-4.5:4
26 "
27
28 RDEPEND="${DEPEND}
29 !seamonkey? ( || ( www-client/firefox
30 www-client/firefox-bin ) )
31 seamonkey? ( || ( www-client/seamonkey
32 www-client/seamonkey-bin ) )"
33
34 S=${S}/src
35
36 search_urw_fonts() {
37 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)" # colon-separated list of paths
38 local urwdir=fonts/type1/urw # according to TeX directory structure
39 local IFS="${IFS}:" # add colon as field separator
40 for dir in ${texmfdist}; do
41 if [[ -d "${dir}/${urwdir}" ]]; then
42 URWFONTDIR="${dir}/${urwdir}"
43 return 0
44 fi
45 done
46
47 return 1
48 }
49
50 src_prepare() {
51 epatch "${FILESDIR}"/${PN}-beamer-install.patch
52 epatch "${FILESDIR}"/${PN}-outputprecision.patch
53 }
54
55 pkg_setup() {
56 if search_urw_fonts; then
57 einfo "URW fonts found in ${URWFONTDIR}."
58 else
59 ewarn "Could not find directory containing URW fonts. Ipe will not"
60 ewarn "function properly without them."
61 fi
62 }
63
64 src_compile() {
65 # Ipe's default browser is Firefox
66 local myconf
67 use seamonkey && myconf="IPEBROWSER=seamonkey"
68 # fix detection of lua
69 sed -i -e 's/lua5.1/lua/g' config.mak || die
70 # don't strip installed binaries
71 sed -i -e 's/install -s/install/' common.mak || die
72 # use moc instead of moc-qt4
73 sed -i -e 's/moc-qt4/moc/' config.mak || die
74
75 # -j1, since there are no deps in the Makefiles on libipe
76 emake -j1 CXX=$(tc-getCXX) $myconf IPEPREFIX="/usr" \
77 IPEDOCDIR="/usr/share/doc/${PF}" || die "emake failed"
78 }
79
80 src_install() {
81 emake install IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" \
82 INSTALL_ROOT="${D}" || die "emake install failed"
83 dodoc ../{news,readme}.txt || die
84 }