Add LyX.
[gentoo-soor-overlay.git] / app-office / lyx / lyx-1.5.4.ebuild
blob3b63b191164d08c0607dc9135f2c2250d59f9de7
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 qt4 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 pch linguas_he latex"
26 RESTRICT="test"
28 RDEPEND="x11-libs/qt:4
29 x11-libs/libXrandr
30 x11-libs/libXcursor
31 x11-libs/libXrender
32 x11-libs/libXfixes
33 x11-libs/libXext
34 x11-libs/libSM
35 x11-libs/libICE
36 x11-libs/libX11
37 x11-libs/libXau
38 x11-libs/libXdmcp
39 media-gfx/imagemagick
40 media-libs/libpng
41 media-libs/fontconfig
42 media-libs/freetype
43 dev-libs/libxml2
44 dev-libs/boost
45 app-text/aiksaurus
46 app-text/sgmltools-lite
47 virtual/aspell-dict
48 virtual/python
49 cups? ( virtual/lpr )
50 latex? (
51 virtual/latex-base
52 virtual/ghostscript
53 app-text/noweb
54 dev-tex/dvipost
55 dev-tex/chktex
56 || (
57 dev-tex/latex2html
58 dev-tex/tth
59 dev-tex/hevea
60 dev-tex/tex4ht
63 linguas_he? ( dev-tex/ivritex )"
65 DEPEND="${RDEPEND}
66 x11-proto/xproto
67 nls? ( sys-devel/gettext )"
69 src_unpack() {
70 unpack ${A}
71 cd "${S}"
72 epatch "${FILESDIR}"/${PN}-1.5.0-gentoo.patch || die
75 src_compile() {
76 append-flags "$(test-flags -fno-stack-protector -fno-stack-protector-all)"
77 replace-flags "-Os" "-O2"
78 tc-export CXX
80 unset LINGUAS
82 econf \
83 $(use_enable nls) \
84 $(use_enable debug) \
85 $(use_enable pch) \
86 --with-aspell --without-included-boost || die "econf failed"
87 emake || die "emake failed"
90 src_install() {
91 local mylinguas="${LINGUAS}"
93 unset LINGUAS
94 emake DESTDIR="${D}" install || die "emake install failed"
96 LINGUAS="${mylinguas}"
98 dodoc ANNOUNCE ChangeLog NEWS README RELEASE-NOTES UPGRADING
100 if use linguas_he ; then
101 insinto /usr/share/lyx/bind
102 doins "${DISTDIR}"/hebrew.bind
103 dodoc "${DISTDIR}"/preferences
106 domenu "${FILESDIR}"/lyx.desktop
108 cd "${WORKDIR}"/${FONT_P}
109 emake DESTDIR="${D}" install || die "Font installation failed"
111 font_src_install
113 if use latex ; then
114 dosym ../../../lyx/tex /usr/share/texmf/tex/latex/lyx
118 pkg_postinst() {
119 font_pkg_postinst
121 if use latex ; then
122 texhash
125 if use linguas_he ; then
126 elog
127 elog "How to use Hebrew in LyX:"
128 elog "bunzip2 /usr/share/doc/${PF}/preferences.bz2 into ~/.lyx/preferences"
129 elog "or, read http://cs.haifa.ac.il/~dekelts/lyx/instructions2.html"
130 elog "for instructions on using lyx's own preferences dialog to equal effect."
131 elog
134 elog
135 elog "There are known issues in the case of 1.4->1.5 config files transition."
136 elog "In case your File->Export list is incomplete try reconfiguring or even"
137 elog "remove the old configuration files in ~/.lyx ."
138 elog
141 pkg_postrm() {
142 if use latex ; then
143 texhash