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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5.0.9-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Mar 11 13:42:39 2007 UTC (13 years, 8 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Punt vulnerable and unused. Add arm back to stable in 2.0.0.2, which i removed
(Portage version: 2.1.2.2)

1 # Copyright 1999-2007 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.0.9-r1.ebuild,v 1.4 2007/02/21 15:11:19 armin76 Exp $
4
5 WANT_AUTOCONF="2.1"
6
7 unset ALLOWED_FLAGS # stupid extra-functions.sh ... bug 49179
8 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
9
10 LANGS="ar bg ca cs da de el en-GB es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu it ja ko lt mk nb-NO nl pa-IN pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW"
11 SHORTLANGS="es-ES ga-IE nb-NO sv-SE"
12 PATCH="${P}-patches-0.1"
13
14 DESCRIPTION="Firefox Web Browser"
15 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
16 SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}-source.tar.bz2
17 http://dev.gentooexperimental.org/~anarchy/dist/${PATCH}.tar.bz2
18 mirror://gentoo/${PATCH}.tar.bz2"
19
20 KEYWORDS="-* ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
21 SLOT="0"
22 LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
23 IUSE="java mozdevelop"
24
25 for X in ${LANGS} ; do
26 SRC_URI="${SRC_URI} linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~anarchy/${P}-xpi/${P}-${X}.xpi )"
27 IUSE="${IUSE} linguas_${X/-/_}"
28 done
29
30 for X in ${SHORTLANGS} ; do
31 SRC_URI="${SRC_URI} linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~anarchy/${P}-xpi/${P}-${X}.xpi )"
32 IUSE="${IUSE} linguas_${X%%-*}"
33 done
34
35 RDEPEND="java? ( virtual/jre )
36 >=www-client/mozilla-launcher-1.39
37 >=sys-devel/binutils-2.16.1
38 >=dev-libs/nss-3.10
39 >=dev-libs/nspr-4.6.1"
40
41 DEPEND="${RDEPEND}
42 java? ( >=dev-java/java-config-0.2.0 )"
43
44 S=${WORKDIR}/mozilla
45
46 # Needed by src_compile() and src_install().
47 # Would do in pkg_setup but that loses the export attribute, they
48 # become pure shell variables.
49 export MOZ_CO_PROJECT=browser
50 export BUILD_OFFICIAL=1
51 export MOZILLA_OFFICIAL=1
52
53 linguas() {
54 linguas=
55 local LANG
56 for LANG in ${LINGUAS}; do
57 if hasq ${LANG} en en_US; then
58 hasq en ${linguas} || \
59 linguas="${linguas:+"${linguas} "}en"
60 continue
61 elif hasq ${LANG} ${LANGS//-/_}; then
62 hasq ${LANG//_/-} ${linguas} || \
63 linguas="${linguas:+"${linguas} "}${LANG//_/-}"
64 continue
65 else
66 local SLANG
67 for SLANG in ${SHORTLANGS}; do
68 if [[ ${LANG} == ${SLANG%%-*} ]]; then
69 hasq ${SLANG} ${linguas} || \
70 linguas="${linguas:+"${linguas} "}${SLANG}"
71 continue 2
72 fi
73 done
74 fi
75 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
76 done
77 }
78
79 pkg_setup() {
80 if ! built_with_use x11-libs/cairo X; then
81 eerror "Cairo is not built with X useflag."
82 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
83 die "Cairo needs X"
84 fi
85
86 use moznopango && warn_mozilla_launcher_stub
87 }
88
89 src_unpack() {
90 unpack ${A}
91
92 linguas
93 for X in ${linguas}; do
94 [[ ${X} != en ]] && xpi_unpack ${P}-${X}.xpi
95 done
96
97 # Apply our patches
98 cd ${S} || die "cd failed"
99 EPATCH_SUFFIX="patch" \
100 EPATCH_FORCE="yes" \
101 epatch ${WORKDIR}/patch
102
103 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
104 # PowerPC, because with that configuration, it detects a ppc64 system.
105 # -- hansmi, 2005-11-13
106 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
107 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
108 ${S}/configure
109 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
110 ${S}/security/coreconf/arch.mk
111 fi
112
113 eautoreconf || die "failed running eautoreconf"
114 }
115
116 src_compile() {
117 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
118
119 ####################################
120 #
121 # mozconfig, CFLAGS and CXXFLAGS setup
122 #
123 ####################################
124
125 mozconfig_init
126 mozconfig_config
127
128 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
129 mozconfig_annotate '' --disable-mailnews
130 #mozconfig_annotate '' --enable-native-uconv
131 mozconfig_annotate '' --enable-image-encoder=all
132 mozconfig_annotate '' --enable-canvas
133 mozconfig_annotate '' --with-system-nspr
134 mozconfig_annotate '' --with-system-nss
135 mozconfig_annotate '' --enable-official-branding
136
137 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
138 # regardless of java setting.
139 mozconfig_annotate '' --enable-oji --enable-mathml
140
141 # Other ff-specific settings
142 mozconfig_use_enable mozdevelop jsd
143 mozconfig_use_enable mozdevelop xpctools
144 mozconfig_use_extension mozdevelop venkman
145 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
146
147 # Finalize and report settings
148 mozconfig_final
149
150 # hardened GCC uses -fstack-protector-all by default, which breaks us
151 gcc-specs-ssp && append-flags -fno-stack-protector-all
152 # remove -fstack-protector because now it borks firefox
153 CFLAGS=${CFLAGS/-fstack-protector-all/}
154 CFLAGS=${CFLAGS/-fstack-protector/}
155 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
156 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
157
158 append-flags -freorder-blocks -fno-reorder-functions
159
160 # Export CPU_ARCH_TEST as it is not exported by default.
161 case $(tc-arch) in
162 amd64) [[ ${ABI} == "x86" ]] && CPU_ARCH_TEST="x86" || CPU_ARCH_TEST="x86_64" ;;
163 *) CPU_ARCH_TEST=$(tc-arch) ;;
164 esac
165
166 export CPU_ARCH_TEST
167
168 ####################################
169 #
170 # Configure and build
171 #
172 ####################################
173
174 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
175 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
176 econf || die
177
178 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
179 # to econf, but the quotes cause configure to fail.
180 sed -i -e \
181 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
182 ${S}/config/autoconf.mk \
183 ${S}/xpfe/global/buildconfig.html
184
185 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
186 # requirements while compiling
187 edit_makefiles
188
189 emake -j1 || die
190 }
191
192 pkg_preinst() {
193 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
194
195 echo ""
196 einfo "Removing old installs though some really ugly code. It potentially"
197 einfo "eliminates any problems during the install, however suggestions to"
198 einfo "replace this are highly welcome. Send comments and suggestions to"
199 einfo "mozilla@gentoo.org"
200 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
201 echo ""
202 }
203
204 src_install() {
205 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
206
207 # Most of the installation happens here
208 dodir ${MOZILLA_FIVE_HOME}
209 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
210
211 linguas
212 for X in ${linguas}; do
213 [[ ${X} != en ]] && xpi_install ${WORKDIR}/${P}-${X}
214 done
215
216 local LANG=${linguas%% *}
217 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
218 ebegin "Setting default locale to ${LANG}"
219 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
220 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
221 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
222 eend $? || die "sed failed to change locale"
223 fi
224
225 # Create /usr/bin/firefox
226 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
227
228 # Install icon and .desktop for menu entry
229 doicon ${FILESDIR}/icon/firefox-icon.png
230 domenu ${FILESDIR}/icon/mozilla-firefox-1.5.desktop
231
232 # Fix icons to look the same everywhere
233 insinto ${MOZILLA_FIVE_HOME}/icons
234 doins ${S}/dist/branding/mozicon16.xpm
235 doins ${S}/dist/branding/mozicon50.xpm
236
237 ####################################
238 #
239 # Install files necessary for applications to build against firefox
240 #
241 ####################################
242
243 ewarn "Installing includes and idl files..."
244 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
245 cd ${S}/dist
246 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
247 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
248
249 # Dirty hack to get some applications using this header running
250 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
251 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
252
253 # Fix pkgconfig files and install them
254 insinto /usr/$(get_libdir)/pkgconfig
255 for x in ${S}/build/unix/*.pc; do
256 doins ${x}
257 done
258
259 ####################################
260 #
261 # Some preferences, probably gentoo.org as start-page also
262 #
263 ####################################
264
265 dodir ${MOZILLA_FIVE_HOME}/greprefs
266 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
267 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
268 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
269
270 # Install docs
271 dodoc LEGAL
272 }
273
274 pkg_postinst() {
275 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
276
277 # This should be called in the postinst and postrm of all the
278 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
279 # thunderbird-bin ebuilds.
280 update_mozilla_launcher_symlinks
281
282 # Update mimedb for the new .desktop file
283 fdo-mime_desktop_database_update
284
285 echo ""
286 ewarn "Please remember to rebuild any packages that you have built"
287 ewarn "against firefox. Some packages might be broken by the upgrade; if this"
288 ewarn "is the case, please search at http://bugs.gentoo.org and open a new bug"
289 ewarn "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
290 ewarn "and test with a clean profile directory."
291 ewarn "Thank you! mozilla@gentoo.org."
292
293 echo ""
294 einfo "Any regchrome errors can be ignored right now, this is due to"
295 einfo "mozilla-firefox-1.0.x. being unregistered with mozilla-launcher."
296
297 epause 15
298 }
299
300 pkg_postrm() {
301 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
302
303 update_mozilla_launcher_symlinks
304 }

  ViewVC Help
Powered by ViewVC 1.1.20