]> Pileus Git - ~andy/sunrise/blob - media-gfx/ipe/ipe-6.0_pre28.ebuild
media-gfx/ipe: Use full path to qmake
[~andy/sunrise] / media-gfx / ipe / ipe-6.0_pre28.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit qt4 eutils
6
7 MY_P="${P/_/}"
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"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="firefox"
16
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.
20 RDEPEND="${DEPEND}
21         virtual/tetex
22         firefox? ( || ( www-client/mozilla-firefox
23                 www-client/mozilla-firefox-bin ) )"
24
25 S="${WORKDIR}/${MY_P}/src"
26
27 search_urw_fonts() {
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}"
34                         return 0
35                 fi
36         done
37
38         return 1
39 }
40
41 pkg_setup() {
42         if has_version ">=x11-libs/qt-4.2.2" && ! built_with_use x11-libs/qt qt3support; then
43                 eerror
44                 eerror "You need to rebuild x11-libs/qt with USE=qt3support enabled"
45                 eerror
46                 die "please rebuild x11-libs/qt with USE=qt3support"
47         fi
48
49         search_urw_fonts
50         if [ $? -eq 0 ]; then
51                 einfo "URW fonts found in ${URWFONTDIR}."
52         else
53                 ewarn "Could not find directory containing URW fonts.  Ipe will not"
54                 ewarn "function properly without them."
55         fi
56 }
57
58 src_compile() {
59         # until Ipe bug #206 is resolved...
60         # local myconf
61         # use firefox && myconf="IPEBROWSER=firefox"
62         use firefox && \
63                 sed -i -e "s/IPEBROWSER = mozilla/IPEBROWSER = firefox/" config.pri
64
65         /usr/bin/qmake \
66                 "IPEPREFIX=/usr" \
67                 "IPEDOCDIR=/usr/share/doc/${PF}" \
68                 ${myconf} \
69                 main.pro || die "qmake failed"
70
71         emake || die "emake failed"
72 }
73
74 src_install() {
75         emake install INSTALL_ROOT="${D}" || die "emake install failed"
76
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
83                 eend $?
84         fi
85
86         dodoc install.txt news.txt readme.txt
87 }