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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Mon Jul 18 15:15:38 2005 UTC (15 years, 4 months ago) by agriffis
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +1 -1 lines
FILE REMOVED
Install /usr/bin/firefox stub using install_mozilla_launcher_stub from
mozilla-launcher.eclass #99084
(Portage version: 2.0.51.20-r5)

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-1.0.3.ebuild,v 1.11 2005/07/12 18:51:17 agriffis Exp $
4
5 inherit makeedit flag-o-matic toolchain-funcs nsplugins eutils mozconfig mozilla-launcher multilib
6
7 S=${WORKDIR}/mozilla
8
9 DESCRIPTION="The Mozilla Firefox Web Browser"
10 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
11 MY_PV=${PV/_rc/rc}
12 SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2
13 mirror://gentoo/mozilla-firefox-1.0-4ft2.patch.bz2
14 http://dev.gentoo.org/~agriffis/dist/mozilla-firefox-1.0-4ft2.patch.bz2"
15
16 LICENSE="MPL-1.1 NPL-1.1"
17 SLOT="0"
18 KEYWORDS="alpha amd64 ~arm hppa -ia64 ppc sparc x86"
19 IUSE="gnome java mozdevelop mozsvg"
20
21 # xrender.pc appeared for the first time in xorg-x11-6.7.0-r2
22 # and is required to build with support for cairo. #71504
23 RDEPEND="java? ( virtual/jre )
24 >=media-libs/libmng-1.0.0
25 mozsvg? (
26 >=x11-base/xorg-x11-6.7.0-r2
27 x11-libs/cairo
28 )
29 >=www-client/mozilla-launcher-1.28"
30
31 DEPEND="${RDEPEND}
32 java? ( >=dev-java/java-config-0.2.0 )"
33
34 # Needed by src_compile() and src_install().
35 # Would do in pkg_setup but that loses the export attribute, they
36 # become pure shell variables.
37 export MOZ_PHOENIX=1
38
39 src_unpack() {
40 unpack firefox-${MY_PV}-source.tar.bz2 || die "unpack failed"
41 cd ${S} || die "cd failed"
42
43 # alpha stubs patch from lfs project.
44 # <taviso@gentoo.org> (26 Jun 2003)
45 use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch
46
47 # hppa patches from Ivar <orskaug@stud.ntnu.no>
48 # <gmsoft@gentoo.org> (22 Dec 2004)
49 epatch ${FILESDIR}/mozilla-hppa.patch
50
51 # patch out ft caching code since the API changed between releases of
52 # freetype; this enables freetype-2.1.8+ compat.
53 # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
54 epatch ${DISTDIR}/mozilla-firefox-1.0-4ft2.patch.bz2
55
56 # patch to fix separate character on euro keyboards, bug 68995
57 epatch ${FILESDIR}/mozilla-firefox-1.0-kp_separator.patch
58
59 if has_version '>=x11-libs/cairo-0.3.0'; then
60 epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
61 fi
62 }
63
64 src_compile() {
65 ####################################
66 #
67 # mozconfig, CFLAGS and CXXFLAGS setup
68 #
69 ####################################
70
71 mozconfig_init
72
73 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
74 # regardless of java setting.
75 mozconfig_annotate '' --enable-oji --enable-mathml
76
77 # Other ff-specific settings
78 mozconfig_use_enable mozdevelop jsd
79 mozconfig_use_enable mozdevelop xpctools
80 mozconfig_use_extension mozdevelop venkman
81 mozconfig_use_enable gnome gnomevfs
82 mozconfig_use_extension gnome gnomevfs
83 mozconfig_use_enable mozsvg svg
84 mozconfig_use_enable mozsvg svg-renderer-cairo
85 mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
86 mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox
87
88 # Finalize and report settings
89 mozconfig_final
90
91 # hardened GCC uses -fstack-protector-all by default, and this breaks
92 # firefox.
93 has_hardened && append-flags -fno-stack-protector-all
94 replace-flags -fstack-protector-all -fstack-protector
95
96 ####################################
97 #
98 # Configure and build Firefox
99 #
100 ####################################
101
102 # ./configure picks up the mozconfig stuff
103 export LD="$(tc-getLD)"
104 export CC="$(tc-getCC)"
105 export CXX="$(tc-getCXX)"
106 econf
107
108 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
109 # requirements while compiling
110 edit_makefiles
111
112 emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
113 }
114
115 src_install() {
116 # Plugin path creation
117 PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
118 dodir ${PLUGIN_DIR}
119
120 dodir /usr/$(get_libdir)/MozillaFirefox
121 cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox
122
123 einfo "Installing includes and idl files..."
124 # Copy the include and idl files
125 dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
126 cd ${S}/dist
127 cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
128 cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
129 dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox
130
131 # Dirty hack to get some applications using this header running
132 dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h
133
134 cd ${S}/build/unix
135 # Fix firefox-config and install it
136 sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
137 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
138 exeinto /usr/$(get_libdir)/MozillaFirefox
139 doexe firefox-config
140 # Fix pkgconfig files and install them
141 insinto /usr/$(get_libdir)/pkgconfig
142 for x in *.pc; do
143 if [[ -f ${x} ]]; then
144 sed -i -e
145 "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
146 sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
147 doins ${x}
148 fi
149 done
150 cd ${S}
151
152
153 #fix permissions
154 chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox
155
156 # Plugin path setup (rescuing the existent plugins)
157 src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
158
159 dodir /usr/bin
160 cat <<EOF >${D}/usr/bin/firefox
161 #!/bin/sh
162 #
163 # Stub script to run mozilla-launcher. We used to use a symlink here but
164 # OOo brokenness makes it necessary to use a stub instead:
165 # http://bugs.gentoo.org/show_bug.cgi?id=78890
166
167 export MOZILLA_LAUNCHER=firefox
168 exec /usr/libexec/mozilla-launcher "\$@"
169 EOF
170 chmod 0755 ${D}/usr/bin/firefox
171 insinto /etc/env.d
172 doins ${FILESDIR}/10MozillaFirefox
173
174 # Fix icons to look the same everywhere
175 insinto /usr/$(get_libdir)/MozillaFirefox/icons
176 doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
177 doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm
178
179 # Install icon and .desktop for menu entry
180 insinto /usr/share/pixmaps
181 doins ${FILESDIR}/icon/firefox-icon.png
182 # Fix bug 54179: Install .desktop file into /usr/share/applications
183 # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
184 insinto /usr/share/applications
185 doins ${FILESDIR}/icon/mozillafirefox.desktop
186
187 # Normally firefox-0.9 must be run as root once before it can be
188 # run as a normal user. Drop in some initialized files to avoid
189 # this.
190 einfo "Extracting firefox-${PV} initialization files"
191 tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
192 }
193
194 pkg_preinst() {
195 export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox
196
197 # Remove the old plugins dir
198 pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins
199
200 # Remove entire installed instance to prevent all kinds of
201 # problems... see bug 44772 for example
202 rm -rf "${MOZILLA_FIVE_HOME}"
203 }
204
205 pkg_postinst() {
206 export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"
207
208 # Needed to update the run time bindings for REGXPCOM
209 # (do not remove next line!)
210 env-update
211
212 # Register Components and Chrome
213 #
214 # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
215 # Otherwise the following commands will create ~/.mozilla owned by root
216 # and 700 perms, which makes subsequent execution of firefox by user
217 # impossible.
218 einfo "Registering Components and Chrome..."
219 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
220 HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome
221
222 # Fix permissions of component registry
223 chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat
224
225 # Fix directory permissions
226 find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :
227
228 # Fix permissions on chrome files
229 find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :
230
231 # This should be called in the postinst and postrm of all the
232 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
233 # thunderbird-bin ebuilds.
234 update_mozilla_launcher_symlinks
235 }
236
237 pkg_postrm() {
238 update_mozilla_launcher_symlinks
239 }

  ViewVC Help
Powered by ViewVC 1.1.20