Magellan Linux

Contents of /smage/branches/alx07x-unstable/extras/firefox/firefox-30.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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