Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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