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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20