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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Aug 26 10:10:54 2007 UTC (13 years, 3 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.2.12)

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

  ViewVC Help
Powered by ViewVC 1.1.20