1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
7 inherit lua-single eutils toolchain-funcs
9 DESCRIPTION="Drawing editor for creating figures in PDF or PS formats"
10 HOMEPAGE="http://ipe.otfried.org"
11 SRC_URI="https://dl.bintray.com/otfried/generic/ipe/${PV%.*}/${P}-src.tar.gz"
17 KEYWORDS="~amd64 ~x86"
20 REQUIRED_USE="${LUA_REQUIRED_USE}"
29 media-libs/libjpeg-turbo
36 BDEPEND="virtual/pkgconfig"
38 S="${WORKDIR}/${P}/src"
39 COMMONDIR=/usr/share/ipe/common
42 # colon-separated list of paths
43 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"
44 # according to TeX directory structure
45 local urwdir=fonts/type1/urw
46 # add colon as field separator
47 local IFS="${IFS}:" dir
48 for dir in ${texmfdist}; do
49 if [[ -d ${dir}/${urwdir} ]]; then
50 URWFONTDIR="${dir}/${urwdir}"
60 -e 's_moc_/usr/lib64/qt5/bin/moc_' \
61 -e "s:\$(IPEPREFIX)/lib:\$(IPEPREFIX)/$(get_libdir):g" \
63 sed -i -e 's/install -s/install/' common.mak || die
66 eapply "${FILESDIR}"/${PN}-outputprecision.patch
74 if search_urw_fonts; then
75 einfo "URW fonts found in ${URWFONTDIR}"
77 ewarn "Could not find directory containing URW fonts"
78 ewarn "Ipe will not function properly without them."
85 IPEPREFIX="${EPREFIX}/usr" \
86 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html"
91 IPEPREFIX="${EPREFIX}/usr" \
92 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html" \
93 INSTALL_ROOT="${ED}" \
94 LUA_VERSION="$(lua_get_version)"
95 dodoc ../{news,readme}.txt
96 doicon ipe/icons/ipe.png
97 make_desktop_entry ipe Ipe ipe
99 if [ -d $COMMONDIR/styles ]; then
100 einfo "Linking common style sheets from $COMMONDIR"
101 for f in $COMMONDIR/styles/*; do
102 einfo " Linking ${f##*/}"
103 dosym $f usr/share/ipe/${PV}/styles/${f##*/}
106 elog "Style sheets from $COMMONDIR/styles have been symlinked to"
107 elog "the style sheet directory of ${P}. If you add additional"
108 elog "style sheets later to $COMMONDIR/styles you may symlink"
109 elog "them by hand to '/usr/share/ipe/${PV}/styles/'."