Magellan Linux

Contents of /trunk/extras/firefox/firefox-32.0.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22277 - (show annotations) (download)
Thu Sep 18 09:06:42 2014 UTC (9 years, 9 months ago) by niro
File size: 10508 byte(s)
-no need to fix curl-headers
1 # $Id$
2
3 PNAME="firefox"
4 PVER="32.0.1"
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/libdbus-1.8
19 >= dev-libs/dbus-glib-0.102
20 >= dev-libs/icu-50
21 >= media-libs/fontconfig-2.11
22 >= media-libs/libjpeg-8
23 >= media-libs/libpng-1.5
24 >= media-libs/alsa-lib-1.0.28
25 >= media-libs/libogg-1.3
26 >=media-libs/libvpx-1.3
27 >= dev-libs/glib2-2.40
28 >= dev-libs/libidl-0.8.14
29 >= app-arch/unzip-6
30 >= x11-libs/pango-1.36
31 >= x11-libs/cairo-1.12
32 >= x11-libs/gtk2+-2.24
33 >= x11-libs/libnotify-0.7
34 >= dev-libs/nspr-4.10.7
35 >= dev-libs/nss-3.17
36 >= media-fonts/corefonts-2
37 >= app-text/hunspell-1.3
38 >= dev-db/sqlite-3.8
39 >= dev-libs/libffi-3.1
40 >= x11-libs/startup-notification-0.12
41 >= x11-libs/pixman-0.32"
42
43 SDEPEND="${FIREFOX_DEPEND}
44 >= x11-proto/xineramaproto-1
45 >= x11-proto/compositeproto-0.4
46 >= dev-util/pkgconfig-0.25
47 >= sys-dev/autoconf-5
48 >= sys-dev/automake-4
49 >= virtual/sed
50 >= app-arch/zip-3
51 >= dev-lang/yasm-1.3
52 >= media-libs/gstreamer1.0-plugins-base-1.3
53 >= media-sound/libpulse-5"
54
55 SRCFILE="firefox-${PVER}.source.tar.bz2"
56 SRCDIR="${BUILDDIR}/mozilla-release"
57
58 sminclude mozilla mtools cleanutils python
59
60 SRC_URI=(
61 ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/${PVER}/source/${SRCFILE}
62 mirror://mozilla-firefox/${SRCFILE}
63 mirror://mozilla-firefox/menu/firefox.png
64 mirror://mozilla-firefox/menu/firefox.desktop
65 mirror://mozilla-firefox/${PNAME}-30.0-install-dir.patch
66 )
67
68 UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/latest/source | sed 's:[-|.]source::' | lasttarball"
69
70 split_info_firefox()
71 {
72 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
73 DEPEND="${FIREFOX_DEPEND}"
74 PROVIDE="virtual/webbrowser"
75 }
76
77 split_info_firefox-sdk()
78 {
79 DESCRIPTION="Firefox SDK to build plugins and programs."
80 DEPEND="== net-www/firefox-${PVER}"
81 }
82
83 export MOZ_PHOENIX=1
84
85 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
86 export MOZILLA_CLIENT=1
87 export BUILD_OPT=1
88 export NO_STATIC_LIB=1
89 export USE_PTHREADS=1
90
91 # now strip optimization from CFLAGS so it doesn't end up in the
92 # compile string
93 export CFLAGS="${CFLAGS/-O*/}"
94 export CXXFLAGS="${CFLAGS}"
95
96 # needed to build without warnings on gcc-3
97 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
98
99 # setup branding
100 # nightly, aurora, official, unofficial, magellan
101 __MOZ_BRANDING="magellan"
102
103 src_prepare()
104 {
105 munpack ${SRCFILE} || die
106 cd ${SRCDIR}
107
108 # patches, patches, patches
109
110 # remove version from mozilla-five-home
111 mpatch ${PNAME}-30.0-install-dir.patch || die
112
113 # don't exit with error when some libs are missing which we have in system
114 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
115
116 # don't error out when there's no files to be removed
117 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
118
119 # create missing python execs on multilib systems
120 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
121 then
122 sed -i '/^rm -rf _virtualenv/d' configure.in || die
123 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
124
125 # seems that firefox ignores all chost settings on x86_64:
126 local _mychost="${CHOST}"
127 [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
128
129 install -d obj-${_mychost}/_virtualenv/bin || die
130 cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
131 cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
132 cp -a /usr/bin/python$(get_python_version)-m32 obj-${_mychost}/_virtualenv/bin || die
133 cp -a /usr/bin/python$(get_python_version)-m64 obj-${_mychost}/_virtualenv/bin || die
134 fi
135
136 if [[ ${__MOZ_BRANDING} = magellan ]]
137 then
138 cp -R browser/branding/unofficial browser/branding/magellan || die
139 sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \
140 browser/branding/magellan/branding.nsi \
141 browser/branding/magellan/locales/en-US/brand.dtd \
142 browser/branding/magellan/locales/en-US/brand.properties || die
143 fi
144
145 export WANT_AUTOCONF=2.1
146 autoconf || die
147 }
148
149 src_compile()
150 {
151 cd ${SRCDIR}
152
153 # setup .mozconfig
154 cp browser/config/mozconfig .mozconfig || die
155
156 # setup branding
157 case ${__MOZ_BRANDING} in
158 nightly|aurora|unofficial|magellan)
159 mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
160 ;;
161 official)
162 mozconf_add --enable-official-branding
163 ;;
164 esac
165
166 # where shall the files go ?
167 mozconf_add --prefix=/usr
168 mozconf_add --libdir=/usr/$(mlibdir)
169 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
170
171 mozconf_add --host="${CHOST}"
172 mozconf_add --build="${CHOST}"
173
174 # set optimization level based on CFLAGS
175 if [[ ${ARCH} = x86_64 ]]
176 then
177 # opts may cause segfaults on 64bit arches
178 mozconf_add --enable-optimize=-O1
179 export CFLAGS="${CFLAGS} -fPIC"
180 export CXXFLAGS="${CXXFLAGS} -fPIC"
181 else
182 mozconf_add --enable-optimize=-O2
183 fi
184
185 # enable compat mode for plugins build with gcc2
186 mozconf_add --enable-old-abi-compat-wrappers
187
188 # we don't need the installer
189 mozconf_add --disable-installer
190
191 # issue all warnings demanded by strict ANSI C
192 mozconf_add --disable-pedantic
193
194 # enable crypto support (Personal Security Manager)
195 mozconf_add --enable-crypto
196
197 # want system jpeg, png, zlib, icu, event, vpx, nspr and nss
198 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
199 # doesn't work atm
200 #mozconf_add --with-system-png
201 mozconf_add --with-system-zlib
202 mozconf_add --with-system-nspr
203 mozconf_add --with-system-nss
204 mozconf_add --with-system-bz2
205 mozconf_add --enable-system-hunspell
206 mozconf_add --enable-system-sqlite
207 mozconf_add --enable-system-ffi
208 mozconf_add --enable-system-pixman
209 mozconf_add --with-system-icu
210 mozconf_add --enable-intl-api
211 mozconf_add --with-system-libvpx
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 # pulseaudio support
285 mozconf_add --enable-pulseaudio
286 # use gstreamer-1.0
287 mozconf_add --enable-gstreamer=1.0
288
289 # resolve multiple --enable-extensions down to one
290 rebuild_extension_list
291
292 MOZ_MAKE_FLAGS="${MAKEOPTS}" mmake -f client.mk || die
293 }
294
295 src_install_firefox()
296 {
297 cd ${SRCDIR}
298
299 # install
300 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
301
302 # fix permissions
303 mchown -R root:root /usr/$(mlibdir)/firefox || die
304
305 # init our pref file
306 msetpref --init || die
307
308 # vendor information
309 msetpref general.useragent.vendor Magellan-Linux || die
310
311 # disable app.update in default config
312 msetpref app.update.auto false || die
313 msetpref app.update.enabled false || die
314 msetpref app.update.autoInstallEnabled false || die
315
316 # use system-colors
317 msetpref browser.display.use_system_colors true || die
318 # disable default-browser check
319 msetpref browser.shell.checkDefaultBrowser false || die
320
321 # use LANG environment variable to choose locale
322 msetpref intl.locale.matchOS true || die
323
324 # menu entries
325 minstallpixmap firefox.png || die
326 minstalldir /usr/share/applications || die
327 minstallfile -s firefox.desktop /usr/share/applications || die
328
329 # now move all plugins to /usr/lib/nsbrowser/plugins
330 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
331 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
332 then
333 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
334 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
335 fi
336 # and symlink them (we need a defined location for the plugins of all browsers)
337 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
338
339 # fix duplicate binary
340 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
341 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
342
343 # environment
344 minstalldir /etc/env.d || die
345 MCONFIG="/etc/env.d/90firefox"
346 mclearconfig || die
347 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
348
349 # remove sdk files
350 mdelete -r /usr/include || die
351 mdelete -r /usr/share/idl || die
352 mdelete -r /usr/$(mlibdir)/firefox-devel || die
353 }
354
355 src_install_firefox-sdk()
356 {
357 cd ${SRCDIR}
358
359 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
360 mchown -R root:root /usr/$(mlibdir)/firefox || die
361
362 # environment
363 # mozilla-1.7* uses already the env var mozilla_five_home
364 # firefox does not need this, the env var is only to compile
365 # mozilla-based sources
366 minstalldir /etc/env.d || die
367 MCONFIG="/etc/env.d/90firefox-sdk"
368 mclearconfig || die
369 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
370 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
371
372 # keep only sdk files
373 zapmost ${BINDIR} \
374 etc/env.d \
375 usr/include \
376 usr/share/idl \
377 usr/$(mlibdir)/firefox-devel \
378 || die
379 }
380
381 preinstall_firefox()
382 {
383 # remove old 90mozilla-firefox env-file
384 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
385 then
386 rm ${MROOT}/etc/env.d/90mozilla-firefox
387 env-rebuild
388 fi
389 }