Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 28378 - (show annotations) (download)
Wed Aug 24 08:12:51 2016 UTC (7 years, 9 months ago) by niro
File size: 11825 byte(s)
-revert commit r28377
1 # $Id$
2
3 PNAME="firefox"
4 PVER="46.0.1"
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.104
20 >= dev-libs/icu-57.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.5
27 >= dev-libs/glib2-2.48
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/gtk2+-2.24
33 >= x11-libs/gtk3+-3.18
34 >= x11-libs/libnotify-0.7
35 >= dev-libs/nspr-4.12
36 >= dev-libs/nss-3.24
37 >= media-fonts/corefonts-2
38 >= app-text/hunspell-1.3
39 >= dev-db/sqlite-3.12
40 >= dev-libs/libffi-3.2
41 >= x11-libs/startup-notification-0.12
42 >= x11-libs/pixman-0.34
43 >= sys-libs/libatomic-6.1
44 >= sys-libs/libgcc-6.1
45 >= sys-libs/libstdc++-6.1"
46
47 SDEPEND="${FIREFOX_DEPEND}
48 >= x11-proto/xineramaproto-1
49 >= x11-proto/compositeproto-0.4
50 >= dev-util/pkgconfig-0.25
51 >= sys-dev/autoconf-5
52 >= sys-dev/automake-4
53 >= virtual/sed
54 >= app-arch/zip-3
55 >= dev-lang/yasm-1.3
56 >= dev-lang/python-2.7
57 >= media-libs/gstreamer1.0-plugins-base-1.8
58 >= media-sound/libpulse-7"
59
60 SRCFILE="${PNAME}-${PVER}.source.tar.xz"
61 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
62
63 sminclude mozilla mtools cleanutils python fdo-mime gtk2
64
65 SRC_URI=(
66 http://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/${PVER}/source/${SRCFILE}
67 mirror://mozilla-firefox/${SRCFILE}
68 mirror://mozilla-firefox/menu/firefox.png
69 mirror://mozilla-firefox/menu/firefox.desktop
70 mirror://mozilla-firefox/${PNAME}-46.0.1-install-dir.patch
71 mirror://mozilla-firefox/${PNAME}-46.0.1-gcc61.patch
72 )
73
74 # grep -v 'b' = exclude betas
75 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"
76
77 split_info_firefox()
78 {
79 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
80 DEPEND="${FIREFOX_DEPEND}"
81 PROVIDE="virtual/webbrowser"
82 }
83
84 split_info_firefox-sdk()
85 {
86 DESCRIPTION="Firefox SDK to build plugins and programs."
87 DEPEND="== net-www/firefox-${PVER}"
88 }
89
90 export MOZ_PHOENIX=1
91
92 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
93 export MOZILLA_CLIENT=1
94 export BUILD_OPT=1
95 export NO_STATIC_LIB=1
96 export USE_PTHREADS=1
97
98 # now strip optimization from CFLAGS so it doesn't end up in the
99 # compile string
100 export CFLAGS="${CFLAGS/-O*/}"
101 export CXXFLAGS="${CFLAGS}"
102
103 # needed to build without warnings on gcc-3
104 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
105
106 # enforce pic and pie
107 export CFLAGS="${CFLAGS} -fPIC -pie"
108 export CXXFLAGS="${CXXFLAGS} -fPIC -pie"
109
110 # setup branding
111 # nightly, aurora, official, unofficial, magellan
112 __MOZ_BRANDING="magellan"
113
114 src_prepare()
115 {
116 munpack ${SRCFILE} || die
117 cd ${SRCDIR}
118
119 # patches, patches, patches
120
121 # remove version from mozilla-five-home
122 mpatch ${PNAME}-46.0.1-install-dir.patch || die
123 # fix build with gcc-6.1
124 mpatch ${PNAME}-46.0.1-gcc61.patch || die
125
126 # use nsbrowser plugin dir
127 # 32bit pathes
128 sed -i "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
129 # 64bit pathes
130 sed -i "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
131
132 # don't exit with error when some libs are missing which we have in system
133 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
134
135 # don't error out when there's no files to be removed
136 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
137
138 # create missing python execs on multilib systems
139 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
140 then
141 sed -i '/^rm -rf _virtualenv/d' configure.in || die
142 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
143
144 # seems that firefox ignores all chost settings on x86_64:
145 local _mychost="${CHOST}"
146 [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
147
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 # fix issues with --as-needed enabled
173 #export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
174
175 # fix issues with missing -latomic
176 #export LDFLAGS+=" -latomic"
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, png, zlib, icu, event, vpx, 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 mozconf_add --with-system-libvpx
237
238 # enable cairo-gtk3 as default
239 mozconf_add --enable-default-toolkit=cairo-gtk3
240
241 # ipv6 support
242 mozconf_add --enable-ipv6
243
244 # want xinerama
245 mozconf_add --enable-xinerama
246
247 # no xprint ?
248 mozconf_add --disable-xprint
249
250 # >= firefox-1.0.7 should use xft + pango, svg with cairo
251 mozconf_add --disable-freetype2
252 mozconf_add --enable-xft
253 mozconf_add --enable-pango
254 #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
255 mozconf_add --enable-svg
256 mozconf_add --enable-canvas
257
258 # enable all image encoders
259 mozconf_add --enable-image-encoder=all
260
261 # disable debug build && enable stripping
262 mozconf_add --disable-debug
263 mozconf_add --disable-tests
264 mozconf_add --enable-reorder
265 mozconf_add --enable-strip
266 mozconf_add --enable-strip-libs
267
268 if [[ ${ARCH} = i*86 ]]
269 then
270 # optimze build for x86
271 mozconf_add --enable-elf-dynstr-gc
272 fi
273
274 # both needed to build galeon
275 mozconf_add --enable-oji
276 mozconf_add --enable-mathml
277
278 # enable storage, places and safe-browsing
279 mozconf_add --enable-storage
280 mozconf_add --enable-places
281 mozconf_add --enable-safe-browsing
282
283 # enable default extensions
284 mozconf_add --enable-extensions=default
285
286 # disable gconf
287 mozconf_add --disable-gconf
288 # disable gnome
289 mozconf_add --disable-gnomeui
290 # gnome support (needs gnome-vfs)
291 mozconf_add --disable-gnomevfs
292 mozconf_add --enable-extension=-gnomevfs
293
294 # broken with firefox-3.0.10
295 mozconf_add --disable-mochitest
296 mozconf_add --disable-crashreporter
297
298 # enable libnotify
299 mozconf_add --enable-libnotify
300 # enable gio
301 mozconf_add --enable-gio
302 # enable startup-notification
303 mozconf_add --enable-startup-notification
304 # enable dbus
305 mozconf_add --enable-dbus
306 # enable webm and libjpeg-turbo format
307 # both needs yasm
308 mozconf_add --enable-webm
309 mozconf_add --enable-libjpeg-turbo
310 # enable libalsa and ogg
311 mozconf_add --enable-ogg
312 mozconf_add --enable-wave
313 # pulseaudio support
314 mozconf_add --enable-pulseaudio
315 # use gstreamer-1.0
316 mozconf_add --enable-gstreamer=1.0
317
318 # resolve multiple --enable-extensions down to one
319 rebuild_extension_list
320
321 # shell export fixes some bugs in a chroot environment
322 # see: http://comments.gmane.org/gmane.linux.lfs.beyond.support/47450
323 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die
324 }
325
326 src_install_firefox()
327 {
328 cd ${SRCDIR}
329
330 # install
331 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
332
333 # fix permissions
334 mchown -R root:root /usr/$(mlibdir)/firefox || die
335
336 # init our pref file
337 msetpref --init || die
338
339 # vendor information
340 msetpref general.useragent.vendor Magellan-Linux || die
341
342 # disable app.update in default config
343 msetpref app.update.auto false || die
344 msetpref app.update.enabled false || die
345 msetpref app.update.autoInstallEnabled false || die
346
347 # use system-colors
348 msetpref browser.display.use_system_colors true || die
349 # disable default-browser check
350 msetpref browser.shell.checkDefaultBrowser false || die
351
352 # use LANG environment variable to choose locale
353 msetpref intl.locale.matchOS true || die
354
355 # menu entries
356 minstallpixmap firefox.png || die
357 minstalldir /usr/share/applications || die
358 minstallfile -s firefox.desktop /usr/share/applications || die
359
360 # now move all plugins to /usr/lib/nsbrowser/plugins
361 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
362 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
363 then
364 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
365 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
366 fi
367 # and symlink them (we need a defined location for the plugins of all browsers)
368 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
369
370 # fix duplicate binary
371 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
372 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
373
374 # environment
375 minstalldir /etc/env.d || die
376 MCONFIG="/etc/env.d/90firefox"
377 mclearconfig || die
378 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
379
380 # remove sdk files
381 mdelete -r /usr/include || die
382 mdelete -r /usr/share/idl || die
383 mdelete -r /usr/$(mlibdir)/firefox-devel || die
384 }
385
386 src_install_firefox-sdk()
387 {
388 cd ${SRCDIR}
389
390 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
391 mchown -R root:root /usr/$(mlibdir)/firefox || die
392
393 # environment
394 # mozilla-1.7* uses already the env var mozilla_five_home
395 # firefox does not need this, the env var is only to compile
396 # mozilla-based sources
397 minstalldir /etc/env.d || die
398 MCONFIG="/etc/env.d/90firefox-sdk"
399 mclearconfig || die
400 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
401 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
402
403 # keep only sdk files
404 zapmost ${BINDIR} \
405 etc/env.d \
406 usr/include \
407 usr/share/idl \
408 usr/$(mlibdir)/firefox-devel \
409 || die
410 }
411
412 preinstall_firefox()
413 {
414 # remove old 90mozilla-firefox env-file
415 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
416 then
417 rm ${MROOT}/etc/env.d/90mozilla-firefox
418 env-rebuild
419 fi
420 }
421
422 postinstall_firefox()
423 {
424 fdo-mime_update_desktop_db
425 gtk2_update_icon_cache
426 }
427
428 postremove_firefox()
429 {
430 fdo-mime_update_desktop_db
431 gtk2_update_icon_cache
432 }