]> Pileus Git - ~andy/sunrise/blob - media-gfx/ipe/ipe-6.0_pre30.ebuild
c658ec93760ba28955f7c90806f49f990cbf50de
[~andy/sunrise] / media-gfx / ipe / ipe-6.0_pre30.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="1"
6 inherit qt4 eutils
7
8 MY_P="${P/_/}"
9 DESCRIPTION="A drawing editor which creates figures for inclusion in LaTeX documents and makes PDF presentations."
10 HOMEPAGE="http://tclab.kaist.ac.kr/ipe/"
11 SRC_URI="http://luaforge.net/frs/download.php/2727/${MY_P}-src.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="seamonkey"
17
18 DEPEND=">=x11-libs/qt-4.2:4
19         >=media-libs/freetype-2.1.8"
20 # The virtual/tetex dep is for pdfLaTeX and URW fonts.
21 RDEPEND="${DEPEND}
22         virtual/tetex
23         !seamonkey? ( || ( www-client/mozilla-firefox
24                 www-client/mozilla-firefox-bin ) )
25         seamonkey? ( || ( www-client/seamonkey
26                 www-client/seamonkey-bin ) )"
27
28 S="${WORKDIR}/${MY_P}/src"
29
30 search_urw_fonts() {
31         local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"     # colon-separated list of paths
32         local urwdir=fonts/type1/urw    # according to TeX directory structure
33         local IFS="${IFS}:"             # add colon as field separator
34         for dir in ${texmfdist}; do
35                 if [[ -d "${dir}/${urwdir}" ]]; then
36                         URWFONTDIR="${dir}/${urwdir}"
37                         return 0
38                 fi
39         done
40
41         return 1
42 }
43
44 pkg_setup() {
45         if has_version ">=x11-libs/qt-4.2.2" ; then
46                 QT4_BUILT_WITH_USE_CHECK="qt3support"
47                 qt4_pkg_setup
48         fi
49
50         if search_urw_fonts; 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_unpack() {
59         unpack ${A}
60         cd "${S}"
61         epatch "${FILESDIR}"/${P}-include-string.patch
62 }
63
64 src_compile() {
65         # Ipe bug #240, Gentoo bug #80448#c8: allow Ipe to be built with GCC 4.2
66         sed -i -e "s/-Werror/-Wno-error/" \
67                 config.pri figtoipe/figtoipe.pro ipe5toxml/ipe5toxml.pro
68
69         # Ipe's default browser is Firefox
70         local myconf
71         use seamonkey && myconf="IPEBROWSER=seamonkey"
72
73         eqmake4 main.pro \
74                 ${myconf} \
75                 "IPEPREFIX=/usr" \
76                 "IPEDOCDIR=/usr/share/doc/${PF}"
77         emake || die "emake failed"
78 }
79
80 src_install() {
81         emake install INSTALL_ROOT="${D}" || die "emake install failed"
82
83         cd "${WORKDIR}"/${MY_P}
84         local fontmapdir=/usr/share/${PN}/${MY_P/${PN}-/}
85         if [ -n ${URWFONTDIR} ]; then
86                 einfo "Creating fontmap ..."
87                 sed -e "s:/usr/share/texmf/fonts/type1/urw:${URWFONTDIR}:" \
88                         tetex-fontmap.xml > "${D}/${fontmapdir}/fontmap.xml"
89                 eend $?
90         fi
91
92         dodoc install.txt news.txt readme.txt
93 }