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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.0_rc3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jun 17 18:55:07 2008 UTC (12 years, 5 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump wrt #227853, remove old
(Portage version: 2.1.4.4)

1 # Copyright 1999-2008 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-3.0_rc3.ebuild,v 1.2 2008/06/17 13:56:45 armin76 Exp $
4 EAPI="1"
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib fdo-mime autotools mozextension
8 PATCH="${PN}-3.0_rc1-patches-0.1"
9
10 LANGS="af ar be ca cs da de el en-GB en-US es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu id it ja ka ko ku lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru si sk sl sq sr sv-SE tr uk zh-CN zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-CN"
12
13 MY_PV=${PV/_rc/rc}
14 MY_P="${PN}-${MY_PV}"
15 MY_PV=${PV/3.0/}
16
17 DESCRIPTION="Firefox Web Browser"
18 HOMEPAGE="http://www.mozilla.com/firefox"
19
20 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
21 SLOT="0"
22 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
23 IUSE="java mozdevelop bindist restrict-javascript +xulrunner"
24
25 SRC_URI="mirror://gentoo/${P}.tar.bz2
26 mirror://gentoo/${PATCH}.tar.bz2
27 !xulrunner? ( mirror://gentoo/xulrunner-1.9${MY_PV}.tar.bz2 )"
28
29 # These are in
30 #
31 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
32 #
33 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
34 for X in ${LANGS} ; do
35 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
36 SRC_URI="${SRC_URI}
37 linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${MY_P}-xpi/${MY_P}-${X}.xpi )"
38 fi
39 IUSE="${IUSE} linguas_${X/-/_}"
40 # english is handled internally
41 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
42 if [ "${X}" != "en-US" ]; then
43 SRC_URI="${SRC_URI}
44 linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${MY_P}-xpi/${MY_P}-${X}.xpi )"
45 fi
46 IUSE="${IUSE} linguas_${X%%-*}"
47 fi
48 done
49
50 RDEPEND="java? ( virtual/jre )
51 >=sys-devel/binutils-2.16.1
52 >=dev-libs/nss-3.12_rc4
53 >=dev-libs/nspr-4.7.1
54 >=media-libs/lcms-1.17
55 >=app-text/hunspell-1.1.9
56 >=dev-db/sqlite-3.5.6
57 xulrunner? ( >=net-libs/xulrunner-1.9${MY_PV} )"
58
59 DEPEND="${RDEPEND}
60 dev-util/pkgconfig
61 java? ( >=dev-java/java-config-0.2.0 )"
62
63 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
64
65 S="${WORKDIR}/mozilla"
66
67 # Needed by src_compile() and src_install().
68 # Would do in pkg_setup but that loses the export attribute, they
69 # become pure shell variables.
70 export MOZ_CO_PROJECT=browser
71 export BUILD_OFFICIAL=1
72 export MOZILLA_OFFICIAL=1
73
74 linguas() {
75 local LANG SLANG
76 for LANG in ${LINGUAS}; do
77 if has ${LANG} en en_US; then
78 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
79 continue
80 elif has ${LANG} ${LANGS//-/_}; then
81 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
82 continue
83 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
84 for X in ${LANGS}; do
85 if [[ "${X}" == "${LANG}-"* ]] && \
86 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
87 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
88 continue 2
89 fi
90 done
91 fi
92 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
93 done
94 }
95
96 pkg_setup(){
97 if ! built_with_use x11-libs/cairo X; then
98 eerror "Cairo is not built with X useflag."
99 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
100 die "Cairo needs X"
101 fi
102
103 if ! built_with_use --missing true x11-libs/pango X; then
104 eerror "Pango is not built with X useflag."
105 eerror "Please add 'X' to your USE flags, and re-emerge pango."
106 die "Pango needs X"
107 fi
108
109 if ! use bindist; then
110 elog "You are enabling official branding. You may not redistribute this build"
111 elog "to any users on your network or the internet. Doing so puts yourself into"
112 elog "a legal problem with Mozilla Foundation"
113 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
114
115 fi
116 }
117
118 src_unpack() {
119 ! use xulrunner && unpack xulrunner-1.9${MY_PV}.tar.bz2
120 unpack ${P}.tar.bz2 ${PATCH}.tar.bz2
121
122 linguas
123 for X in ${linguas}; do
124 [[ ${X} != "en" ]] && xpi_unpack "${MY_P}-${X}.xpi"
125 done
126 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
127 einfo "Selected language packs (first will be default): ${linguas}"
128 fi
129
130 # Remove the patches we don't need
131 use xulrunner && rm "${WORKDIR}"/patch/*noxul* || rm "${WORKDIR}"/patch/*xulonly*
132
133 # Apply our patches
134 cd "${S}" || die "cd failed"
135 EPATCH_SUFFIX="patch" \
136 EPATCH_FORCE="yes" \
137 epatch "${WORKDIR}"/patch
138
139 eautoreconf || die "failed running eautoreconf"
140 }
141
142 src_compile() {
143 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
144 MEXTENSIONS="default,typeaheadfind"
145
146 ####################################
147 #
148 # mozconfig, CFLAGS and CXXFLAGS setup
149 #
150 ####################################
151
152 mozconfig_init
153 mozconfig_config
154
155 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
156 mozconfig_annotate '' --disable-mailnews
157 mozconfig_annotate 'broken' --disable-mochitest
158 mozconfig_annotate 'broken' --disable-crashreporter
159 mozconfig_annotate '' --enable-system-hunspell
160 mozconfig_annotate '' --enable-system-sqlite
161 mozconfig_annotate '' --enable-image-encoder=all
162 mozconfig_annotate '' --enable-canvas
163 mozconfig_annotate '' --with-system-nspr
164 mozconfig_annotate '' --with-system-nss
165 mozconfig_annotate '' --enable-system-lcms
166 mozconfig_annotate '' --enable-oji --enable-mathml
167 mozconfig_annotate 'places' --enable-storage --enable-places --enable-places_bookmarks
168
169 # Other ff-specific settings
170 #mozconfig_use_enable mozdevelop jsd
171 #mozconfig_use_enable mozdevelop xpctools
172 mozconfig_use_extension mozdevelop venkman
173 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
174 if use xulrunner; then
175 # Add xulrunner variable
176 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-1.9
177 fi
178
179 if ! use bindist; then
180 mozconfig_annotate '' --enable-official-branding
181 fi
182
183 # Finalize and report settings
184 mozconfig_final
185
186 # -fstack-protector breaks us
187 if gcc-version ge 4 1; then
188 gcc-specs-ssp && append-flags -fno-stack-protector
189 else
190 gcc-specs-ssp && append-flags -fno-stack-protector-all
191 fi
192 filter-flags -fstack-protector -fstack-protector-all
193
194 ####################################
195 #
196 # Configure and build
197 #
198 ####################################
199
200 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
201 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
202 econf || die
203
204 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
205 # to econf, but the quotes cause configure to fail.
206 sed -i -e \
207 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
208 "${S}"/config/autoconf.mk \
209 "${S}"/toolkit/content/buildconfig.html
210
211 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
212 # requirements while compiling
213 edit_makefiles
214
215 # Should the build use multiprocessing? Not enabled by default, as it tends to break
216 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
217 emake ${jobs} || die
218 }
219
220 pkg_preinst() {
221 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
222
223 einfo "Removing old installs with some really ugly code. It potentially"
224 einfo "eliminates any problems during the install, however suggestions to"
225 einfo "replace this are highly welcome. Send comments and suggestions to"
226 einfo "mozilla@gentoo.org."
227 rm -rf "${ROOT}"${MOZILLA_FIVE_HOME}
228 }
229
230 src_install() {
231 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
232
233 emake DESTDIR="${D}" install || die "emake install failed"
234 rm "${D}"/usr/bin/firefox
235
236 linguas
237 for X in ${linguas}; do
238 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${MY_P}-${X}"
239 done
240
241 use xulrunner && prefs=preferences || prefs=pref
242 cp "${FILESDIR}"/gentoo-default-prefs.js "${D}"${MOZILLA_FIVE_HOME}/defaults/${prefs}/all-gentoo.js
243
244 local LANG=${linguas%% *}
245 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
246 elog "Setting default locale to ${LANG}"
247 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
248 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox.js \
249 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox-l10n.js || \
250 die "sed failed to change locale"
251 fi
252
253 # Install icon and .desktop for menu entry
254 if ! use bindist; then
255 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
256 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
257 mozilla-firefox-3.0.desktop
258 else
259 newicon "${S}"/browser/base/branding/firefox/content/icon48.png firefox-icon-unbranded.png
260 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
261 mozilla-firefox-3.0.desktop
262 fi
263
264 if use xulrunner; then
265 PKG_CONFIG=`which pkg-config`
266 X_DATE=`date +%Y%m%d`
267 XULRUNNER_VERSION=`${PKG_CONFIG} --modversion libxul`
268
269 #set the application.ini
270 sed -i -e "s|BuildID=.*$|BuildID=${X_DATE}GentooMozillaFirefox|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
271 sed -i -e "s|MinVersion=.*$|MinVersion=${XULRUNNER_VERSION}|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
272 sed -i -e "s|MaxVersion=.*$|MaxVersion=${XULRUNNER_VERSION}|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
273 # Create /usr/bin/firefox
274 cat <<EOF >${D}/usr/bin/firefox
275 #!/bin/sh
276 export LD_LIBRARY_PATH="/usr/$(get_libdir)/mozilla-firefox"
277 exec /usr/$(get_libdir)/mozilla-firefox/firefox "\$@"
278 EOF
279 fperms 0755 /usr/bin/firefox
280 else
281 # Create /usr/bin/firefox
282 make_wrapper firefox "${MOZILLA_FIVE_HOME}/firefox"
283 fi
284
285 }
286
287 pkg_postinst() {
288 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
289
290 ewarn "All the packages built against ${PN} won't compile,"
291 ewarn "since they should be built against net-libs/xulrunner,"
292 ewarn "therefore you should check if your package builds against"
293 ewarn "xulrunner and if it doesn't, file a bug, thanks."
294
295 # Update mimedb for the new .desktop file
296 fdo-mime_desktop_database_update
297 }

  ViewVC Help
Powered by ViewVC 1.1.20