1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
7 inherit gnome2-utils eutils fdo-mime flag-o-matic font python-single-r1 toolchain-funcs
11 S="${WORKDIR}/${MY_P}"
12 FONT_S="${S}/lib/fonts"
14 DESCRIPTION="WYSIWYM frontend for LaTeX, DocBook, etc."
15 HOMEPAGE="https://www.lyx.org/"
16 SRC_URI="ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/${MY_P}.tar.xz
17 ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.2/${MY_P}/${MY_P}.tar.xz"
21 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x86-macos"
22 IUSE="cups debug nls +latex monolithic-build html rtf dot docbook dia subversion rcs svg gnumeric +hunspell aspell enchant +qt4 qt5"
24 LANGS="ar ca cs da de el en es eu fi fr gl he hu ia id it ja nb nn pl pt_BR pt_PT ro ru sk sr sv tr uk zh_CN zh_TW"
27 IUSE="${IUSE} linguas_${X}"
30 REQUIRED_USE="${PYTHON_REQUIRED_USE}
34 DOCS=( ANNOUNCE NEWS README RELEASE-NOTES UPGRADING )
36 COMMONDEPEND=">=dev-libs/boost-1.34:=
38 qt4? ( dev-qt/qtgui:4 dev-qt/qtcore:4 dev-qt/qtsvg:4 )
39 qt5? ( dev-qt/qtgui:5 dev-qt/qtcore:5 dev-qt/qtwidgets:5 dev-qt/qtx11extras:5 dev-qt/qtsvg:5 dev-qt/qtconcurrent:5 )"
41 RDEPEND="${COMMONDEPEND}
42 dev-texlive/texlive-fontsextra
43 virtual/imagemagick-tools[png,svg?]
44 cups? ( net-print/cups )
47 app-text/ghostscript-gpl
53 dev-texlive/texlive-latexextra
54 dev-texlive/texlive-pictures
55 || ( dev-texlive/texlive-mathscience dev-texlive/texlive-science )
56 || ( dev-texlive/texlive-plaingeneric dev-texlive/texlive-genericextra )
57 dev-texlive/texlive-fontsrecommended
65 html? ( dev-tex/html2latex )
71 linguas_he? ( dev-tex/culmus-latex )
72 docbook? ( app-text/sgmltools-lite )
73 dot? ( media-gfx/graphviz )
74 dia? ( app-office/dia )
75 subversion? ( dev-vcs/subversion )
77 svg? ( || ( gnome-base/librsvg media-gfx/inkscape ) )
78 gnumeric? ( app-office/gnumeric )
79 hunspell? ( app-text/hunspell )
80 aspell? ( app-text/aspell )
81 enchant? ( app-text/enchant )"
83 DEPEND="${COMMONDEPEND}
85 nls? ( sys-devel/gettext )"
88 python-single-r1_pkg_setup
93 epatch "${FILESDIR}"/2.1-python.patch
94 sed "s:python -tt:${EPYTHON} -tt:g" -i lib/configure.py || die
105 export VARTEXFONTS=${T}/fonts
110 qt_flag="--enable-qt5"
115 $(use_enable debug) \
116 $(use_enable monolithic-build) \
117 $(use_with hunspell) \
119 $(use_with enchant) \
121 --without-included-boost \
122 --disable-stdlib-debug \
123 --with-packaging=posix
129 if use linguas_he ; then
130 echo "\bind_file cua" > "${T}"/hebrew.bind
131 echo "\bind \"F12\" \"language hebrew\"" >> "${T}"/hebrew.bind
133 insinto /usr/share/lyx/bind
134 doins "${T}"/hebrew.bind || die
137 newicon -s 32 "${S}/development/Win32/packaging/icons/lyx_32x32.png" ${PN}.png
138 doicon -s 48 "${S}/lib/images/lyx.png"
139 doicon -s scalable "${S}/lib/images/lyx.svg"
143 dosym ../../../lyx/tex /usr/share/texmf-site/tex/latex/lyx || die
146 # fonts needed for proper math display, see also bug #15629
149 python_fix_shebang "${ED}"/usr/share/${PN}
151 if use hunspell ; then
152 dosym ../myspell /usr/share/lyx/dicts
153 dosym ../myspell /usr/share/lyx/thes
163 gnome2_icon_cache_update
164 fdo-mime_desktop_database_update
171 # instructions for RTL support. See also bug 168331.
172 if use linguas_he || use linguas_ar; then
174 elog "Enabling RTL support in LyX:"
175 elog "If you intend to use a RTL language (such as Hebrew or Arabic)"
176 elog "You must enable RTL support in LyX. To do so start LyX and go to"
177 elog "Tools->Preferences->Language settings->Language"
178 elog "and make sure the \"Right-to-left language support\" is checked"
184 gnome2_icon_cache_update
185 fdo-mime_desktop_database_update