Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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