Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 22279 - (show annotations) (download)
Thu Sep 18 11:20:19 2014 UTC (9 years, 9 months ago) by niro
File size: 10550 byte(s)
-fixed broken dependency
1 # $Id$
2
3 PNAME="firefox"
4 PVER="32.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-apps/libdbus-1.8
19 >= dev-libs/dbus-glib-0.102
20 >= dev-libs/icu-50
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.40
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
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
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 # don't exit with error when some libs are missing which we have in system
115 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
116
117 # don't error out when there's no files to be removed
118 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
119
120 # create missing python execs on multilib systems
121 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
122 then
123 sed -i '/^rm -rf _virtualenv/d' configure.in || die
124 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
125
126 # seems that firefox ignores all chost settings on x86_64:
127 local _mychost="${CHOST}"
128 [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
129
130 install -d obj-${_mychost}/_virtualenv/bin || die
131 cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
132 cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
133 cp -a /usr/bin/python$(get_python_version)-m32 obj-${_mychost}/_virtualenv/bin || die
134 cp -a /usr/bin/python$(get_python_version)-m64 obj-${_mychost}/_virtualenv/bin || die
135 fi
136
137 if [[ ${__MOZ_BRANDING} = magellan ]]
138 then
139 cp -R browser/branding/unofficial browser/branding/magellan || die
140 sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \
141 browser/branding/magellan/branding.nsi \
142 browser/branding/magellan/locales/en-US/brand.dtd \
143 browser/branding/magellan/locales/en-US/brand.properties || die
144 fi
145
146 export WANT_AUTOCONF=2.1
147 autoconf || die
148 }
149
150 src_compile()
151 {
152 cd ${SRCDIR}
153
154 # setup .mozconfig
155 cp browser/config/mozconfig .mozconfig || die
156
157 # setup branding
158 case ${__MOZ_BRANDING} in
159 nightly|aurora|unofficial|magellan)
160 mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
161 ;;
162 official)
163 mozconf_add --enable-official-branding
164 ;;
165 esac
166
167 # where shall the files go ?
168 mozconf_add --prefix=/usr
169 mozconf_add --libdir=/usr/$(mlibdir)
170 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
171
172 mozconf_add --host="${CHOST}"
173 mozconf_add --build="${CHOST}"
174
175 # set optimization level based on CFLAGS
176 if [[ ${ARCH} = x86_64 ]]
177 then
178 # opts may cause segfaults on 64bit arches
179 mozconf_add --enable-optimize=-O1
180 export CFLAGS="${CFLAGS} -fPIC"
181 export CXXFLAGS="${CXXFLAGS} -fPIC"
182 else
183 mozconf_add --enable-optimize=-O2
184 fi
185
186 # enable compat mode for plugins build with gcc2
187 mozconf_add --enable-old-abi-compat-wrappers
188
189 # we don't need the installer
190 mozconf_add --disable-installer
191
192 # issue all warnings demanded by strict ANSI C
193 mozconf_add --disable-pedantic
194
195 # enable crypto support (Personal Security Manager)
196 mozconf_add --enable-crypto
197
198 # want system jpeg, png, zlib, icu, event, vpx, nspr and nss
199 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
200 # doesn't work atm
201 #mozconf_add --with-system-png
202 mozconf_add --with-system-zlib
203 mozconf_add --with-system-nspr
204 mozconf_add --with-system-nss
205 mozconf_add --with-system-bz2
206 mozconf_add --enable-system-hunspell
207 mozconf_add --enable-system-sqlite
208 mozconf_add --enable-system-ffi
209 mozconf_add --enable-system-pixman
210 mozconf_add --with-system-icu
211 mozconf_add --enable-intl-api
212 mozconf_add --with-system-libvpx
213
214 # enable cairo-gtk2 as default
215 mozconf_add --enable-default-toolkit=cairo-gtk2
216
217 # ipv6 support
218 mozconf_add --enable-ipv6
219
220 # want xinerama
221 mozconf_add --enable-xinerama
222
223 # no xprint ?
224 mozconf_add --disable-xprint
225
226 # >= firefox-1.0.7 should use xft + pango, svg with cairo
227 mozconf_add --disable-freetype2
228 mozconf_add --enable-xft
229 mozconf_add --enable-pango
230 #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
231 mozconf_add --enable-svg
232 mozconf_add --enable-canvas
233
234 # enable all image encoders
235 mozconf_add --enable-image-encoder=all
236
237 # disable debug build && enable stripping
238 mozconf_add --disable-debug
239 mozconf_add --disable-tests
240 mozconf_add --enable-reorder
241 mozconf_add --enable-strip
242 mozconf_add --enable-strip-libs
243
244 if [[ ${ARCH} = i*86 ]]
245 then
246 # optimze build for x86
247 mozconf_add --enable-elf-dynstr-gc
248 fi
249
250 # both needed to build galeon
251 mozconf_add --enable-oji
252 mozconf_add --enable-mathml
253
254 # enable storage, places and safe-browsing
255 mozconf_add --enable-storage
256 mozconf_add --enable-places
257 mozconf_add --enable-safe-browsing
258
259 # enable default extensions
260 mozconf_add --enable-extensions=default
261
262 # gnome support (needs gnome-vfs)
263 mozconf_add --disable-gnomevfs
264 mozconf_add --enable-extension=-gnomevfs
265
266 # broken with firefox-3.0.10
267 mozconf_add --disable-mochitest
268 mozconf_add --disable-crashreporter
269
270 # enable libnotify
271 mozconf_add --enable-libnotify
272 # enable gio
273 mozconf_add --enable-gio
274 # enable startup-notification
275 mozconf_add --enable-startup-notification
276 # enable dbus
277 mozconf_add --enable-dbus
278 # enable webm and libjpeg-turbo format
279 # both needs yasm
280 mozconf_add --enable-webm
281 mozconf_add --enable-libjpeg-turbo
282 # enable libalsa and ogg
283 mozconf_add --enable-ogg
284 mozconf_add --enable-wave
285 # pulseaudio support
286 mozconf_add --enable-pulseaudio
287 # use gstreamer-1.0
288 mozconf_add --enable-gstreamer=1.0
289
290 # resolve multiple --enable-extensions down to one
291 rebuild_extension_list
292
293 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die
294 }
295
296 src_install_firefox()
297 {
298 cd ${SRCDIR}
299
300 # install
301 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
302
303 # fix permissions
304 mchown -R root:root /usr/$(mlibdir)/firefox || die
305
306 # init our pref file
307 msetpref --init || die
308
309 # vendor information
310 msetpref general.useragent.vendor Magellan-Linux || die
311
312 # disable app.update in default config
313 msetpref app.update.auto false || die
314 msetpref app.update.enabled false || die
315 msetpref app.update.autoInstallEnabled false || die
316
317 # use system-colors
318 msetpref browser.display.use_system_colors true || die
319 # disable default-browser check
320 msetpref browser.shell.checkDefaultBrowser false || die
321
322 # use LANG environment variable to choose locale
323 msetpref intl.locale.matchOS true || die
324
325 # menu entries
326 minstallpixmap firefox.png || die
327 minstalldir /usr/share/applications || die
328 minstallfile -s firefox.desktop /usr/share/applications || die
329
330 # now move all plugins to /usr/lib/nsbrowser/plugins
331 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
332 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
333 then
334 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
335 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
336 fi
337 # and symlink them (we need a defined location for the plugins of all browsers)
338 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
339
340 # fix duplicate binary
341 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
342 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
343
344 # environment
345 minstalldir /etc/env.d || die
346 MCONFIG="/etc/env.d/90firefox"
347 mclearconfig || die
348 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
349
350 # remove sdk files
351 mdelete -r /usr/include || die
352 mdelete -r /usr/share/idl || die
353 mdelete -r /usr/$(mlibdir)/firefox-devel || die
354 }
355
356 src_install_firefox-sdk()
357 {
358 cd ${SRCDIR}
359
360 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
361 mchown -R root:root /usr/$(mlibdir)/firefox || die
362
363 # environment
364 # mozilla-1.7* uses already the env var mozilla_five_home
365 # firefox does not need this, the env var is only to compile
366 # mozilla-based sources
367 minstalldir /etc/env.d || die
368 MCONFIG="/etc/env.d/90firefox-sdk"
369 mclearconfig || die
370 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
371 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
372
373 # keep only sdk files
374 zapmost ${BINDIR} \
375 etc/env.d \
376 usr/include \
377 usr/share/idl \
378 usr/$(mlibdir)/firefox-devel \
379 || die
380 }
381
382 preinstall_firefox()
383 {
384 # remove old 90mozilla-firefox env-file
385 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
386 then
387 rm ${MROOT}/etc/env.d/90mozilla-firefox
388 env-rebuild
389 fi
390 }