Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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