Magellan Linux

Annotation of /smage/trunk/extras/firefox/firefox-43.0.4-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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