Magellan Linux

Contents of /trunk/extras/firefox-esr/firefox-esr-38.1.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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