app-office/lyx: LyX's PCH only slow compliation down - disable them
[gentoo-soor-overlay.git] / app-office / lyx / lyx-9999.ebuild
blobd3a5f063d51a80e4fce6b52ba2d155defba6fc37
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 autotools subversion eutils flag-o-matic font toolchain-funcs
9 FONT_P="latex-xft-fonts-0.1"
11 DESCRIPTION="WYSIWYM frontend for LaTeX, DocBook, etc."
12 HOMEPAGE="http://www.lyx.org/"
13 ESVN_REPO_URI="svn://svn.lyx.org/lyx/lyx-devel/trunk"
14 SRC_URI="ftp://ftp.lyx.org/pub/lyx/contrib/${FONT_P}.tar.gz
15 linguas_he? (
16 http://cs.haifa.ac.il/~dekelts/lyx/files/hebrew.bind
17 http://cs.haifa.ac.il/~dekelts/lyx/files/preferences
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS=""
23 IUSE="cups debug latex monolithic nls linguas_he"
24 RESTRICT="test"
26 RDEPEND="|| (
28 x11-libs/qt-core:4
29 x11-libs/qt-gui:4
31 =x11-libs/qt-4.3*
32 =x11-libs/qt-4.2*
34 x11-libs/libXrandr
35 x11-libs/libXcursor
36 x11-libs/libXrender
37 x11-libs/libXfixes
38 x11-libs/libXext
39 x11-libs/libSM
40 x11-libs/libICE
41 x11-libs/libX11
42 x11-libs/libXau
43 x11-libs/libXdmcp
44 media-gfx/imagemagick
45 media-libs/libpng
46 media-libs/fontconfig
47 media-libs/freetype
48 dev-libs/libxml2
49 dev-libs/boost
50 >=sys-devel/gcc-4.1
51 app-text/aiksaurus
52 app-text/sgmltools-lite
53 virtual/aspell-dict
54 virtual/python
55 cups? ( virtual/lpr )
56 latex? (
57 virtual/latex-base
58 virtual/ghostscript
59 app-text/noweb
60 dev-tex/dvipost
61 dev-tex/chktex
62 || (
63 dev-tex/latex2html
64 dev-tex/tth
65 dev-tex/hevea
66 dev-tex/tex4ht
69 linguas_he? ( dev-tex/ivritex )"
71 DEPEND="${RDEPEND}
72 x11-proto/xproto
73 nls? ( sys-devel/gettext )"
75 S="${WORKDIR}"/${P}
77 pkg_setup() {
78 if use monolithic; then
79 ewarn ":WARNING:"
80 ewarn "Bulding LyX with USE=monolithic needs 512Mb of RAM or more"
81 ewarn "for each make job (-j). Don't come crying to me if you run"
82 ewarn "out of ram."
86 src_unpack() {
87 unpack ${A}
88 subversion_fetch || die "Fetch with SVN failed kthnx."
89 cd "${S}"
90 epatch "${FILESDIR}"/${PN}-1.5.0-gentoo.patch || die
92 # trunk needs to regen with autotools
93 # lets use gentoo tools instead of the lyx script,
94 # which calls aclocal, autoheader, automake, autoconf
95 rm -rf "${S}"/autom4te.cache
96 eaclocal
97 eautoheader
98 eautomake
99 eautoconf
102 src_compile() {
103 append-flags "$(test-flags -fno-stack-protector -fno-stack-protector-all)"
104 replace-flags "-Os" "-O2"
105 tc-export CXX
107 unset LINGUAS
109 if use monolithic; then
110 monolithic="--enable-monolithic-client"
111 monolithic="${monolithic} --enable-monolithic-insets"
112 monolithic="${monolithic} --enable-monolithic-mathed"
113 monolithic="${monolithic} --enable-monolithic-core"
114 monolithic="${monolithic} --enable-monolithic-tex2lyx"
115 monolithic="${monolithic} --enable-monolithic-frontend-qt4"
118 if use debug; then
119 build_type="--enable-build-type=development"
120 else
121 build_type="--enable-build-type=release"
124 econf ${monolithic} \
125 $(use_enable nls) \
126 $(use_enable debug) \
127 ${build_type} \
128 --disable-pch --with-aspell --without-included-boost || die "econf failed"
129 emake || die "emake failed"
132 src_install() {
133 local mylinguas="${LINGUAS}"
135 unset LINGUAS
136 emake DESTDIR="${D}" install || die "emake install failed"
138 LINGUAS="${mylinguas}"
140 dodoc ANNOUNCE ChangeLog NEWS README RELEASE-NOTES UPGRADING
142 if use linguas_he ; then
143 insinto /usr/share/lyx/bind
144 doins "${DISTDIR}"/hebrew.bind
145 dodoc "${DISTDIR}"/preferences
148 domenu "${FILESDIR}"/lyx.desktop
150 cd "${WORKDIR}"/${FONT_P}
151 emake DESTDIR="${D}" install || die "Font installation failed"
153 font_src_install
155 if use latex ; then
156 dosym ../../../lyx/tex /usr/share/texmf/tex/latex/lyx
160 pkg_postinst() {
161 font_pkg_postinst
163 if use latex ; then
164 texhash
167 if use linguas_he ; then
168 elog
169 elog "How to use Hebrew in LyX:"
170 elog "bunzip2 /usr/share/doc/${PF}/preferences.bz2 into ~/.lyx/preferences"
171 elog "or, read http://cs.haifa.ac.il/~dekelts/lyx/instructions2.html"
172 elog "for instructions on using lyx's own preferences dialog to equal effect."
173 elog
176 elog
177 elog "There are known issues in the case of 1.4->1.5 config files transition."
178 elog "In case your File->Export list is incomplete try reconfiguring or even"
179 elog "remove the old configuration files in ~/.lyx ."
180 elog
183 pkg_postrm() {
184 if use latex ; then
185 texhash