Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8427 - (show annotations) (download)
Tue Jan 26 13:32:39 2016 UTC (8 years, 4 months ago) by niro
File size: 11495 byte(s)
-disable --as-needed
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 # fix issues with --as-needed enabled
179 export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"
180
181 # setup .mozconfig
182 cp browser/config/mozconfig .mozconfig || die
183
184 # setup branding
185 case ${__MOZ_BRANDING} in
186 nightly|aurora|unofficial|magellan)
187 mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
188 ;;
189 official)
190 mozconf_add --enable-official-branding
191 ;;
192 esac
193
194 # where shall the files go ?
195 mozconf_add --prefix=/usr
196 mozconf_add --libdir=/usr/$(mlibdir)
197 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
198
199 mozconf_add --host="${CHOST}"
200 mozconf_add --build="${CHOST}"
201
202 # set optimization level based on CFLAGS
203 if [[ ${ARCH} = x86_64 ]]
204 then
205 # opts may cause segfaults on 64bit arches
206 mozconf_add --enable-optimize=-O1
207 export CFLAGS="${CFLAGS} -fPIC"
208 export CXXFLAGS="${CXXFLAGS} -fPIC"
209 else
210 mozconf_add --enable-optimize=-O2
211 fi
212
213 # enable compat mode for plugins build with gcc2
214 mozconf_add --enable-old-abi-compat-wrappers
215
216 # we don't need the installer
217 mozconf_add --disable-installer
218
219 # issue all warnings demanded by strict ANSI C
220 mozconf_add --disable-pedantic
221
222 # enable crypto support (Personal Security Manager)
223 mozconf_add --enable-crypto
224
225 # want system jpeg, pngm, zlib, nspr and nss
226 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
227 # doesn't work atm
228 #mozconf_add --with-system-png
229 mozconf_add --with-system-zlib
230 mozconf_add --with-system-nspr
231 mozconf_add --with-system-nss
232 mozconf_add --with-system-bz2
233 #mozconf_add --enable-system-hunspell
234 mozconf_add --enable-system-sqlite
235 mozconf_add --enable-system-ffi
236 mozconf_add --enable-system-pixman
237 mozconf_add --with-system-icu
238 mozconf_add --enable-intl-api
239
240 # enable cairo-gtk2 as default
241 mozconf_add --enable-default-toolkit=cairo-gtk2
242
243 # ipv6 support
244 mozconf_add --enable-ipv6
245
246 # want xinerama
247 mozconf_add --enable-xinerama
248
249 # no xprint ?
250 mozconf_add --disable-xprint
251
252 # >= firefox-1.0.7 should use xft + pango, svg with cairo
253 mozconf_add --disable-freetype2
254 mozconf_add --enable-xft
255 mozconf_add --enable-pango
256 #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
257 mozconf_add --enable-svg
258 mozconf_add --enable-canvas
259
260 # enable all image encoders
261 mozconf_add --enable-image-encoder=all
262
263 # disable debug build && enable stripping
264 mozconf_add --disable-debug
265 mozconf_add --disable-tests
266 mozconf_add --enable-reorder
267 mozconf_add --enable-strip
268 mozconf_add --enable-strip-libs
269
270 if [[ ${ARCH} = i*86 ]]
271 then
272 # optimze build for x86
273 mozconf_add --enable-elf-dynstr-gc
274 fi
275
276 # both needed to build galeon
277 mozconf_add --enable-oji
278 mozconf_add --enable-mathml
279
280 # enable storage, places and safe-browsing
281 mozconf_add --enable-storage
282 mozconf_add --enable-places
283 mozconf_add --enable-safe-browsing
284
285 # enable default extensions
286 mozconf_add --enable-extensions=default
287
288 # disable gconf
289 mozconf_add --disable-gconf
290 # disable gnome
291 mozconf_add --disable-gnomeui
292 # gnome support (needs gnome-vfs)
293 mozconf_add --disable-gnomevfs
294 mozconf_add --enable-extension=-gnomevfs
295
296 # broken with firefox-3.0.10
297 mozconf_add --disable-mochitest
298 mozconf_add --disable-crashreporter
299
300 # enable libnotify
301 mozconf_add --enable-libnotify
302 # enable gio
303 mozconf_add --enable-gio
304 # enable startup-notification
305 #mozconf_add --enable-startup-notification
306 # enable dbus
307 mozconf_add --enable-dbus
308 # enable webm and libjpeg-turbo format
309 # both needs yasm
310 mozconf_add --enable-webm
311 mozconf_add --enable-libjpeg-turbo
312 # enable libalsa and ogg
313 mozconf_add --enable-ogg
314 mozconf_add --enable-wave
315 mozconf_add --disable-pulseaudio
316 mozconf_add --disable-gstreamer
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 }