ipe: add ipe-7.1.3
[shuber-gentoo-overlay.git] / media-gfx / ipe / ipe-7.1.2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=4
6 inherit eutils toolchain-funcs qt4-r2
7
8 DESCRIPTION="Drawing editor for creating figures in PDF or PS formats"
9 HOMEPAGE="http://ipe7.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/ipe7/${PN}/7.1.0/${P}-src.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE=""
16
17 RDEPEND="app-text/texlive-core
18 dev-lang/lua
19 media-libs/freetype:2
20 x11-libs/cairo
21 x11-libs/qt-core:4
22 x11-libs/qt-gui:4"
23 DEPEND="${RDEPEND}
24 virtual/pkgconfig"
25
26 S="${WORKDIR}/${P}/src"
27
28 search_urw_fonts() {
29 # colon-separated list of paths
30 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"
31 # according to TeX directory structure
32 local urwdir=fonts/type1/urw
33 # add colon as field separator
34 local IFS="${IFS}:" dir
35 for dir in ${texmfdist}; do
36 if [[ -d ${dir}/${urwdir} ]]; then
37 URWFONTDIR="${dir}/${urwdir}"
38 return 0
39 fi
40 done
41 return 1
42 }
43
44 pkg_setup() {
45 if search_urw_fonts; then
46 einfo "URW fonts found in ${URWFONTDIR}"
47 else
48 ewarn "Could not find directory containing URW fonts"
49 ewarn "Ipe will not function properly without them."
50 fi
51 }
52
53 src_prepare() {
54 sed -i \
55 -e 's/fpic/fPIC/' \
56 -e 's/moc-qt4/moc/' \
57 -e "s:\$(IPEPREFIX)/lib:\$(IPEPREFIX)/$(get_libdir):g" \
58 config.mak || die
59 sed -i -e 's/install -s/install/' common.mak || die
60
61 }
62
63 src_compile() {
64 emake \
65 CXX=$(tc-getCXX) \
66 IPEPREFIX="${EPREFIX}/usr" \
67 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html"
68 }
69
70 src_install() {
71 emake install \
72 IPEPREFIX="${EPREFIX}/usr" \
73 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html" \
74 INSTALL_ROOT="${ED}"
75 dodoc ../{news,readme}.txt
76 doicon ipe/icons/ipe.png
77 make_desktop_entry ipe Ipe ipe
78 }