Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8423 - (hide annotations) (download)
Mon Jan 25 15:47:55 2016 UTC (8 years, 4 months ago) by niro
File size: 11351 byte(s)
-disable gold linker
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 niro 8423 # disable gold linker
209     mozconf_add --disable-gold
210    
211 niro 8408 # enable compat mode for plugins build with gcc2
212     mozconf_add --enable-old-abi-compat-wrappers
213    
214     # we don't need the installer
215     mozconf_add --disable-installer
216    
217     # issue all warnings demanded by strict ANSI C
218     mozconf_add --disable-pedantic
219    
220     # enable crypto support (Personal Security Manager)
221     mozconf_add --enable-crypto
222    
223     # want system jpeg, pngm, zlib, nspr and nss
224     #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
225     # doesn't work atm
226     #mozconf_add --with-system-png
227     mozconf_add --with-system-zlib
228     mozconf_add --with-system-nspr
229     mozconf_add --with-system-nss
230     mozconf_add --with-system-bz2
231     #mozconf_add --enable-system-hunspell
232     mozconf_add --enable-system-sqlite
233     mozconf_add --enable-system-ffi
234     mozconf_add --enable-system-pixman
235    
236 niro 8418 # enable cairo-gtk2 as default
237     mozconf_add --enable-default-toolkit=cairo-gtk2
238 niro 8408
239     # ipv6 support
240     mozconf_add --enable-ipv6
241    
242     # want xinerama
243     mozconf_add --enable-xinerama
244    
245     # no xprint ?
246     mozconf_add --disable-xprint
247    
248     # >= firefox-1.0.7 should use xft + pango, svg with cairo
249     mozconf_add --disable-freetype2
250     mozconf_add --enable-xft
251     mozconf_add --enable-pango
252     #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
253     mozconf_add --enable-svg
254     mozconf_add --enable-canvas
255    
256     # enable all image encoders
257     mozconf_add --enable-image-encoder=all
258    
259     # disable debug build && enable stripping
260     mozconf_add --disable-debug
261     mozconf_add --disable-tests
262     mozconf_add --enable-reorder
263     mozconf_add --enable-strip
264     mozconf_add --enable-strip-libs
265    
266     if [[ ${ARCH} = i*86 ]]
267     then
268     # optimze build for x86
269     mozconf_add --enable-elf-dynstr-gc
270     fi
271    
272     # both needed to build galeon
273     mozconf_add --enable-oji
274     mozconf_add --enable-mathml
275    
276     # enable storage, places and safe-browsing
277     mozconf_add --enable-storage
278     mozconf_add --enable-places
279     mozconf_add --enable-safe-browsing
280    
281     # enable default extensions
282     mozconf_add --enable-extensions=default
283    
284 niro 8419 # disable gconf
285     mozconf_add --disable-gconf
286 niro 8420 # disable gnome
287     mozconf_add --disable-gnomeui
288 niro 8408 # gnome support (needs gnome-vfs)
289     mozconf_add --disable-gnomevfs
290     mozconf_add --enable-extension=-gnomevfs
291    
292     # broken with firefox-3.0.10
293     mozconf_add --disable-mochitest
294     mozconf_add --disable-crashreporter
295    
296     # enable libnotify
297     mozconf_add --enable-libnotify
298     # enable gio
299     mozconf_add --enable-gio
300     # enable startup-notification
301     #mozconf_add --enable-startup-notification
302     # enable dbus
303     mozconf_add --enable-dbus
304     # enable webm and libjpeg-turbo format
305     # both needs yasm
306     mozconf_add --enable-webm
307     mozconf_add --enable-libjpeg-turbo
308     # enable libalsa and ogg
309     mozconf_add --enable-ogg
310     mozconf_add --enable-wave
311 niro 8420 mozconf_add --disable-pulseaudio
312 niro 8408 mozconf_add --disable-gstreamer
313    
314     # resolve multiple --enable-extensions down to one
315     rebuild_extension_list
316    
317 niro 8417 # shell export fixes some bugs in a chroot environment
318     # see: http://comments.gmane.org/gmane.linux.lfs.beyond.support/47450
319     MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die
320 niro 8408 }
321    
322     src_install_firefox()
323     {
324     cd ${SRCDIR}
325    
326     # install
327 niro 8417 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
328 niro 8408
329     # fix permissions
330     mchown -R root:root /usr/$(mlibdir)/firefox || die
331    
332     # init our pref file
333     msetpref --init || die
334    
335     # vendor information
336     msetpref general.useragent.vendor Magellan-Linux || die
337    
338     # disable app.update in default config
339     msetpref app.update.auto false || die
340     msetpref app.update.enabled false || die
341     msetpref app.update.autoInstallEnabled false || die
342    
343     # use system-colors
344     msetpref browser.display.use_system_colors true || die
345     # disable default-browser check
346     msetpref browser.shell.checkDefaultBrowser false || die
347    
348     # use LANG environment variable to choose locale
349     msetpref intl.locale.matchOS true || die
350    
351     # menu entries
352     minstallpixmap firefox.png || die
353     minstalldir /usr/share/applications || die
354     minstallfile -s firefox.desktop /usr/share/applications || die
355    
356     # now move all plugins to /usr/lib/nsbrowser/plugins
357     minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
358     if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
359     then
360     mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
361     mdelete -r /usr/$(mlibdir)/firefox/plugins || die
362     fi
363     # and symlink them (we need a defined location for the plugins of all browsers)
364     mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
365    
366 niro 8417 # fix duplicate binary
367 niro 8408 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
368     mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
369    
370     # environment
371     minstalldir /etc/env.d || die
372     MCONFIG="/etc/env.d/90firefox"
373     mclearconfig || die
374     maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
375    
376     # remove sdk files
377     mdelete -r /usr/include || die
378     mdelete -r /usr/share/idl || die
379     mdelete -r /usr/$(mlibdir)/firefox-devel || die
380     }
381    
382     src_install_firefox-sdk()
383     {
384     cd ${SRCDIR}
385    
386 niro 8417 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
387 niro 8408 mchown -R root:root /usr/$(mlibdir)/firefox || die
388    
389     # environment
390     # mozilla-1.7* uses already the env var mozilla_five_home
391     # firefox does not need this, the env var is only to compile
392     # mozilla-based sources
393     minstalldir /etc/env.d || die
394     MCONFIG="/etc/env.d/90firefox-sdk"
395     mclearconfig || die
396     maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
397     maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
398    
399     # keep only sdk files
400     zapmost ${BINDIR} \
401     etc/env.d \
402     usr/include \
403     usr/share/idl \
404     usr/$(mlibdir)/firefox-devel \
405     || die
406     }
407    
408     preinstall_firefox()
409     {
410     # remove old 90mozilla-firefox env-file
411     if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
412     then
413     rm ${MROOT}/etc/env.d/90mozilla-firefox
414     env-rebuild
415     fi
416     }