app-office/lyx: -9999, fix desktop file image location.
[gentoo-soor-overlay.git] / app-office / lyx / lyx-9999.ebuild
Commit [+]AuthorDateLineData
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +02001# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header: $
4
5EAPI="1"
6
fa3d5ecc Leonardo Valeri Manera2008-05-05 23:04:04 +02007inherit autotools subversion eutils flag-o-matic font toolchain-funcs
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +02008
9FONT_P="latex-xft-fonts-0.1"
10
11DESCRIPTION="WYSIWYM frontend for LaTeX, DocBook, etc."
12HOMEPAGE="http://www.lyx.org/"
13ESVN_REPO_URI="svn://svn.lyx.org/lyx/lyx-devel/trunk"
14SRC_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
18 )"
19
20LICENSE="GPL-2"
21SLOT="0"
772bf709 Leonardo Valeri Manera2008-05-05 23:05:20 +020022KEYWORDS=""
9b6fb523 Leonardo Valeri Manera2008-05-06 22:49:05 +020023IUSE="cups debug latex monolithic nls linguas_he"
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +020024RESTRICT="test"
25
26RDEPEND="|| (
27 (
28 x11-libs/qt-core:4
29 x11-libs/qt-gui:4
30 )
b2859e06 Leonardo Valeri Manera2008-05-07 04:19:10 +020031 >=x11-libs/qt-4.2:4
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +020032 )
33 x11-libs/libXrandr
34 x11-libs/libXcursor
35 x11-libs/libXrender
36 x11-libs/libXfixes
37 x11-libs/libXext
38 x11-libs/libSM
39 x11-libs/libICE
40 x11-libs/libX11
41 x11-libs/libXau
42 x11-libs/libXdmcp
43 media-gfx/imagemagick
44 media-libs/libpng
45 media-libs/fontconfig
46 media-libs/freetype
47 dev-libs/libxml2
48 dev-libs/boost
67f37d6c Leonardo Valeri Manera2008-05-06 04:25:02 +020049 >=sys-devel/gcc-4.1
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +020050 app-text/aiksaurus
51 app-text/sgmltools-lite
52 virtual/aspell-dict
53 virtual/python
54 cups? ( virtual/lpr )
55 latex? (
56 virtual/latex-base
57 virtual/ghostscript
58 app-text/noweb
59 dev-tex/dvipost
60 dev-tex/chktex
61 || (
62 dev-tex/latex2html
63 dev-tex/tth
64 dev-tex/hevea
65 dev-tex/tex4ht
66 )
67 )
68 linguas_he? ( dev-tex/ivritex )"
69
70DEPEND="${RDEPEND}
71 x11-proto/xproto
72 nls? ( sys-devel/gettext )"
73
74S="${WORKDIR}"/${P}
75
9b6fb523
LVM
Leonardo Valeri Manera2008-05-06 22:49:05 +020076pkg_setup() {
77 if use monolithic; then
78 ewarn ":WARNING:"
79 ewarn "Bulding LyX with USE=monolithic needs 512Mb of RAM or more"
80 ewarn "for each make job (-j). Don't come crying to me if you run"
81 ewarn "out of ram."
82 fi
83}
84
fc321e2b Leonardo Valeri Manera2008-05-05 22:37:15 +020085src_unpack() {
fc321e2b Leonardo Valeri Manera2008-05-05 22:37:15 +020086 unpack ${A}
d97aad0d Leonardo Valeri Manera2008-05-06 01:13:41 +020087 subversion_fetch || die "Fetch with SVN failed kthnx."
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +020088 cd "${S}"
89 epatch "${FILESDIR}"/${PN}-1.5.0-gentoo.patch || die
fc321e2b Leonardo Valeri Manera2008-05-05 22:37:15 +020090
fa3d5ecc
LVM
Leonardo Valeri Manera2008-05-05 23:04:04 +020091 # trunk needs to regen with autotools
92 # lets use gentoo tools instead of the lyx script,
93 # which calls aclocal, autoheader, automake, autoconf
fa3d5ecc
LVM
Leonardo Valeri Manera2008-05-05 23:04:04 +020094 rm -rf "${S}"/autom4te.cache
95 eaclocal
96 eautoheader
81499aea Leonardo Valeri Manera2008-05-05 23:28:31 +020097 eautomake
fa3d5ecc Leonardo Valeri Manera2008-05-05 23:04:04 +020098 eautoconf
d6068da7
LVM
Leonardo Valeri Manera2008-05-05 23:17:49 +020099}
100
101src_compile() {
102 append-flags "$(test-flags -fno-stack-protector -fno-stack-protector-all)"
103 replace-flags "-Os" "-O2"
104 tc-export CXX
105
106 unset LINGUAS
fa3d5ecc Leonardo Valeri Manera2008-05-05 23:04:04 +0200107
67f37d6c
LVM
Leonardo Valeri Manera2008-05-06 04:25:02 +0200108 if use monolithic; then
109 monolithic="--enable-monolithic-client"
110 monolithic="${monolithic} --enable-monolithic-insets"
111 monolithic="${monolithic} --enable-monolithic-mathed"
112 monolithic="${monolithic} --enable-monolithic-core"
113 monolithic="${monolithic} --enable-monolithic-tex2lyx"
114 monolithic="${monolithic} --enable-monolithic-frontend-qt4"
115 fi
116
117 if use debug; then
118 build_type="--enable-build-type=development"
119 else
120 build_type="--enable-build-type=release"
121 fi
122
123 econf ${monolithic} \
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +0200124 $(use_enable nls) \
125 $(use_enable debug) \
67f37d6c Leonardo Valeri Manera2008-05-06 04:25:02 +0200126 ${build_type} \
9b6fb523 Leonardo Valeri Manera2008-05-06 22:49:05 +0200127 --disable-pch --with-aspell --without-included-boost || die "econf failed"
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +0200128 emake || die "emake failed"
129}
130
131src_install() {
132 local mylinguas="${LINGUAS}"
133
134 unset LINGUAS
135 emake DESTDIR="${D}" install || die "emake install failed"
136
137 LINGUAS="${mylinguas}"
138
139 dodoc ANNOUNCE ChangeLog NEWS README RELEASE-NOTES UPGRADING
140
141 if use linguas_he ; then
142 insinto /usr/share/lyx/bind
143 doins "${DISTDIR}"/hebrew.bind
144 dodoc "${DISTDIR}"/preferences
145 fi
146
147 domenu "${FILESDIR}"/lyx.desktop
5c8c6396 Leonardo Valeri Manera2008-05-10 18:25:03 +0200148 dosed 's:lyx\.xpm:lyx\.png:' /usr/share/appplications/lyx.desktop
fc321e2b
LVM
Leonardo Valeri Manera2008-05-05 22:37:15 +0200149
150 cd "${WORKDIR}"/${FONT_P}
151 emake DESTDIR="${D}" install || die "Font installation failed"
152
153 font_src_install
154
155 if use latex ; then
156 dosym ../../../lyx/tex /usr/share/texmf/tex/latex/lyx
157 fi
158}
159
160pkg_postinst() {
161 font_pkg_postinst
162
163 if use latex ; then
164 texhash
165 fi
166
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
174 fi
175
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
181}
182
183pkg_postrm() {
184 if use latex ; then
185 texhash
186 fi
187}