dev-qt/qtgui: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / app-office / lyx / lyx-2.3.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 )
7
8 MY_P="${P/_}"
9 inherit desktop flag-o-matic font python-single-r1 qmake-utils toolchain-funcs xdg-utils
10
11 DESCRIPTION="WYSIWYM frontend for LaTeX, DocBook, etc."
12 HOMEPAGE="https://www.lyx.org/"
13 SRC_URI="ftp://ftp.lyx.org/pub/lyx/stable/2.3.x/${MY_P}.tar.xz
14         ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.3/${MY_P}/${MY_P}.tar.xz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="amd64 ~ppc ~ppc64 ~sparc x86 ~x64-macos ~x86-macos"
19 IUSE="aspell cups debug docbook dia dot enchant gnumeric html +hunspell +latex monolithic-build nls rcs rtf subversion svg l10n_he"
20 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
21
22 RDEPEND="${PYTHON_DEPS}
23         app-text/mythes
24         dev-libs/boost:=
25         dev-qt/qtcore:5
26         dev-qt/qtgui:5
27         dev-qt/qtsvg:5
28         dev-qt/qtwidgets:5
29         dev-qt/qtx11extras:5
30         dev-texlive/texlive-fontsextra
31         sys-apps/file
32         sys-libs/zlib
33         virtual/imagemagick-tools[png,svg?]
34         aspell? ( app-text/aspell )
35         cups? ( net-print/cups )
36         dia? ( app-office/dia )
37         docbook? ( app-text/sgmltools-lite )
38         dot? ( media-gfx/graphviz )
39         enchant? ( app-text/enchant:0 )
40         gnumeric? ( app-office/gnumeric )
41         html? ( dev-tex/html2latex )
42         hunspell? ( app-text/hunspell )
43         l10n_he? ( dev-tex/culmus-latex )
44         latex? (
45                 app-text/dvipng
46                 app-text/ghostscript-gpl
47                 app-text/ps2eps
48                 app-text/texlive
49                 dev-tex/chktex
50                 dev-tex/dvipost
51                 dev-texlive/texlive-fontsrecommended
52                 dev-texlive/texlive-latexextra
53                 dev-texlive/texlive-mathscience
54                 dev-texlive/texlive-pictures
55                 dev-texlive/texlive-plaingeneric
56                 || (
57                         dev-tex/hevea
58                         dev-tex/latex2html
59                         dev-tex/tex4ht[java]
60                         dev-tex/tth
61                 )
62         )
63         rcs? ( dev-vcs/rcs )
64         rtf? (
65                 app-text/unrtf
66                 dev-tex/html2latex
67                 dev-tex/latex2rtf
68         )
69         subversion? ( dev-vcs/subversion )
70         svg? ( || ( gnome-base/librsvg media-gfx/inkscape ) )
71 "
72 DEPEND="${RDEPEND}
73         virtual/pkgconfig
74         dev-qt/qtconcurrent:5
75         nls? ( sys-devel/gettext )
76 "
77
78 DOCS=( ANNOUNCE NEWS README RELEASE-NOTES UPGRADING )
79
80 PATCHES=( "${FILESDIR}"/${PN}-2.3.0-python.patch )
81
82 S="${WORKDIR}/${MY_P}"
83
84 FONT_S="${S}/lib/fonts"
85 FONT_SUFFIX="ttf"
86
87 pkg_setup() {
88         python-single-r1_pkg_setup
89         font_pkg_setup
90 }
91
92 src_prepare() {
93         default
94         sed "s:python -tt:${EPYTHON} -tt:g" -i lib/configure.py || die
95 }
96
97 src_configure() {
98         tc-export CXX
99         #bug 221921
100         export VARTEXFONTS="${T}"/fonts
101
102         econf \
103                 $(use_with aspell) \
104                 $(use_enable debug) \
105                 $(use_with enchant) \
106                 $(use_with hunspell) \
107                 $(use_enable monolithic-build) \
108                 $(use_enable nls) \
109                 --enable-qt5 \
110                 --with-qt-dir=$(qt5_get_libdir)/qt5 \
111                 --disable-stdlib-debug \
112                 --without-included-boost \
113                 --with-packaging=posix
114 }
115
116 src_install() {
117         default
118
119         if use l10n_he ; then
120                 echo "\bind_file cua" > "${T}"/hebrew.bind || die
121                 echo "\bind \"F12\" \"language hebrew\"" >> "${T}"/hebrew.bind || die
122
123                 insinto /usr/share/lyx/bind
124                 doins "${T}"/hebrew.bind
125         fi
126
127         newicon -s 32 "development/Win32/packaging/icons/lyx_32x32.png" ${PN}.png
128         doicon -s 48 "lib/images/lyx.png"
129         doicon -s scalable "lib/images/lyx.svg"
130
131         # fix for bug 91108
132         if use latex ; then
133                 dosym ../../../lyx/tex /usr/share/texmf-site/tex/latex/lyx
134         fi
135
136         # fonts needed for proper math display, see also bug #15629
137         font_src_install
138
139         python_fix_shebang "${ED}"/usr/share/${PN}
140
141         if use hunspell ; then
142                 dosym ../myspell /usr/share/lyx/dicts
143                 dosym ../myspell /usr/share/lyx/thes
144         fi
145 }
146
147 pkg_postinst() {
148         font_pkg_postinst
149         xdg_icon_cache_update
150         xdg_desktop_database_update
151
152         # fix for bug 91108
153         if use latex ; then
154                 texhash
155         fi
156
157         # instructions for RTL support. See also bug 168331.
158         if use l10n_he || has he ${LINGUAS} || has ar ${LINGUAS} ; then
159                 elog
160                 elog "Enabling RTL support in LyX:"
161                 elog "If you intend to use a RTL language (such as Hebrew or Arabic)"
162                 elog "You must enable RTL support in LyX. To do so start LyX and go to"
163                 elog "Tools->Preferences->Language settings->Language"
164                 elog "and make sure the \"Right-to-left language support\" is checked"
165                 elog
166         fi
167 }
168
169 pkg_postrm() {
170         xdg_icon_cache_update
171         xdg_desktop_database_update
172
173         if use latex ; then
174                 texhash
175         fi
176 }