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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5_rc1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Nov 7 03:10:13 2005 UTC (15 years ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
new eclass for >=1.5 mozilla products
(Portage version: 2.0.53_rc7)

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.5_rc1.ebuild,v 1.2 2005/11/03 16:13:29 anarchy Exp $
4
5 unset ALLOWED_FLAGS # stupid extra-functions.sh ... bug 49179
6 MOZ_FREETYPE2="no" # Need to disable for newer .. remove here and in mozconfig
7 # when older is removed from tree.
8 MOZ_PANGO="yes" # Need to enable for newer .. remove here and in mozconfig
9 # when older is removed from tree.
10
11 inherit flag-o-matic toolchain-funcs eutils mozconfig mozilla-launcher makeedit multilib fdo-mime versionator
12
13 MY_P="$(replace_version_separator 2 '')"
14 FV=${MY_P/beta/b}
15
16 DESCRIPTION="Firefox Web Browser"
17 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
18 SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FV}/source/firefox-${FV}-source.tar.bz2
19 mirror://gentoo/mozilla-jslibmath-alpha.patch
20 mirror://gentoo/embed-typeaheadfind.patch"
21
22 KEYWORDS="-*"
23 SLOT="0"
24 LICENSE="MPL-1.1 NPL-1.1"
25 IUSE="java mozdevelop"
26
27 RDEPEND="java? ( virtual/jre )
28 >=www-client/mozilla-launcher-1.39
29 =x11-libs/pango-1.10.1"
30
31 DEPEND="${RDEPEND}
32 java? ( >=dev-java/java-config-0.2.0 )"
33
34 S=${WORKDIR}/mozilla
35
36 # Needed by src_compile() and src_install().
37 # Would do in pkg_setup but that loses the export attribute, they
38 # become pure shell variables.
39 export MOZ_CO_PROJECT=browser
40 export BUILD_OFFICIAL=1
41 export MOZILLA_OFFICIAL=1
42
43 src_unpack() {
44 unpack firefox-${FV}-source.tar.bz2
45 cd ${S} || die "cd failed"
46
47 ####################################
48 #
49 # architecture patches
50 #
51 ####################################
52
53 # alpha stubs patch from lfs project.
54 # <taviso@gentoo.org> (26 Jun 2003)
55 use alpha && epatch ${FILESDIR}/1.5/mozilla-1.3-alpha-stubs.patch
56
57 # amd64 visibility patch
58 if [[ ${ARCH} == amd64 ]] && [[ $(gcc-major-version) -ge 3 ]]; then
59 epatch ${FILESDIR}/1.5/firefox-visibility.patch
60 fi
61
62 # hppa patches from Ivar <orskaug@stud.ntnu.no>
63 # <gmsoft@gentoo.org> (22 Dec 2004)
64 epatch ${FILESDIR}/1.5/mozilla-hppa.patch
65
66 # patch to solve segfaults on ia64, from Debian, originally from David
67 # Mosberger
68 epatch ${FILESDIR}/1.5/mozilla-firefox-1.1a2-ia64.patch
69
70 # patch to fix math operations on alpha, makes maps.google.com work!
71 epatch ${DISTDIR}/mozilla-jslibmath-alpha.patch
72
73 ####################################
74 #
75 # general compilation and run-time fixes
76 #
77 ####################################
78
79 # patch from fedora to remove the pangoxft things
80 epatch ${FILESDIR}/1.5/firefox-nopangoxft.patch
81 #cairo-canvas patch
82 epatch ${FILESDIR}/1.5/firefox-cairo-canvas.patch
83
84 ####################################
85 #
86 # behavioral fixes
87 #
88 ####################################
89
90 # patch to fix typeahead find for browsers which embed Firefox
91 # http://bugzilla.gnome.org/show_bug.cgi?id=157435
92 epatch ${DISTDIR}/embed-typeaheadfind.patch
93
94 # Fix scripts that call for /usr/local/bin/perl #51916
95 ebegin "Patching smime to call perl from /usr/bin"
96 sed -i -e '1s,usr/local/bin,usr/bin,' ${S}/security/nss/cmd/smimetools/smime
97 eend $? || die "sed failed"
98
99 ewarn ""
100 ewarn ""
101 ewarn "This firefox-1.5rc1 ebuild is provided for your convenience,"
102 ewarn "the use of this ebuild is not supported by gentoo developers. "
103 ewarn "Please file bugs related to firefox-1.5 with upstream developers."
104 ewarn "Bugs should be filed @ https://bugzilla.mozilla.org."
105 ewarn "Thank you Anarchy"
106 }
107
108 src_compile() {
109 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
110
111 ####################################
112 #
113 # mozconfig, CFLAGS and CXXFLAGS setup
114 #
115 ####################################
116
117 mozconfig_init
118
119 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
120 mozconfig_annotate '' --disable-mailnews
121 #mozconfig_annotate '' --enable-native-uconv
122 mozconfig_annotate '' --enable-image-encoder=all
123
124 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
125 # regardless of java setting.
126 mozconfig_annotate '' --enable-oji --enable-mathml
127
128 # Other ff-specific settings
129 mozconfig_use_enable mozdevelop jsd
130 mozconfig_use_enable mozdevelop xpctools
131 mozconfig_use_extension mozdevelop venkman
132 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
133
134 # Finalize and report settings
135 mozconfig_final
136
137 # hardened GCC uses -fstack-protector-all by default, which breaks us
138 has_hardened && append-flags -fno-stack-protector-all
139 # remove -fstack-protector because now it borks firefox
140 CFLAGS=${CFLAGS/-fstack-protector-all/}
141 CFLAGS=${CFLAGS/-fstack-protector/}
142 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
143 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
144
145 ####################################
146 #
147 # Configure and build
148 #
149 ####################################
150
151 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
152 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
153 econf || die
154
155 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
156 # to econf, but the quotes cause configure to fail.
157 sed -i -e \
158 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
159 ${S}/config/autoconf.mk \
160 ${S}/nsprpub/config/autoconf.mk \
161 ${S}/xpfe/global/buildconfig.html
162
163 # Fixup the RPATH
164 sed -i -e \
165 's|#RPATH_FIXER|'"${MOZILLA_FIVE_HOME}"'|' \
166 ${S}/config/rules.mk \
167 ${S}/nsprpub/config/rules.mk \
168 ${S}/security/coreconf/rules.mk \
169 ${S}/security/coreconf/rules.mk
170
171 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
172 # requirements while compiling
173 edit_makefiles
174
175 emake || die
176 }
177
178 src_install() {
179 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
180
181 # Most of the installation happens here
182 dodir ${MOZILLA_FIVE_HOME}
183 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
184
185 # Create directory structure to support portage-installed extensions.
186 # See update_chrome() in mozilla-launcher
187 keepdir ${MOZILLA_FIVE_HOME}/chrome.d
188 keepdir ${MOZILLA_FIVE_HOME}/extensions.d
189 cp ${D}${MOZILLA_FIVE_HOME}/chrome/installed-chrome.txt \
190 ${D}${MOZILLA_FIVE_HOME}/chrome.d/0_base-chrome.txt
191
192 # Create /usr/bin/firefox
193 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
194
195 # Install icon and .desktop for menu entry
196 insinto /usr/share/pixmaps
197 doins ${FILESDIR}/icon/firefox-icon.png
198
199 # Fix bug 54179: Install .desktop file into /usr/share/applications
200 # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
201 insinto /usr/share/applications
202 doins ${FILESDIR}/icon/mozillafirefox.desktop
203
204 ####################################
205 #
206 # Install files necessary for applications to build against firefox
207 #
208 ####################################
209
210 ewarn "Installing includes and idl files..."
211 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
212 cd ${S}/dist
213 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
214 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
215
216 # Dirty hack to get some applications using this header running
217 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
218 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
219
220 # Fix firefox-config and install it
221 sed -i -e "s|/usr/lib/firefox-${MY_PV}|${MOZILLA_FIVE_HOME}|g
222 s|/usr/include/firefox-${MY_PV}|${MOZILLA_FIVE_HOME}/include|g
223 s|/usr/share/idl/firefox-${MY_PV}|${MOZILLA_FIVE_HOME}/idl|g
224 s|\(echo -L.*\)\($\)|\1 -Wl,-R${MOZILLA_FIVE_HOME}\2|" \
225 ${S}/build/unix/firefox-config
226 exeinto ${MOZILLA_FIVE_HOME}
227 doexe ${S}/build/unix/firefox-config
228
229 # Fix pkgconfig files and install them
230 sed -i -e "s|-L/usr/lib/firefox-${MY_PV}|-L\$\{libdir\}|
231 s|-I/usr/include/firefox-${MY_PV}|-I\$\{includedir\}|" \
232 ${S}/build/unix/firefox-nspr.pc
233 insinto /usr/$(get_libdir)/pkgconfig
234 for x in ${S}/build/unix/*.pc; do
235 sed -i -e "s|^libdir=.*|libdir=${MOZILLA_FIVE_HOME}|
236 s|^includedir=.*|includedir=${MOZILLA_FIVE_HOME}/include|
237 s|^idldir=.*|idldir=${MOZILLA_FIVE_HOME}/idl|
238 s|\(^Libs: -L.*\)\($\)|\1 -Wl,-R\$\{libdir\}\2|" ${x}
239 doins ${x}
240 done
241
242 ####################################
243 #
244 # Some preferences, probably gentoo.org as start-page also
245 #
246 ####################################
247
248 dodir ${D}/${MOZILLA_FIVE_HOME}/greprefs
249 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
250 dodir ${D}/${MOZILLA_FIVE_HOME}/defaults/pref
251 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
252
253 # Install docs
254 dodoc LEGAL LICENSE
255 }
256
257 pkg_postinst() {
258 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
259
260 ####################################
261 #
262 # The registration is done here,
263 # mozilla-launcher do not do it correctly for now
264 #
265 ####################################
266
267 touch ${MOZILLA_FIVE_HOME}/components/compreg.dat
268 touch ${MOZILLA_FIVE_HOME}/components/xpti.dat
269 [ -x ${MOZILLA_FIVE_HOME}/firefox ] && ${MOZILLA_FIVE_HOME}/firefox -register
270 [ -x ${MOZILLA_FIVE_HOME}/regxpcom ] && ${MOZILLA_FIVE_HOME}/regxpcom
271
272 # This should be called in the postinst and postrm of all the
273 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
274 # thunderbird-bin ebuilds.
275 update_mozilla_launcher_symlinks
276
277 ewarn ""
278 ewarn ""
279 ewarn "This firefox-1.5rc1 ebuild is provided for your convenience,"
280 ewarn "the use of this ebuild is not supported by gentoo developers. "
281 ewarn "Please file bugs related to firefox-1.5 with upstream developers."
282 ewarn "Bugs should be filed @ https://bugzilla.mozilla.org."
283 ewarn "Thank you Anarchy"
284 }
285
286 pkg_postrm() {
287 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
288
289 ####################################
290 #
291 # The registration is done here,
292 # mozilla-launcher do not do it correctly for now
293 #
294 ####################################
295
296 [ -x ${MOZILLA_FIVE_HOME}/firefox ] && ${MOZILLA_FIVE_HOME}/firefox -register
297 [ -x ${MOZILLA_FIVE_HOME}/regxpcom ] && ${MOZILLA_FIVE_HOME}/regxpcom
298 update_mozilla_launcher_symlinks
299 }

  ViewVC Help
Powered by ViewVC 1.1.20