Magellan Linux

Contents of /trunk/extras/firefox/firefox-53.0.3-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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