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