Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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