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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20