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://github.com/otfried/ipe/releases/download/v${PV}/${PN}-${PV}-src.tar.gz"
17 KEYWORDS="~amd64 ~x86"
20 REQUIRED_USE="${LUA_REQUIRED_USE}"
28 media-libs/libjpeg-turbo
38 BDEPEND="virtual/pkgconfig"
40 S="${WORKDIR}/${P}/src"
41 COMMONDIR=/usr/share/ipe/common
44 # colon-separated list of paths
45 local texmfdist="$(kpsewhich -var-value=TEXMFDIST)"
46 # according to TeX directory structure
47 local urwdir=fonts/type1/urw
48 # add colon as field separator
49 local IFS="${IFS}:" dir
50 for dir in ${texmfdist}; do
51 if [[ -d ${dir}/${urwdir} ]]; then
52 URWFONTDIR="${dir}/${urwdir}"
62 -e 's_moc_/usr/lib64/qt5/bin/moc_' \
63 -e "s:\$(IPEPREFIX)/lib:\$(IPEPREFIX)/$(get_libdir):g" \
65 sed -i -e 's/install -s/install/' common.mak || die
68 eapply "${FILESDIR}"/${PN}-outputprecision.patch
76 if search_urw_fonts; then
77 einfo "URW fonts found in ${URWFONTDIR}"
79 ewarn "Could not find directory containing URW fonts"
80 ewarn "Ipe will not function properly without them."
87 IPEPREFIX="${EPREFIX}/usr" \
88 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html"
93 IPEPREFIX="${EPREFIX}/usr" \
94 IPEDOCDIR="${EPREFIX}/usr/share/doc/${PF}/html" \
95 INSTALL_ROOT="${ED}" \
96 LUA_VERSION="$(lua_get_version)"
97 dodoc ../{news,readme}.txt
98 doicon ipe/icons/ipe.png
99 make_desktop_entry ipe Ipe ipe
101 if [ -d $COMMONDIR/styles ]; then
102 einfo "Linking common style sheets from $COMMONDIR"
103 for f in $COMMONDIR/styles/*; do
104 einfo " Linking ${f##*/}"
105 dosym $f usr/share/ipe/${PV}/styles/${f##*/}
108 elog "Style sheets from $COMMONDIR/styles have been symlinked to"
109 elog "the style sheet directory of ${P}. If you add additional"
110 elog "style sheets later to $COMMONDIR/styles you may symlink"
111 elog "them by hand to '/usr/share/ipe/${PV}/styles/'."