Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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