ipe: Add ipe-7.2.2. and update SRC_URIs
[shuber-gentoo-overlay.git] / media-gfx / ipe / ipe-7.1.9.ebuild
1 # Distributed under the terms of the GNU General Public License v2
2 # $Header: $
3
4 EAPI=4
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="Drawing editor for creating figures in PDF or PS formats"
8 HOMEPAGE="http://ipe.otfried.org"
9 SRC_URI="https://dl.bintray.com/otfried/generic/ipe/${PV%.*}/${P}-src.tar.gz"
10
11 RESTRICT="mirror"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="highprec"
17
18 RDEPEND="app-text/texlive-core
19 >=dev-lang/lua-5.2
20 media-libs/freetype:2
21 x11-libs/cairo
22 dev-qt/qtcore:5
23 dev-qt/qtwidgets:5"
24 DEPEND="${RDEPEND}
25 virtual/pkgconfig"
26
27 S="${WORKDIR}/${P}/src"
28 COMMONDIR=/usr/share/ipe/common
29
30 search_urw_fonts() {
31 # colon-separated list of paths
32 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"
33 # according to TeX directory structure
34 local urwdir=fonts/type1/urw
35 # add colon as field separator
36 local IFS="${IFS}:" dir
37 for dir in ${texmfdist}; do
38 if [[ -d ${dir}/${urwdir} ]]; then
39 URWFONTDIR="${dir}/${urwdir}"
40 return 0
41 fi
42 done
43 return 1
44 }
45
46 src_prepare() {
47 sed -i \
48 -e 's/fpic/fPIC/' \
49 -e 's_moc_/usr/lib64/qt5/bin/moc_' \
50 -e "s:\$(IPEPREFIX)/lib:\$(IPEPREFIX)/$(get_libdir):g" \
51 config.mak || die
52 sed -i -e 's/install -s/install/' common.mak || die
53
54 if use highprec; then
55 einfo "Adding patch for higher output precision"
56 epatch "${FILESDIR}"/${PN}-outputprecision.patch
57 fi
58 }
59
60 pkg_setup() {
61 if search_urw_fonts; then
62 einfo "URW fonts found in ${URWFONTDIR}"
63 else
64 ewarn "Could not find directory containing URW fonts"
65 ewarn "Ipe will not function properly without them."
66 fi
67 }
68
69 src_compile() {
70 emake \
71 CXX=$(tc-getCXX) \
72 IPEPREFIX="${EPREFIX}/usr" \
73 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html" \
74 LUA_PACKAGE=lua
75 }
76
77 src_install() {
78 emake install \
79 IPEPREFIX="${EPREFIX}/usr" \
80 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html" \
81 INSTALL_ROOT="${ED}"
82 dodoc ../{news,readme}.txt
83 doicon ipe/icons/ipe.png
84 make_desktop_entry ipe Ipe ipe
85 # Link style sheets
86 if [ -d $COMMONDIR/styles ]; then
87 einfo "Linking common style sheets from $COMMONDIR"
88 for f in $COMMONDIR/styles/*; do
89 einfo " Linking ${f##*/}"
90 dosym $f usr/share/ipe/${PV}/styles/${f##*/}
91 done
92
93 elog "Style sheets from $COMMONDIR/styles have been symlinked to"
94 elog "the style sheet directory of ${P}. If you add additional"
95 elog "style sheets later to $COMMONDIR/styles you may symlink"
96 elog "them by hand to '/usr/share/ipe/${PV}/styles/'."
97 fi
98 }