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

Contents of /www-client/mozilla-firefox/mozilla-firefox-1.5.0.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Feb 24 14:21:23 2006 UTC (14 years, 9 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
configure fix and linguas fix
(Portage version: 2.1_pre4-r1)

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.1-r1.ebuild,v 1.3 2006/02/23 22:28:07 anarchy 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 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 mn nb-NO nl pa-IN pl pt-BR ro ru sk sl sv-SE tr zh-CN zh-TW"
10 PVER="1.0"
11
12 DESCRIPTION="Firefox Web Browser"
13 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
14 SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}-source.tar.bz2
15 mirror://gentoo/${P}-patches-${PVER}.tar.bz2
16 http://dev.gentoo.org/~anarchy/dist/${P}-patches-${PVER}.tar.bz2"
17
18 for X in ${LANGS} ; do
19 SRC_URI="${SRC_URI} linguas_${X/-/_}? ( mirror://gentoo/firefox-${X}-${PV}.xpi
20 http://dev.gentoo.org/~anarchy/linguas/firefox-${X}-${PV}.xpi )"
21 done
22
23 KEYWORDS="-* ~amd64 ~ppc ~x86"
24 SLOT="0"
25 LICENSE="MPL-1.1 NPL-1.1"
26 IUSE="java mozdevelop"
27
28 RDEPEND="java? ( virtual/jre )
29 >=www-client/mozilla-launcher-1.39
30 >=sys-devel/binutils-2.16.1
31 >=dev-libs/nss-3.10
32 >=dev-libs/nspr-4.6.1"
33
34 DEPEND="${RDEPEND}
35 java? ( >=dev-java/java-config-0.2.0 )"
36
37 S=${WORKDIR}/mozilla
38
39 # Needed by src_compile() and src_install().
40 # Would do in pkg_setup but that loses the export attribute, they
41 # become pure shell variables.
42 export MOZ_CO_PROJECT=browser
43 export BUILD_OFFICIAL=1
44 export MOZILLA_OFFICIAL=1
45
46 linguas() {
47 local LANG
48 for LANG in ${LINGUAS//_/-}; do
49 if hasq ${LANG} ${LANGS} en; then
50 echo -n "${LANG} "
51 fi
52 done
53 }
54
55 src_unpack() {
56 unpack firefox-${PV}-source.tar.bz2 ${P}-patches-${PVER}.tar.bz2
57
58 LINGUAS=$(linguas)
59 for X in ${LINGUAS}; do
60 [[ ${X} != en ]] && xpi_unpack firefox-${X}-${PV}.xpi
61 done
62
63 if ! use alpha; then
64 rm ${WORKDIR}/patch/001_mozilla-1.3-alpha-stubs.patch.bz2
65 fi
66
67 # Apply our patches
68 cd ${S} || die "cd failed"
69 EPATCH_FORCE="yes" epatch ${WORKDIR}/patch
70
71 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
72 # PowerPC, because with that configuration, it detects a ppc64 system.
73 # -- hansmi, 2005-11-13
74 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
75 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
76 ${S}/configure
77 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
78 ${S}/security/coreconf/arch.mk
79 fi
80
81 eautoreconf || die "failed running eautoreconf"
82 }
83
84 src_compile() {
85 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
86
87 ####################################
88 #
89 # mozconfig, CFLAGS and CXXFLAGS setup
90 #
91 ####################################
92
93 mozconfig_init
94 mozconfig_config
95
96 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
97 mozconfig_annotate '' --disable-mailnews
98 #mozconfig_annotate '' --enable-native-uconv
99 mozconfig_annotate '' --enable-image-encoder=all
100 mozconfig_annotate '' --enable-canvas
101 mozconfig_annotate '' --with-system-nspr
102 mozconfig_annotate '' --with-system-nss
103 mozconfig_annotate '' --enable-official-branding
104
105 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
106 # regardless of java setting.
107 mozconfig_annotate '' --enable-oji --enable-mathml
108
109 # Other ff-specific settings
110 mozconfig_use_enable mozdevelop jsd
111 mozconfig_use_enable mozdevelop xpctools
112 mozconfig_use_extension mozdevelop venkman
113 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
114
115 # Finalize and report settings
116 mozconfig_final
117
118 # hardened GCC uses -fstack-protector-all by default, which breaks us
119 has_hardened && append-flags -fno-stack-protector-all
120 # remove -fstack-protector because now it borks firefox
121 CFLAGS=${CFLAGS/-fstack-protector-all/}
122 CFLAGS=${CFLAGS/-fstack-protector/}
123 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
124 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
125
126 append-flags -freorder-blocks -fno-reorder-functions
127
128 ####################################
129 #
130 # Configure and build
131 #
132 ####################################
133
134 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
135 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
136 econf || die
137
138 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
139 # to econf, but the quotes cause configure to fail.
140 sed -i -e \
141 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
142 ${S}/config/autoconf.mk \
143 ${S}/xpfe/global/buildconfig.html
144
145 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
146 # requirements while compiling
147 edit_makefiles
148
149 emake || die
150 }
151
152 pkg_preinst() {
153 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
154
155 echo ""
156 einfo "We are removing old install before we continue. This is to help"
157 einfo "eliminate any problems during the install, sorry for those of you"
158 einfo "who disagree with this but this will ensure a sane build for everyone"
159 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
160 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
161 echo ""
162 }
163
164 src_install() {
165 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
166
167 # Most of the installation happens here
168 dodir ${MOZILLA_FIVE_HOME}
169 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
170
171 LINGUAS=$(linguas)
172 for X in ${LINGUAS}; do
173 [[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
174 done
175
176 local LANG=${LINGUAS%% *}
177 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
178 ebegin "Setting default locale to ${LANG}"
179 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
180 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
181 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
182 eend $? || die "sed failed to change locale"
183 fi
184
185 # Create /usr/bin/firefox
186 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
187
188 # Install icon and .desktop for menu entry
189 doicon ${FILESDIR}/icon/firefox-icon.png
190 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
191
192 # Fix icons to look the same everywhere
193 insinto ${MOZILLA_FIVE_HOME}/icons
194 doins ${S}/dist/branding/mozicon16.xpm
195 doins ${S}/dist/branding/mozicon50.xpm
196
197 ####################################
198 #
199 # Install files necessary for applications to build against firefox
200 #
201 ####################################
202
203 ewarn "Installing includes and idl files..."
204 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
205 cd ${S}/dist
206 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
207 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
208
209 # Dirty hack to get some applications using this header running
210 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
211 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
212
213
214 # Fix pkgconfig files and install them
215 insinto /usr/$(get_libdir)/pkgconfig
216 for x in ${S}/build/unix/*.pc; do
217 doins ${x}
218 done
219
220 ####################################
221 #
222 # Some preferences, probably gentoo.org as start-page also
223 #
224 ####################################
225
226 dodir ${MOZILLA_FIVE_HOME}/greprefs
227 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
228 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
229 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
230
231 # Install docs
232 dodoc LEGAL
233 }
234
235 pkg_postinst() {
236 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
237
238 # This should be called in the postinst and postrm of all the
239 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
240 # thunderbird-bin ebuilds.
241 update_mozilla_launcher_symlinks
242
243 # Update mimedb for the new .desktop file
244 fdo-mime_desktop_database_update
245
246 echo ""
247 ewarn "Please remember to rebuild any packages that you have built"
248 ewarn "against firefox. Some packages might be broken by the upgrade; if this"
249 ewarn "is the case, please search at http://bugs.gentoo.org and open a new bug"
250 ewarn "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
251 ewarn "and test with a clean profile directory."
252 ewarn "Thank you! anarchy@gentoo.org."
253
254 echo ""
255 einfo "Any regchrome errors can be ignored right now, this is due to"
256 einfo "mozilla-firefox-1.0.x. being unregistered with mozilla-launcher."
257
258 epause 15
259 }
260
261 pkg_postrm() {
262 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
263
264 update_mozilla_launcher_symlinks
265 }

  ViewVC Help
Powered by ViewVC 1.1.20