/[gentoo-x86]/www-client/mozilla-firefox/mozilla-firefox-0.9.3.ebuild
Gentoo

Contents of /www-client/mozilla-firefox/mozilla-firefox-0.9.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Apr 16 17:50:42 2005 UTC (15 years, 7 months ago) by brad
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Bump to 1.0.3
(Portage version: 2.0.51.19)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-0.9.3.ebuild,v 1.2 2005/03/23 20:05:30 seemant Exp $
4
5 inherit makeedit flag-o-matic gcc nsplugins eutils mozilla-launcher
6
7 S=${WORKDIR}/mozilla
8
9 DESCRIPTION="The Mozilla Firefox Web Browser"
10 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
11 # Mirrors have it in one of the following places, depending on what
12 # mirror you check and when you check it... :-(
13 SRC_URI="
14 http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/firefox-${PV}-source.tar.bz2
15 http://ftp.mozilla.org/pub/firefox/releases/${PV}/firefox-${PV}-source.tar.bz2"
16
17 KEYWORDS="x86 ppc sparc alpha amd64 ia64"
18 SLOT="0"
19 LICENSE="MPL-1.1 NPL-1.1"
20 IUSE="java gtk2 ipv6 moznoxft truetype xinerama"
21
22 RDEPEND="virtual/x11
23 !moznoxft? ( virtual/xft )
24 >=sys-libs/zlib-1.1.4
25 >=media-libs/jpeg-6b
26 >=media-libs/libmng-1.0.0
27 >=media-libs/libpng-1.2.1
28 >=sys-apps/portage-2.0.36
29 dev-libs/expat
30 app-arch/zip
31 app-arch/unzip
32 gtk2? ( >=x11-libs/gtk+-2.1.1 >=dev-libs/libIDL-0.8.0 )
33 !gtk2? ( =x11-libs/gtk+-1.2* =gnome-base/orbit-0* )
34 java? ( virtual/jre )
35 >=www-client/mozilla-launcher-1.7-r1"
36
37 DEPEND="${RDEPEND}
38 virtual/libc
39 dev-util/pkgconfig
40 java? ( >=dev-java/java-config-0.2.0 )"
41
42 # needed by src_compile() and src_install()
43 export MOZ_PHOENIX=1
44 export MOZ_CALENDAR=0
45 export MOZ_ENABLE_XFT=1
46
47 src_unpack() {
48 unpack firefox-${PV}-source.tar.bz2 || die "unpack failed"
49 cd ${S} || die "cd failed"
50
51 # alpha stubs patch from lfs project.
52 # <taviso@gentoo.org> (26 Jun 2003)
53 use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch
54
55 # this patch fixes upstream bug 248442 "Crash in form autocomplete
56 # (64-bit arch only)".
57 epatch ${FILESDIR}/firefox-0.9-nsFormHistory-crash-fix.patch
58 }
59
60 src_compile() {
61 local enable_optimize
62 local myconf="--disable-composer \
63 --with-x \
64 --with-system-jpeg \
65 --with-system-zlib \
66 --with-system-png \
67 --with-system-mng \
68 --disable-mailnews \
69 --disable-calendar \
70 --disable-pedantic \
71 --disable-svg \
72 --enable-mathml \
73 --without-system-nspr \
74 --enable-nspr-autoconf \
75 --enable-xsl \
76 $(use_enable ipv6) \
77 --enable-crypto \
78 --with-java-supplement \
79 --with-pthreads \
80 --with-default-mozilla-five-home=/usr/lib/MozillaFirefox \
81 --with-user-appdir=.phoenix \
82 --disable-jsd \
83 --disable-accessibility \
84 --disable-tests \
85 --disable-debug \
86 --disable-dtd-debug \
87 --disable-logging \
88 --enable-reorder \
89 --enable-strip \
90 --enable-strip-libs \
91 --enable-cpp-rtti \
92 --enable-xterm-updates \
93 --disable-ldap \
94 --disable-toolkit-qt \
95 --disable-toolkit-xlib \
96 --enable-extensions=default,-irc,-venkman,-content-packs,-help"
97
98 if use gtk2; then
99 myconf="${myconf} \
100 --enable-toolkit-gtk2 \
101 --enable-default-toolkit=gtk2 \
102 --disable-toolkit-gtk"
103 else
104 myconf="${myconf} \
105 --enable-toolkit-gtk \
106 --enable-default-toolkit=gtk \
107 --disable-toolkit-gtk2"
108 fi
109
110 if use moznoxft; then
111 myconf="${myconf} --disable-xft $(use_enable truetype freetype2)"
112 elif use gtk2; then
113 local pango_version
114
115 # We need Xft2.0 localy installed
116 if [[ -x /usr/bin/pkg-config ]] && pkg-config xft; then
117 pango_version="$(pkg-config --modversion pango | cut -d. -f1,2)"
118
119 # We also need pango-1.1, else Mozilla links to both
120 # Xft1.1 *and* Xft2.0, and segfault...
121 if [[ ${pango_version//.} -gt 10 ]]; then
122 einfo "Building with Xft2.0 (Gtk+-2.0) support!"
123 myconf="${myconf} --enable-xft --disable-freetype2"
124 touch ${WORKDIR}/.xft
125 else
126 ewarn "Building without Xft2.0 support!"
127 myconf="${myconf} --disable-xft $(use_enable truetype freetype2)"
128 fi
129 else
130 ewarn "Building without Xft2.0 support!"
131 myconf="${myconf} --disable-xft $(use_enable truetype freetype2)"
132 fi
133 else
134 einfo "Building with Xft2.0 (Gtk+-1.0) support!"
135 myconf="${myconf} --enable-xft --disable-freetype2"
136 touch ${WORKDIR}/.xft
137 fi
138
139 # Check for xinerama - closes #19369
140 if use xinerama; then
141 myconf="${myconf} --enable-xinerama=yes"
142 else
143 myconf="${myconf} --enable-xinerama=no"
144 fi
145
146 # Per-architecture flags
147 case "${ARCH}" in
148 alpha|amd64|ia64)
149 # 64-bit needs -fPIC
150 append-flags -fPIC
151 ;;
152 sparc)
153 # Added to get MozillaFirebird to compile on sparc
154 replace-sparc64-flags
155 ;;
156 ppc)
157 # Fix to avoid gcc-3.3.x miscompilation issues.
158 if [[ "$(gcc-major-version).$(gcc-minor-version)" == 3.3 ]]; then
159 append-flags -fno-strict-aliasing
160 fi
161 ;;
162 esac
163
164 # 32-bit vs. 64-bit optimization
165 case "${ARCH}" in
166 alpha|amd64|ia64)
167 # Allow -O0 or -O1: Anything more than this causes
168 # segfaults on startup on 64-bit (bug 33767)
169 enable_optimize=$(echo "$CFLAGS" | grep -Eoe '-O[01]|-O\>')
170 enable_optimize=${enable_optimize:--O1}
171 filter-flags -O -O?
172 ;;
173 *)
174 # -O2 and below allowed on 32-bit
175 enable_optimize=$(echo "$CFLAGS" | grep -Eoe '-O[012]|-O\>')
176 enable_optimize=${enable_optimize:--O2}
177 filter-flags -O -O?
178 ;;
179 esac
180
181 # Crashes on start when compiled with -fomit-frame-pointer
182 filter-flags -fno-default-inline # see bug 42488
183 filter-flags -fstack-protector # see bug 45671
184 filter-flags -fomit-frame-pointer -mpowerpc-gfxopt
185 filter-flags -ffast-math
186 append-flags -s -fforce-addr
187
188 if [[ $(gcc-major-version) -eq 3 ]]; then
189 # gcc-3 prior to 3.2.3 doesn't work well for pentium4
190 if [[ $(gcc-minor-version) -lt 2 ||
191 ( $(gcc-minor-version) -eq 2 && $(gcc-micro-version) -lt 3 ) ]]
192 then
193 replace-flags -march=pentium4 -march=pentium3
194 filter-flags -msse2
195 fi
196
197 # Enable us to use flash, etc plugins compiled with gcc-2.95.3
198 if [[ ${ARCH} == x86 ]]; then
199 myconf="${myconf} --enable-old-abi-compat-wrappers"
200 fi
201 fi
202
203 econf --enable-optimize="${enable_optimize}" ${myconf} || die
204
205 edit_makefiles
206 emake MOZ_PHOENIX=1 || die
207 }
208
209 src_install() {
210 # Plugin path creation
211 PLUGIN_DIR="/usr/lib/nsbrowser/plugins"
212 dodir ${PLUGIN_DIR}
213
214 dodir /usr/lib
215 dodir /usr/lib/MozillaFirefox
216 cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/lib/MozillaFirefox
217
218 #fix permissions
219 chown -R root:root ${D}/usr/lib/MozillaFirefox
220
221 # Plugin path setup (rescuing the existent plugins)
222 src_mv_plugins /usr/lib/MozillaFirefox/plugins
223
224 dodir /usr/bin
225 dosym /usr/libexec/mozilla-launcher /usr/bin/firefox
226 insinto /etc/env.d
227 doins ${FILESDIR}/10MozillaFirefox
228
229 # Fix icons to look the same everywhere
230 insinto /usr/lib/MozillaFirefox/icons
231 doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
232 doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm
233
234 # Install icon and .desktop for menu entry
235 insinto /usr/share/pixmaps
236 doins ${FILESDIR}/icon/firefox-icon.png
237 # Fix bug 54179: Install .desktop file into /usr/share/applications
238 # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
239 insinto /usr/share/applications
240 doins ${FILESDIR}/icon/mozillafirefox.desktop
241
242 # Normally firefox-0.9 must be run as root once before it can be
243 # run as a normal user. Drop in some initialized files to avoid
244 # this.
245 einfo "Extracting firefox-${PV} initialization files"
246 tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/lib/MozillaFirefox
247 }
248
249 pkg_preinst() {
250 export MOZILLA_FIVE_HOME=${ROOT}/usr/lib/MozillaFirefox
251
252 # Remove the old plugins dir
253 pkg_mv_plugins /usr/lib/MozillaFirefox/plugins
254
255 # Remove entire installed instance to prevent all kinds of
256 # problems... see bug 44772 for example
257 rm -rf "${MOZILLA_FIVE_HOME}"
258 }
259
260 pkg_postinst() {
261 export MOZILLA_FIVE_HOME="${ROOT}/usr/lib/MozillaFirefox"
262
263 # Needed to update the run time bindings for REGXPCOM
264 # (do not remove next line!)
265 env-update
266
267 # Register Components and Chrome
268 einfo "Registering Components and Chrome..."
269 LD_LIBRARY_PATH=/usr/lib/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
270 LD_LIBRARY_PATH=/usr/lib/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome
271
272 # Fix permissions of component registry
273 chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
274
275 # Fix directory permissions
276 find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :
277
278 # Fix permissions on chrome files
279 find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :
280
281 # This should be called in the postinst and postrm of all the
282 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
283 # thunderbird-bin ebuilds.
284 update_mozilla_launcher_symlinks
285 }
286
287 pkg_postrm() {
288 update_mozilla_launcher_symlinks
289 }

  ViewVC Help
Powered by ViewVC 1.1.20