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

Contents of /www-client/mozilla-firefox/mozilla-firefox-2.0_rc2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Tue Oct 17 06:22:42 2006 UTC (14 years, 1 month ago) by genstef
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
version bump, s/xform/xforms/
(Portage version: 2.1.2_pre3-r2)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 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-2.0_rc2.ebuild,v 1.9 2006/10/16 21:34:33 genstef Exp $
4
5 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
6
7 PATCH="mozilla-firefox-2.0_rc1-patches-1.4"
8 LANGS="ar be bg ca cs da de el en-GB es-AR es-ES eu fi fy-NL fr ga-IE gu-IN hu it ja ko
9 lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ru sk sl sv-SE tr zh-CN zh-TW"
10 NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"
11 MY_PV=${PV/_}
12
13 DESCRIPTION="Firefox Web Browser"
14 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
15
16 KEYWORDS="~alpha ~amd64 ~sparc ~x86"
17 SLOT="0"
18 LICENSE="MPL-1.1 NPL-1.1"
19 IUSE="java mozdevelop branding xform"
20
21 MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}"
22 SRC_URI="${MOZ_URI}/source/firefox-${MY_PV}-source.tar.bz2
23 http://gentooexperimental.org/~genstef/dist/${PATCH}.tar.bz2"
24
25 # These are in
26 #
27 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/linux-i686/xpi/
28 #
29 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
30 for X in ${LANGS} ; do
31 SRC_URI="${SRC_URI}
32 linguas_${X/-/_}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
33 IUSE="${IUSE} linguas_${X/-/_}"
34 # english is handled internally
35 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
36 SRC_URI="${SRC_URI}
37 linguas_${X%%-*}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
38 IUSE="${IUSE} linguas_${X%%-*}"
39 fi
40 done
41
42 RDEPEND="java? ( virtual/jre )
43 >=www-client/mozilla-launcher-1.39
44 >=sys-devel/binutils-2.16.1
45 >=dev-libs/nss-3.11.1-r1
46 >=dev-libs/nspr-4.6.1
47 ~sys-devel/autoconf-2.13"
48
49 DEPEND="${RDEPEND}
50 java? ( >=dev-java/java-config-0.2.0 )"
51
52 S="${WORKDIR}/mozilla"
53
54 linguas() {
55 local LANG SLANG
56 for LANG in ${LINGUAS}; do
57 if has ${LANG} en en_US; then
58 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
59 continue
60 elif has ${LANG} ${LANGS//-/_}; then
61 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
62 continue
63 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
64 for X in ${LANGS}; do
65 if [[ "${X}" == "${LANG}-"* ]] && \
66 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
67 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
68 continue 2
69 fi
70 done
71 fi
72 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
73 done
74 einfo "Selected language packs (first will be default): $linguas"
75 }
76
77 pkg_setup(){
78 if use branding; then
79 einfo "You are enabling official branding. You may not redistribute this build"
80 einfo "to any users on your network or the internet. Doing so puts yourself into"
81 einfo "a legal problem with mozilla foundation"
82 fi
83 }
84
85 src_unpack() {
86 unpack ${A%bz2*}bz2
87
88 linguas
89 for X in ${linguas}; do
90 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
91 done
92
93 cd "${S}"
94
95 # Apply our patches
96 EPATCH_FORCE="yes" epatch "${WORKDIR}"/patch
97
98 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
99 # PowerPC, because with that configuration, it detects a ppc64 system.
100 # -- hansmi, 2005-11-13
101 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
102 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
103 "${S}"/configure
104 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
105 "${S}"/security/coreconf/arch.mk
106 fi
107
108 WANT_AUTOCONF="2.1" eautoreconf
109 }
110
111 src_compile() {
112 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
113
114 mozconfig_init
115 mozconfig_config
116
117 mozconfig_annotate '' --enable-application=browser
118 mozconfig_annotate '' --enable-image-encoder=all
119 mozconfig_annotate '' --enable-canvas
120 mozconfig_annotate '' --with-system-nspr
121 mozconfig_annotate '' --with-system-nss
122
123 if use xform; then
124 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validatalidation,typeaheadfind
125 else
126 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
127 fi
128
129 if use branding; then
130 mozconfig_annotate '' --enable-official-branding
131 fi
132
133 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
134 # regardless of java setting.
135 mozconfig_annotate '' --enable-oji --enable-mathml
136
137 # Other ff-specific settings
138 mozconfig_use_enable mozdevelop jsd
139 mozconfig_use_enable mozdevelop xpctools
140 mozconfig_use_extension mozdevelop venkman
141 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
142
143 # Add build variables
144 mozconfig_build_opts
145
146 # Finalize and report settings
147 mozconfig_final
148
149 # -fstack-protector breaks us
150 if gcc-version ge 4 1; then
151 gcc-specs-ssp && append-flags -fno-stack-protector
152 else
153 gcc-specs-ssp && append-flags -fno-stack-protector-all
154 fi
155 filter-flags -fstack-protector -fstack-protector-all
156
157 ####################################
158 #
159 # Configure and build
160 #
161 ####################################
162
163 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
164 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
165 econf || die
166
167 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
168 # to econf, but the quotes cause configure to fail.
169 sed -i -e \
170 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
171 ${S}/config/autoconf.mk \
172 ${S}/xpfe/global/buildconfig.html
173
174 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
175 # requirements while compiling
176 edit_makefiles
177
178 emake || die
179 }
180
181 pkg_preinst() {
182 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
183
184 einfo "Removing old install to eliminate any problems during install."
185 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
186 }
187
188 src_install() {
189 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
190
191 # Most of the installation happens here
192 dodir "${MOZILLA_FIVE_HOME}"
193 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
194
195 linguas
196 for X in ${linguas}; do
197 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
198 done
199
200 local LANG=${linguas%% *}
201 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
202 einfo "Setting default locale to ${LANG}"
203 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
204 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
205 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
206 die "sed failed to change locale"
207 fi
208
209 # Create /usr/bin/firefox
210 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
211
212 # Install icon and .desktop for menu entry
213 doicon "${FILESDIR}"/icon/firefox-icon.png
214 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5.desktop \
215 mozillafirefox-2.0.desktop
216
217 # Fix icons to look the same everywhere
218 insinto "${MOZILLA_FIVE_HOME}"/icons
219 doins "${S}"/dist/branding/mozicon16.xpm
220 doins "${S}"/dist/branding/mozicon50.xpm
221
222
223 # Install files necessary for applications to build against firefox
224 einfo "Installing includes and idl files..."
225 dodir "${MOZILLA_FIVE_HOME}"/idl "${MOZILLA_FIVE_HOME}"/include
226 cp -LfR "${S}"/dist/include/* "${D}"/"${MOZILLA_FIVE_HOME}"/include/ || \
227 die "cp failed"
228 cp -LfR "${S}"/dist/idl/* "${D}"/"${MOZILLA_FIVE_HOME}"/idl || \
229 die "cp failed"
230
231 # Dirty hack to get some applications using this header running
232 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
233 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
234
235 # Install pkgconfig files
236 insinto /usr/"$(get_libdir)"/pkgconfig
237 doins "${S}"/build/unix/*.pc
238
239 insinto "${MOZILLA_FIVE_HOME}"/greprefs
240 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
241 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
242 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
243 }
244
245 pkg_postinst() {
246 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
247
248 # This should be called in the postinst and postrm of all the
249 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
250 # thunderbird-bin ebuilds.
251 update_mozilla_launcher_symlinks
252
253 # Update mimedb for the new .desktop file
254 fdo-mime_desktop_database_update
255
256 elog "Please remember to rebuild any packages that you have built"
257 elog "against firefox. Some packages might be broken by the upgrade; if this"
258 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
259 elog "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
260 elog "and test with a clean profile directory."
261 }
262
263 pkg_postrm() {
264 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
265
266 update_mozilla_launcher_symlinks
267 }

  ViewVC Help
Powered by ViewVC 1.1.20