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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (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.4: +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.ebuild,v 1.4 2006/02/06 14:18:58 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
104 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
105 # regardless of java setting.
106 mozconfig_annotate '' --enable-oji --enable-mathml
107
108 # Other ff-specific settings
109 mozconfig_use_enable mozdevelop jsd
110 mozconfig_use_enable mozdevelop xpctools
111 mozconfig_use_extension mozdevelop venkman
112 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
113
114 # Finalize and report settings
115 mozconfig_final
116
117 # hardened GCC uses -fstack-protector-all by default, which breaks us
118 has_hardened && append-flags -fno-stack-protector-all
119 # remove -fstack-protector because now it borks firefox
120 CFLAGS=${CFLAGS/-fstack-protector-all/}
121 CFLAGS=${CFLAGS/-fstack-protector/}
122 CXXFLAGS=${CXXFLAGS/-fstack-protector-all/}
123 CXXFLAGS=${CXXFLAGS/-fstack-protector/}
124
125 append-flags -freorder-blocks -fno-reorder-functions
126
127 ####################################
128 #
129 # Configure and build
130 #
131 ####################################
132
133 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
134 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
135 econf || die
136
137 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
138 # to econf, but the quotes cause configure to fail.
139 sed -i -e \
140 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
141 ${S}/config/autoconf.mk \
142 ${S}/xpfe/global/buildconfig.html
143
144 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
145 # requirements while compiling
146 edit_makefiles
147
148 emake || die
149 }
150
151 pkg_preinst() {
152 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
153
154 echo ""
155 einfo "We are removing old install before we continue. This is to help"
156 einfo "eliminate any problems during the install, sorry for those of you"
157 einfo "who disagree with this but this will ensure a sane build for everyone"
158 einfo "Comments and suggestion should be addressed to mozilla@gentoo.org"
159 rm -rf ${ROOT}${MOZILLA_FIVE_HOME}
160 echo ""
161 }
162
163 src_install() {
164 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
165
166 # Most of the installation happens here
167 dodir ${MOZILLA_FIVE_HOME}
168 cp -RL ${S}/dist/bin/* ${D}${MOZILLA_FIVE_HOME}
169
170 LINGUAS=$(linguas)
171 for X in ${LINGUAS}; do
172 [[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
173 done
174
175 local LANG=${LINGUAS%% *}
176 if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
177 ebegin "Setting default locale to ${LANG}"
178 sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
179 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
180 ${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
181 eend $? || die "sed failed to change locale"
182 fi
183
184 # Create /usr/bin/firefox
185 install_mozilla_launcher_stub firefox ${MOZILLA_FIVE_HOME}
186
187 # Install icon and .desktop for menu entry
188 doicon ${FILESDIR}/icon/firefox-icon.png
189 domenu ${FILESDIR}/icon/mozillafirefox-1.5.desktop
190
191 # Fix icons to look the same everywhere
192 insinto ${MOZILLA_FIVE_HOME}/icons
193 doins ${S}/dist/branding/mozicon16.xpm
194 doins ${S}/dist/branding/mozicon50.xpm
195
196 ####################################
197 #
198 # Install files necessary for applications to build against firefox
199 #
200 ####################################
201
202 ewarn "Installing includes and idl files..."
203 dodir ${MOZILLA_FIVE_HOME}/idl ${MOZILLA_FIVE_HOME}/include
204 cd ${S}/dist
205 cp -LfR include/* ${D}${MOZILLA_FIVE_HOME}/include || die "failed to copy"
206 cp -LfR idl/* ${D}${MOZILLA_FIVE_HOME}/idl || die "failed to copy"
207
208 # Dirty hack to get some applications using this header running
209 dosym ${MOZILLA_FIVE_HOME}/include/necko/nsIURI.h \
210 /usr/$(get_libdir)/${MOZILLA_FIVE_HOME##*/}/include/nsIURI.h
211
212
213 # Fix pkgconfig files and install them
214 insinto /usr/$(get_libdir)/pkgconfig
215 for x in ${S}/build/unix/*.pc; do
216 doins ${x}
217 done
218
219 ####################################
220 #
221 # Some preferences, probably gentoo.org as start-page also
222 #
223 ####################################
224
225 dodir ${MOZILLA_FIVE_HOME}/greprefs
226 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/greprefs/all-gentoo.js
227 dodir ${MOZILLA_FIVE_HOME}/defaults/pref
228 cp ${FILESDIR}/gentoo-default-prefs.js ${D}/${MOZILLA_FIVE_HOME}/defaults/pref/all-gentoo.js
229
230 # Install docs
231 dodoc LEGAL
232 }
233
234 pkg_postinst() {
235 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
236
237 # This should be called in the postinst and postrm of all the
238 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
239 # thunderbird-bin ebuilds.
240 update_mozilla_launcher_symlinks
241
242 # Update mimedb for the new .desktop file
243 fdo-mime_desktop_database_update
244
245 echo ""
246 ewarn "Please remember to rebuild any packages that you have built"
247 ewarn "against firefox. Some packages might be busted please search"
248 ewarn "http://bugs.gentoo.org if no bug is open, then please open a new"
249 ewarn "bug report so these can be fixed. Before filling bugs make sure you"
250 ewarn "have moved $HOME/.mozilla our of way and tested with clean profile."
251 ewarn "Thank you! anarchy@gentoo.org."
252
253 echo ""
254 einfo "I am unable to brand firefox or thunderbird officially yet."
255 einfo "You will see that everything says Deer Park cause of this."
256
257 epause 15
258 }
259
260 pkg_postrm() {
261 declare MOZILLA_FIVE_HOME=/usr/$(get_libdir)/${PN}
262
263 update_mozilla_launcher_symlinks
264 }

  ViewVC Help
Powered by ViewVC 1.1.20