eclass/qt4-qt-copy.eclass: I HATE EPATCH KTHNXBAI.
[gentoo-soor-overlay.git] / app-office / lyx / lyx-1.5.4.ebuild
blobddc4aa352fb8ef3e720e2a4fe38e1492c9706d5b
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI="1"
7 inherit eutils flag-o-matic font toolchain-funcs
9 MY_P="${P/_}"
10 S="${WORKDIR}/${MY_P}"
11 FONT_P="latex-xft-fonts-0.1"
12 FONT_S="${WORKDIR}/${FONT_P}"
13 DESCRIPTION="WYSIWYM frontend for LaTeX, DocBook, etc."
14 HOMEPAGE="http://www.lyx.org/"
15 SRC_URI="ftp://ftp.lyx.org/pub/lyx/stable/${P}.tar.bz2
16 ftp://ftp.lyx.org/pub/lyx/contrib/${FONT_P}.tar.gz
17 linguas_he? (
18 http://cs.haifa.ac.il/~dekelts/lyx/files/hebrew.bind
19 http://cs.haifa.ac.il/~dekelts/lyx/files/preferences
22 LICENSE="GPL-2"
23 SLOT="0"
24 KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
25 IUSE="cups debug nls linguas_he latex"
26 RESTRICT="test"
28 RDEPEND="|| (
29 =x11-libs/qt-4.2*
30 =x11-libs/qt-4.3*
32 x11-libs/libXrandr
33 x11-libs/libXcursor
34 x11-libs/libXrender
35 x11-libs/libXfixes
36 x11-libs/libXext
37 x11-libs/libSM
38 x11-libs/libICE
39 x11-libs/libX11
40 x11-libs/libXau
41 x11-libs/libXdmcp
42 media-gfx/imagemagick
43 media-libs/libpng
44 media-libs/fontconfig
45 media-libs/freetype
46 dev-libs/libxml2
47 dev-libs/boost
48 app-text/aiksaurus
49 app-text/sgmltools-lite
50 virtual/aspell-dict
51 virtual/python
52 cups? ( virtual/lpr )
53 latex? (
54 virtual/latex-base
55 virtual/ghostscript
56 app-text/noweb
57 dev-tex/dvipost
58 dev-tex/chktex
59 || (
60 dev-tex/latex2html
61 dev-tex/tth
62 dev-tex/hevea
63 dev-tex/tex4ht
66 linguas_he? ( dev-tex/ivritex )"
68 DEPEND="${RDEPEND}
69 x11-proto/xproto
70 nls? ( sys-devel/gettext )"
72 src_unpack() {
73 unpack ${A}
74 cd "${S}"
75 epatch "${FILESDIR}"/${PN}-1.5.0-gentoo.patch || die
78 src_compile() {
79 append-flags "$(test-flags -fno-stack-protector -fno-stack-protector-all)"
80 replace-flags "-Os" "-O2"
81 tc-export CXX
83 unset LINGUAS
85 econf \
86 $(use_enable nls) \
87 $(use_enable debug) \
88 --disable-pch --with-aspell --without-included-boost || \
89 die "econf failed"
90 emake || die "emake failed"
93 src_install() {
94 local mylinguas="${LINGUAS}"
96 unset LINGUAS
97 emake DESTDIR="${D}" install || die "emake install failed"
99 LINGUAS="${mylinguas}"
101 dodoc ANNOUNCE ChangeLog NEWS README RELEASE-NOTES UPGRADING
103 if use linguas_he ; then
104 insinto /usr/share/lyx/bind
105 doins "${DISTDIR}"/hebrew.bind
106 dodoc "${DISTDIR}"/preferences
109 domenu "${FILESDIR}"/lyx.desktop
111 cd "${WORKDIR}"/${FONT_P}
112 emake DESTDIR="${D}" install || die "Font installation failed"
114 font_src_install
116 if use latex ; then
117 dosym ../../../lyx/tex /usr/share/texmf/tex/latex/lyx
121 pkg_postinst() {
122 font_pkg_postinst
124 if use latex ; then
125 texhash
128 if use linguas_he ; then
129 elog
130 elog "How to use Hebrew in LyX:"
131 elog "bunzip2 /usr/share/doc/${PF}/preferences.bz2 into ~/.lyx/preferences"
132 elog "or, read http://cs.haifa.ac.il/~dekelts/lyx/instructions2.html"
133 elog "for instructions on using lyx's own preferences dialog to equal effect."
134 elog
137 elog
138 elog "There are known issues in the case of 1.4->1.5 config files transition."
139 elog "In case your File->Export list is incomplete try reconfiguring or even"
140 elog "remove the old configuration files in ~/.lyx ."
141 elog
144 pkg_postrm() {
145 if use latex ; then
146 texhash