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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Mon Jun 25 21:41:23 2007 UTC (13 years, 5 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +1 -1 lines
FILE REMOVED
Version bump, remove old, and stabilize on ia64/x86
(Portage version: 2.1.3_rc5)

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

  ViewVC Help
Powered by ViewVC 1.1.20