Magellan Linux

Contents of /smage/trunk/extras/firefox/firefox-19.0.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4699 - (show annotations) (download)
Tue Mar 26 15:26:07 2013 UTC (11 years, 1 month ago) by niro
File size: 10444 byte(s)
-disabled system-bz2, only busybox on system not full bz2 sources
1 # $Id$
2
3 PNAME="firefox"
4 PVER="19.0.2"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="firefox firefox-sdk"
8
9 PCAT="net-www"
10 HOMEPAGE="http://www.mozilla.org/products/firefox/"
11
12 FIREFOX_DEPEND=">= x11-libs/libXrender-0.9
13 >= x11-libs/libXcomposite-0.4
14 >= x11-libs/libXt-1
15 >= x11-libs/libXmu-1
16 >= dev-libs/expat-2
17 >= sys-libs/zlib-1.2
18 >= sys-apps/dbus-1.6
19 >= dev-libs/dbus-glib-0.100
20 >= media-libs/fontconfig-2.10
21 >= media-libs/libjpeg-8
22 >= media-libs/libpng-1.5
23 >= media-libs/alsa-lib-1.0.26
24 >= media-libs/libogg-1.3
25 >= dev-libs/glib2-2.34
26 >= dev-libs/libidl-0.8.14
27 >= app-arch/unzip-6
28 >= x11-libs/pango-1.32
29 >= x11-libs/cairo-1.12
30 >= x11-libs/gtk2+-2.24
31 >= x11-libs/libnotify-0.7
32 >= dev-libs/nspr-4.9
33 >= dev-libs/nss-3.14
34 >= media-fonts/corefonts-2
35 >= app-text/hunspell-1.3
36 >= dev-db/sqlite-3.7
37 >= dev-libs/libffi-3
38 >= x11-libs/startup-notification-0.12
39 >= x11-libs/pixman-0.28"
40
41 SDEPEND="${FIREFOX_DEPEND}
42 >= x11-proto/xineramaproto-1
43 >= x11-proto/compositeproto-0.4
44 >= dev-util/pkgconfig-0.25
45 >= sys-dev/autoconf-5
46 >= sys-dev/automake-4
47 >= virtual/sed
48 >= app-arch/zip-3
49 >= dev-lang/yasm-1.2"
50
51 SRCFILE="firefox-${PVER}.source.tar.bz2"
52 SRCDIR="${BUILDDIR}/mozilla-release"
53
54 sminclude mozilla mtools cleanutils python
55
56 SRC_URI=(
57 ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/${PVER}/source/${SRCFILE}
58 mirror://mozilla-firefox/${SRCFILE}
59 mirror://mozilla-firefox/menu/firefox.png
60 mirror://mozilla-firefox/menu/firefox.desktop
61 mirror://mozilla-firefox/${PNAME}-18.0-install-dir.patch
62 )
63
64 UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/latest/source | sed 's:[-|.]source::' | lasttarball"
65
66 split_info_firefox()
67 {
68 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
69 DEPEND="${FIREFOX_DEPEND}"
70 PROVIDE="virtual/webbrowser"
71 }
72
73 split_info_firefox-sdk()
74 {
75 DESCRIPTION="Firefox SDK to build plugins and programs."
76 DEPEND="== net-www/firefox-${PVER}"
77 }
78
79 export MOZ_PHOENIX=1
80
81 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
82 export MOZILLA_CLIENT=1
83 export BUILD_OPT=1
84 export NO_STATIC_LIB=1
85 export USE_PTHREADS=1
86
87 # now strip optimization from CFLAGS so it doesn't end up in the
88 # compile string
89 export CFLAGS="${CFLAGS/-O*/}"
90 export CXXFLAGS="${CFLAGS}"
91
92 # needed to build without warnings on gcc-3
93 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
94
95 # setup branding
96 # nightly, aurora, official, unofficial, magellan
97 __MOZ_BRANDING="magellan"
98
99 src_prepare()
100 {
101 munpack ${SRCFILE} || die
102 cd ${SRCDIR}
103
104 # patches, patches, patches
105
106 # remove version from mozilla-five-home
107 mpatch ${PNAME}-18.0-install-dir.patch || die
108
109 # fix newer curl-headers
110 sed -i '/#include <curl\/types.h>/d' \
111 toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
112 toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
113 config/system-headers \
114 js/src/config/system-headers || die
115
116 # don't exit with error when some libs are missing which we have in system
117 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
118
119 # don't error out when there's no files to be removed
120 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
121
122 # create missing python execs on multilib systems
123 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
124 then
125 sed -i '/^rm -rf _virtualenv/d' configure.in || die
126 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
127
128 # seems that firefox ignores all chost settings on x86_64:
129 local _mychost="${CHOST}"
130 [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
131
132 install -d obj-${_mychost}/_virtualenv/bin || die
133 cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
134 cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
135 cp -a /usr/bin/python$(get_python_version)-m32 obj-${_mychost}/_virtualenv/bin || die
136 cp -a /usr/bin/python$(get_python_version)-m64 obj-${_mychost}/_virtualenv/bin || die
137 fi
138
139 if [[ ${__MOZ_BRANDING} = magellan ]]
140 then
141 cp -R browser/branding/unofficial browser/branding/magellan || die
142 sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \
143 browser/branding/magellan/branding.nsi \
144 browser/branding/magellan/locales/en-US/brand.dtd \
145 browser/branding/magellan/locales/en-US/brand.properties || die
146 fi
147
148 export WANT_AUTOCONF=2.1
149 autoconf || die
150 }
151
152 src_compile()
153 {
154 cd ${SRCDIR}
155
156 # setup .mozconfig
157 cp browser/config/mozconfig .mozconfig || die
158
159 # setup branding
160 case ${__MOZ_BRANDING} in
161 nightly|aurora|unofficial|magellan)
162 mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
163 ;;
164 official)
165 mozconf_add --enable-official-branding
166 ;;
167 esac
168
169 # where shall the files go ?
170 mozconf_add --prefix=/usr
171 mozconf_add --libdir=/usr/$(mlibdir)
172 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
173
174 mozconf_add --host="${CHOST}"
175 mozconf_add --build="${CHOST}"
176
177 # set optimization level based on CFLAGS
178 if [[ ${ARCH} = x86_64 ]]
179 then
180 # opts may cause segfaults on 64bit arches
181 mozconf_add --enable-optimize=-O1
182 export CFLAGS="${CFLAGS} -fPIC"
183 export CXXFLAGS="${CXXFLAGS} -fPIC"
184 else
185 mozconf_add --enable-optimize=-O2
186 fi
187
188 # enable compat mode for plugins build with gcc2
189 mozconf_add --enable-old-abi-compat-wrappers
190
191 # we don't need the installer
192 mozconf_add --disable-installer
193
194 # issue all warnings demanded by strict ANSI C
195 mozconf_add --disable-pedantic
196
197 # enable crypto support (Personal Security Manager)
198 mozconf_add --enable-crypto
199
200 # want system jpeg, pngm, zlib, nspr and nss
201 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
202 # doesn't work atm
203 #mozconf_add --with-system-png
204 mozconf_add --with-system-zlib
205 mozconf_add --with-system-nspr
206 mozconf_add --with-system-nss
207 #mozconf_add --with-system-bz2
208 #mozconf_add --enable-system-hunspell
209 mozconf_add --enable-system-sqlite
210 mozconf_add --enable-system-ffi
211 mozconf_add --enable-system-pixman
212
213 # enable cairo-gtk2 as default
214 mozconf_add --enable-default-toolkit=cairo-gtk2
215
216 # ipv6 support
217 mozconf_add --enable-ipv6
218
219 # want xinerama
220 mozconf_add --enable-xinerama
221
222 # no xprint ?
223 mozconf_add --disable-xprint
224
225 # >= firefox-1.0.7 should use xft + pango, svg with cairo
226 mozconf_add --disable-freetype2
227 mozconf_add --enable-xft
228 mozconf_add --enable-pango
229 #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
230 mozconf_add --enable-svg
231 mozconf_add --enable-canvas
232
233 # enable all image encoders
234 mozconf_add --enable-image-encoder=all
235
236 # disable debug build && enable stripping
237 mozconf_add --disable-debug
238 mozconf_add --disable-tests
239 mozconf_add --enable-reorder
240 mozconf_add --enable-strip
241 mozconf_add --enable-strip-libs
242
243 if [[ ${ARCH} = i*86 ]]
244 then
245 # optimze build for x86
246 mozconf_add --enable-elf-dynstr-gc
247 fi
248
249 # both needed to build galeon
250 mozconf_add --enable-oji
251 mozconf_add --enable-mathml
252
253 # enable storage, places and safe-browsing
254 mozconf_add --enable-storage
255 mozconf_add --enable-places
256 mozconf_add --enable-safe-browsing
257
258 # enable default extensions
259 mozconf_add --enable-extensions=default
260
261 # gnome support (needs gnome-vfs)
262 mozconf_add --disable-gnomevfs
263 mozconf_add --enable-extension=-gnomevfs
264
265 # broken with firefox-3.0.10
266 mozconf_add --disable-mochitest
267 mozconf_add --disable-crashreporter
268
269 # enable libnotify
270 mozconf_add --enable-libnotify
271 # enable gio
272 mozconf_add --enable-gio
273 # enable startup-notification
274 #mozconf_add --enable-startup-notification
275 # enable dbus
276 mozconf_add --enable-dbus
277 # enable webm and libjpeg-turbo format
278 # both needs yasm
279 mozconf_add --enable-webm
280 mozconf_add --enable-libjpeg-turbo
281 # enable libalsa and ogg
282 mozconf_add --enable-ogg
283 mozconf_add --enable-wave
284
285 # resolve multiple --enable-extensions down to one
286 rebuild_extension_list
287
288 MOZ_MAKE_FLAGS="${MAKEOPTS}" mmake -f client.mk || die
289 }
290
291 src_install_firefox()
292 {
293 cd ${SRCDIR}
294
295 # install
296 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
297
298 # fix permissions
299 mchown -R root:root /usr/$(mlibdir)/firefox || die
300
301 # init our pref file
302 msetpref --init || die
303
304 # vendor information
305 msetpref general.useragent.vendor Magellan-Linux || die
306
307 # disable app.update in default config
308 msetpref app.update.auto false || die
309 msetpref app.update.enabled false || die
310 msetpref app.update.autoInstallEnabled false || die
311
312 # use system-colors
313 msetpref browser.display.use_system_colors true || die
314 # disable default-browser check
315 msetpref browser.shell.checkDefaultBrowser false || die
316
317 # use LANG environment variable to choose locale
318 msetpref intl.locale.matchOS true || die
319
320 # menu entries
321 minstallpixmap firefox.png || die
322 minstalldir /usr/share/applications || die
323 minstallfile -s firefox.desktop /usr/share/applications || die
324
325 # now move all plugins to /usr/lib/nsbrowser/plugins
326 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
327 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
328 then
329 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
330 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
331 fi
332 # and symlink them (we need a defined location for the plugins of all browsers)
333 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
334
335 # fix missing binary
336 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
337 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
338
339 # environment
340 minstalldir /etc/env.d || die
341 MCONFIG="/etc/env.d/90firefox"
342 mclearconfig || die
343 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
344
345 # remove sdk files
346 mdelete -r /usr/include || die
347 mdelete -r /usr/share/idl || die
348 mdelete -r /usr/$(mlibdir)/firefox-devel || die
349 }
350
351 src_install_firefox-sdk()
352 {
353 cd ${SRCDIR}
354
355 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
356 mchown -R root:root /usr/$(mlibdir)/firefox || die
357
358 # environment
359 # mozilla-1.7* uses already the env var mozilla_five_home
360 # firefox does not need this, the env var is only to compile
361 # mozilla-based sources
362 minstalldir /etc/env.d || die
363 MCONFIG="/etc/env.d/90firefox-sdk"
364 mclearconfig || die
365 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
366 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
367
368 # keep only sdk files
369 zapmost ${BINDIR} \
370 etc/env.d \
371 usr/include \
372 usr/share/idl \
373 usr/$(mlibdir)/firefox-devel \
374 || die
375 }
376
377 preinstall_firefox()
378 {
379 # remove old 90mozilla-firefox env-file
380 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
381 then
382 rm ${MROOT}/etc/env.d/90mozilla-firefox
383 env-rebuild
384 fi
385 }