app-office/lyx: Update HOMEPAGE
[gentoo.git] / app-office / lyx / lyx-2.2.3.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 )
7 inherit gnome2-utils eutils fdo-mime flag-o-matic font python-single-r1 toolchain-funcs
8
9 MY_P="${P/_}"
10
11 S="${WORKDIR}/${MY_P}"
12 FONT_S="${S}/lib/fonts"
13 FONT_SUFFIX="ttf"
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"
18
19 LICENSE="GPL-2"
20 SLOT="0"
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"
23
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"
25
26 for X in ${LANGS}; do
27         IUSE="${IUSE} linguas_${X}"
28 done
29
30 REQUIRED_USE="${PYTHON_REQUIRED_USE}
31         qt4? ( !qt5 )
32         qt5? ( !qt4 )"
33
34 DOCS=( ANNOUNCE NEWS README RELEASE-NOTES UPGRADING )
35
36 COMMONDEPEND=">=dev-libs/boost-1.34:=
37         ${PYTHON_DEPS}
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 )"
40
41 RDEPEND="${COMMONDEPEND}
42         dev-texlive/texlive-fontsextra
43         virtual/imagemagick-tools[png,svg?]
44         cups? ( net-print/cups )
45         latex? (
46                 app-text/texlive
47                 app-text/ghostscript-gpl
48                 app-text/noweb
49                 app-text/dvipng
50                 dev-tex/dvipost
51                 dev-tex/chktex
52                 app-text/ps2eps
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
58                 || (
59                         dev-tex/latex2html
60                         dev-tex/tth
61                         dev-tex/hevea
62                         dev-tex/tex4ht[java]
63                 )
64         )
65         html? ( dev-tex/html2latex )
66         rtf? (
67                         dev-tex/latex2rtf
68                         app-text/unrtf
69                         dev-tex/html2latex
70                 )
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 )
76         rcs? ( dev-vcs/rcs )
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 )"
82
83 DEPEND="${COMMONDEPEND}
84         virtual/pkgconfig
85         nls? ( sys-devel/gettext )"
86
87 pkg_setup() {
88         python-single-r1_pkg_setup
89         font_pkg_setup
90 }
91
92 src_prepare() {
93         epatch "${FILESDIR}"/2.1-python.patch
94         sed "s:python -tt:${EPYTHON} -tt:g" -i lib/configure.py || die
95         if use qt4; then
96                 export QT_SELECT=qt4
97         elif use qt5; then
98                 export QT_SELECT=qt5
99         fi
100 }
101
102 src_configure() {
103         tc-export CXX
104         #bug 221921
105         export VARTEXFONTS=${T}/fonts
106         local qt_flag=""
107         if use qt4; then
108                 qt_flag=""
109         elif use qt5; then
110                 qt_flag="--enable-qt5"
111         fi
112
113         econf \
114                 $(use_enable nls) \
115                 $(use_enable debug) \
116                 $(use_enable monolithic-build) \
117                 $(use_with hunspell) \
118                 $(use_with aspell) \
119                 $(use_with enchant) \
120                 ${qt_flag} \
121                 --without-included-boost \
122                 --disable-stdlib-debug \
123                 --with-packaging=posix
124 }
125
126 src_install() {
127         default
128
129         if use linguas_he ; then
130                 echo "\bind_file cua" > "${T}"/hebrew.bind
131                 echo "\bind \"F12\" \"language hebrew\"" >> "${T}"/hebrew.bind
132
133                 insinto /usr/share/lyx/bind
134                 doins "${T}"/hebrew.bind || die
135         fi
136
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"
140
141         # fix for bug 91108
142         if use latex ; then
143                 dosym ../../../lyx/tex /usr/share/texmf-site/tex/latex/lyx || die
144         fi
145
146         # fonts needed for proper math display, see also bug #15629
147         font_src_install
148
149         python_fix_shebang "${ED}"/usr/share/${PN}
150
151         if use hunspell ; then
152                 dosym ../myspell /usr/share/lyx/dicts
153                 dosym ../myspell /usr/share/lyx/thes
154         fi
155 }
156
157 pkg_preinst() {
158         gnome2_icon_savelist
159 }
160
161 pkg_postinst() {
162         font_pkg_postinst
163         gnome2_icon_cache_update
164         fdo-mime_desktop_database_update
165
166         # fix for bug 91108
167         if use latex ; then
168                 texhash
169         fi
170
171         # instructions for RTL support. See also bug 168331.
172         if use linguas_he || use linguas_ar; then
173                 elog
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"
179                 elog
180         fi
181 }
182
183 pkg_postrm() {
184         gnome2_icon_cache_update
185         fdo-mime_desktop_database_update
186
187         if use latex ; then
188                 texhash
189         fi
190 }