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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Apr 19 14:55:36 2008 UTC (12 years, 7 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
We need pango built with X use-flag bug #216377, fix linguas, bug #218147
(Portage version: 2.1.5_rc4)

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

  ViewVC Help
Powered by ViewVC 1.1.20