Magellan Linux

Annotation of /branches/R11-unstable/extras/firefox-esr/firefox-esr-31.4.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23722 - (hide annotations) (download)
Mon Jan 26 13:14:29 2015 UTC (9 years, 3 months ago) by niro
Original Path: trunk/extras/firefox-esr/firefox-esr-31.4.0-r1.smage2
File size: 11364 byte(s)
auto added: ver bump to 31.4.0-r1
1 niro 23722 # $Id$
2    
3     PNAME="firefox-esr"
4     PVER="31.4.0"
5     PBUILD="r1"
6    
7     SPLIT_PACKAGES="firefox-esr firefox-esr-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-libs/dbus-libs-1.8
19     >= dev-libs/dbus-glib-0.102
20     >= dev-libs/icu-54
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.42
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.2
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     >= dev-lang/python-2.7
53     >= media-libs/gstreamer1.0-plugins-base-1.3
54     >= media-sound/libpulse-5"
55    
56     SRCFILE="firefox-${PVER}esr.source.tar.bz2"
57     SRCDIR="${BUILDDIR}/mozilla-esr${PVER%%.*}"
58    
59     sminclude mozilla mtools cleanutils python fdo-mime gtk2
60    
61     SRC_URI=(
62     ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME/-esr/}/releases/${PVER}esr/source/${SRCFILE}
63     mirror://mozilla-firefox/${SRCFILE}
64     mirror://mozilla-firefox/menu/firefox-esr.png
65     mirror://mozilla-firefox/menu/firefox-esr.desktop
66     mirror://mozilla-firefox/firefox-30.0-install-dir-esr.patch
67     )
68    
69     UP2SUBSTITUTE="esr"
70     UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/firefox/releases/latest-esr/source/ | sed 's:[-|.]source::' | lasttarball"
71    
72     split_info_firefox-esr()
73     {
74     DESCRIPTION="Firefox ESR is Mozilla's web browser with an extended support release cycle."
75     DEPEND="${FIREFOX_DEPEND}"
76     PROVIDE="virtual/webbrowser"
77     }
78    
79     split_info_firefox-esr-sdk()
80     {
81     DESCRIPTION="Firefox SDK to build plugins and programs for the ESR version."
82     DEPEND="== net-www/firefox-esr-${PVER}"
83     }
84    
85     export MOZ_PHOENIX=1
86    
87     # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
88     export MOZILLA_CLIENT=1
89     export BUILD_OPT=1
90     export NO_STATIC_LIB=1
91     export USE_PTHREADS=1
92    
93     # now strip optimization from CFLAGS so it doesn't end up in the
94     # compile string
95     export CFLAGS="${CFLAGS/-O*/}"
96     export CXXFLAGS="${CFLAGS}"
97    
98     # needed to build without warnings on gcc-3
99     export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
100    
101     # setup branding
102     # nightly, aurora, official, unofficial, magellan
103     __MOZ_BRANDING="magellan"
104    
105     src_prepare()
106     {
107     munpack ${SRCFILE} || die
108     cd ${SRCDIR}
109    
110     # patches, patches, patches
111    
112     # remove version from mozilla-five-home
113     mpatch firefox-30.0-install-dir-esr.patch || die
114    
115     # use nsbrowser plugin dir
116     # 32bit pathes
117     sed -i "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
118     # 64bit pathes
119     sed -i "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
120    
121     # don't exit with error when some libs are missing which we have in system
122     sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
123    
124     # don't error out when there's no files to be removed
125     sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
126    
127     # create missing python execs on multilib systems
128     if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
129     then
130     sed -i '/^rm -rf _virtualenv/d' configure.in || die
131     sed -i '/^mkdir -p _virtualenv/d' configure.in || die
132    
133     # seems that firefox ignores all chost settings on x86_64:
134     local _mychost="${CHOST}"
135     [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
136    
137     install -d obj-${_mychost}/_virtualenv/bin || die
138     cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
139     cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
140     cp -a /usr/bin/python$(get_python_version)-m32 obj-${_mychost}/_virtualenv/bin || die
141     cp -a /usr/bin/python$(get_python_version)-m64 obj-${_mychost}/_virtualenv/bin || die
142     fi
143    
144     if [[ ${__MOZ_BRANDING} = magellan ]]
145     then
146     cp -R browser/branding/unofficial browser/branding/magellan || die
147     sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \
148     browser/branding/magellan/branding.nsi \
149     browser/branding/magellan/locales/en-US/brand.dtd \
150     browser/branding/magellan/locales/en-US/brand.properties || die
151     fi
152    
153     export WANT_AUTOCONF=2.1
154     autoconf || die
155     }
156    
157     src_compile()
158     {
159     cd ${SRCDIR}
160    
161     # setup .mozconfig
162     cp browser/config/mozconfig .mozconfig || die
163    
164     # setup branding
165     case ${__MOZ_BRANDING} in
166     nightly|aurora|unofficial|magellan)
167     mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
168     ;;
169     official)
170     mozconf_add --enable-official-branding
171     ;;
172     esac
173    
174     # where shall the files go ?
175     mozconf_add --prefix=/usr
176     mozconf_add --libdir=/usr/$(mlibdir)
177     mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox-esr
178    
179     mozconf_add --host="${CHOST}"
180     mozconf_add --build="${CHOST}"
181    
182     # set optimization level based on CFLAGS
183     if [[ ${ARCH} = x86_64 ]]
184     then
185     # opts may cause segfaults on 64bit arches
186     mozconf_add --enable-optimize=-O1
187     export CFLAGS="${CFLAGS} -fPIC"
188     export CXXFLAGS="${CXXFLAGS} -fPIC"
189     else
190     mozconf_add --enable-optimize=-O2
191     fi
192    
193     # enable compat mode for plugins build with gcc2
194     mozconf_add --enable-old-abi-compat-wrappers
195    
196     # we don't need the installer
197     mozconf_add --disable-installer
198    
199     # issue all warnings demanded by strict ANSI C
200     mozconf_add --disable-pedantic
201    
202     # enable crypto support (Personal Security Manager)
203     mozconf_add --enable-crypto
204    
205     # want system jpeg, png, zlib, icu, event, vpx, nspr and nss
206     #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
207     # doesn't work atm
208     #mozconf_add --with-system-png
209     mozconf_add --with-system-zlib
210     mozconf_add --with-system-nspr
211     mozconf_add --with-system-nss
212     mozconf_add --with-system-bz2
213     mozconf_add --enable-system-hunspell
214     mozconf_add --enable-system-sqlite
215     mozconf_add --enable-system-ffi
216     mozconf_add --enable-system-pixman
217     mozconf_add --with-system-icu
218     mozconf_add --enable-intl-api
219     mozconf_add --with-system-libvpx
220    
221     # enable cairo-gtk2 as default
222     mozconf_add --enable-default-toolkit=cairo-gtk2
223    
224     # ipv6 support
225     mozconf_add --enable-ipv6
226    
227     # want xinerama
228     mozconf_add --enable-xinerama
229    
230     # no xprint ?
231     mozconf_add --disable-xprint
232    
233     # >= firefox-1.0.7 should use xft + pango, svg with cairo
234     mozconf_add --disable-freetype2
235     mozconf_add --enable-xft
236     mozconf_add --enable-pango
237     #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
238     mozconf_add --enable-svg
239     mozconf_add --enable-canvas
240    
241     # enable all image encoders
242     mozconf_add --enable-image-encoder=all
243    
244     # disable debug build && enable stripping
245     mozconf_add --disable-debug
246     mozconf_add --disable-tests
247     mozconf_add --enable-reorder
248     mozconf_add --enable-strip
249     mozconf_add --enable-strip-libs
250    
251     if [[ ${ARCH} = i*86 ]]
252     then
253     # optimze build for x86
254     mozconf_add --enable-elf-dynstr-gc
255     fi
256    
257     # both needed to build galeon
258     mozconf_add --enable-oji
259     mozconf_add --enable-mathml
260    
261     # enable storage, places and safe-browsing
262     mozconf_add --enable-storage
263     mozconf_add --enable-places
264     mozconf_add --enable-safe-browsing
265    
266     # enable default extensions
267     mozconf_add --enable-extensions=default
268    
269     # gnome support (needs gnome-vfs)
270     mozconf_add --disable-gnomevfs
271     mozconf_add --enable-extension=-gnomevfs
272    
273     # broken with firefox-3.0.10
274     mozconf_add --disable-mochitest
275     mozconf_add --disable-crashreporter
276    
277     # enable libnotify
278     mozconf_add --enable-libnotify
279     # enable gio
280     mozconf_add --enable-gio
281     # enable startup-notification
282     mozconf_add --enable-startup-notification
283     # enable dbus
284     mozconf_add --enable-dbus
285     # enable webm and libjpeg-turbo format
286     # both needs yasm
287     mozconf_add --enable-webm
288     mozconf_add --enable-libjpeg-turbo
289     # enable libalsa and ogg
290     mozconf_add --enable-ogg
291     mozconf_add --enable-wave
292     # pulseaudio support
293     mozconf_add --enable-pulseaudio
294     # use gstreamer-1.0
295     mozconf_add --enable-gstreamer=1.0
296    
297     # resolve multiple --enable-extensions down to one
298     rebuild_extension_list
299    
300     MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die
301     }
302    
303     src_install_firefox-esr()
304     {
305     cd ${SRCDIR}
306    
307     # install
308     SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
309    
310     # fix permissions
311     mchown -R root:root /usr/$(mlibdir)/firefox-esr || die
312    
313     # init our pref file
314     msetpref --init || die
315    
316     # vendor information
317     msetpref general.useragent.vendor Magellan-Linux || die
318    
319     # disable app.update in default config
320     msetpref app.update.auto false || die
321     msetpref app.update.enabled false || die
322     msetpref app.update.autoInstallEnabled false || die
323    
324     # use system-colors
325     msetpref browser.display.use_system_colors true || die
326     # disable default-browser check
327     msetpref browser.shell.checkDefaultBrowser false || die
328    
329     # use LANG environment variable to choose locale
330     msetpref intl.locale.matchOS true || die
331    
332     # menu entries
333     minstallpixmap firefox-esr.png || die
334     minstalldir /usr/share/applications || die
335     minstallfile -s firefox-esr.desktop /usr/share/applications || die
336    
337     # now move all plugins to /usr/lib/nsbrowser/plugins
338     minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
339     if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox-esr/plugins ]]
340     then
341     mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox-esr/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
342     mdelete -r /usr/$(mlibdir)/firefox-esr/plugins || die
343     fi
344     # and symlink them (we need a defined location for the plugins of all browsers)
345     mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox-esr/plugins || die
346    
347     # rename binary, that an user is able to install firefox and firefox-esr side-by-side
348     mv ${BINDIR}/usr/bin/firefox{,-esr} || die
349    
350     # fix duplicate binary
351     #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
352     mlink firefox-esr /usr/$(mlibdir)/firefox-esr/firefox-bin || die
353    
354     # environment
355     minstalldir /etc/env.d || die
356     MCONFIG="/etc/env.d/90firefox-esr"
357     mclearconfig || die
358     maddconfig "LDPATH=/usr/$(mlibdir)/firefox-esr" || die
359    
360     # remove sdk files
361     mdelete -r /usr/include || die
362     mdelete -r /usr/share/idl || die
363     mdelete -r /usr/$(mlibdir)/firefox-devel-esr || die
364     }
365    
366     src_install_firefox-esr-sdk()
367     {
368     cd ${SRCDIR}
369    
370     SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
371     mchown -R root:root /usr/$(mlibdir)/firefox-esr || die
372    
373     # environment
374     # mozilla-1.7* uses already the env var mozilla_five_home
375     # firefox does not need this, the env var is only to compile
376     # mozilla-based sources
377     minstalldir /etc/env.d || die
378     MCONFIG="/etc/env.d/90firefox-esr-sdk"
379     mclearconfig || die
380     maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox-esr" || die
381     maddconfig "LDPATH=/usr/$(mlibdir)/firefox-esr" || die
382    
383     # keep only sdk files
384     zapmost ${BINDIR} \
385     etc/env.d \
386     usr/include \
387     usr/share/idl \
388     usr/$(mlibdir)/firefox-devel-esr \
389     || die
390     }
391    
392     preinstall_firefox-esr()
393     {
394     # remove old 90mozilla-firefox env-file
395     if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
396     then
397     rm ${MROOT}/etc/env.d/90mozilla-firefox
398     env-rebuild
399     fi
400     }
401    
402     postinstall_firefox()
403     {
404     fdo-mime_update_desktop_db
405     gtk2_update_icon_cache
406     }
407    
408     postremove_firefox()
409     {
410     fdo-mime_update_desktop_db
411     gtk2_update_icon_cache
412     }