1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils toolchain-funcs qt4-r2
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"
14 KEYWORDS="~amd64 ~x86"
16 # highprec: applies patch in order to write coordinates with higher precision
24 >=x11-libs/cairo-1.8.0
30 COMMONDIR=/usr/share/ipe/common
34 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)" # colon-separated list of paths
35 local urwdir=fonts/type1/urw # according to TeX directory structure
36 local IFS="${IFS}:" # add colon as field separator
37 for dir in ${texmfdist}; do
38 if [[ -d "${dir}/${urwdir}" ]]; then
39 URWFONTDIR="${dir}/${urwdir}"
49 einfo "Adding patch for higher output precision"
50 epatch "${FILESDIR}"/${PN}-outputprecision.patch
55 if search_urw_fonts; then
56 einfo "URW fonts found in ${URWFONTDIR}."
58 ewarn "Could not find directory containing URW fonts. Ipe will not"
59 ewarn "function properly without them."
64 # fix detection of lua
65 sed -i -e 's/lua5.1/lua/g' config.mak || die
66 # don't strip installed binaries
67 sed -i -e 's/install -s/install/' common.mak || die
68 # use moc instead of moc-qt4
69 sed -i -e 's/moc-qt4/moc/' config.mak || die
71 # -j1, since there are no deps in the Makefiles on libipe
72 emake -j1 CXX=$(tc-getCXX) IPEPREFIX="/usr" \
73 IPEDOCDIR="/usr/share/doc/${PF}" || die "emake failed"
77 emake install IPEPREFIX="/usr" IPEDOCDIR="/usr/share/doc/${PF}" \
78 INSTALL_ROOT="${D}" || die "emake install failed"
79 dodoc ../{news,readme}.txt || die
82 if [ -d $COMMONDIR/styles ]; then
83 einfo "Linking common style sheets from $COMMONDIR"
84 for f in $COMMONDIR/styles/*; do
85 einfo " Linking ${f##*/}"
86 dosym $f usr/share/ipe/${PV}/styles/${f##*/}
89 elog "Style sheets from $COMMONDIR/styles have been symlinked to"
90 elog "the style sheet directory of ${P}. If you add additional"
91 elog "style sheets later to $COMMONDIR/styles you may symlink"
92 elog "them by hand to '/usr/share/ipe/${PV}/styles/'."