Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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