Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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