1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="An extensible drawing editor which creates figures for inclusion in LaTeX documents and makes PDF presentations."
9 HOMEPAGE="http://tclab.kaist.ac.kr/ipe/"
10 SRC_URI="http://tclab.kaist.ac.kr/ipe/${MY_P}-src.tar.gz"
14 KEYWORDS="~amd64 ~x86"
17 DEPEND="$(qt4_min_version 4.2)
18 >=media-libs/freetype-2.1.8"
19 # The virtual/tetex dep is for pdfLaTeX and URW fonts.
22 firefox? ( || ( www-client/mozilla-firefox
23 www-client/mozilla-firefox-bin ) )"
25 S="${WORKDIR}/${MY_P}/src"
28 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)" # colon-separated list of paths
29 local urwdir=fonts/type1/urw # according to TeX directory structure
30 local IFS="${IFS}:" # add colon as field separator
31 for dir in ${texmfdist}; do
32 if [[ -d "${dir}/${urwdir}" ]]; then
33 URWFONTDIR="${dir}/${urwdir}"
42 if has_version ">=x11-libs/qt-4.2.2" && ! built_with_use x11-libs/qt qt3support; then
44 eerror "You need to rebuild x11-libs/qt with USE=qt3support enabled"
46 die "please rebuild x11-libs/qt with USE=qt3support"
51 einfo "URW fonts found in ${URWFONTDIR}."
53 ewarn "Could not find directory containing URW fonts. Ipe will not"
54 ewarn "function properly without them."
59 # until Ipe bug #206 is resolved...
61 # use firefox && myconf="IPEBROWSER=firefox"
63 sed -i -e "s/IPEBROWSER = mozilla/IPEBROWSER = firefox/" config.pri
67 "IPEDOCDIR=/usr/share/doc/${PF}" \
69 main.pro || die "qmake failed"
71 emake || die "emake failed"
75 emake install INSTALL_ROOT="${D}" || die "emake install failed"
77 cd "${WORKDIR}"/${MY_P}
78 local fontmapdir=/usr/share/${PN}/${MY_P/${PN}-/}
79 if [ -n ${URWFONTDIR} ]; then
80 einfo "Creating fontmap ..."
81 sed -e "s:/usr/share/texmf/type1/urw:${URWFONTDIR}:" \
82 tetex-fontmap.xml > ${D}/${fontmapdir}/fontmap.xml
86 dodoc install.txt news.txt readme.txt