Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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