Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29107 - (show annotations) (download)
Tue May 23 09:32:06 2017 UTC (7 years, 4 months ago) by niro
File size: 10317 byte(s)
-require hunspell-1.6 and fixed descriptions
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/libvpx-1.6
26 >= dev-libs/glib2-2.52
27 >= dev-libs/libidl-0.8.14
28 >= app-arch/unzip-6
29 >= x11-libs/pango-1.40
30 >= x11-libs/cairo-1.14
31 >= x11-libs/gtk2+-2.24
32 >= x11-libs/gtk3+-3.22
33 >= dev-libs/nspr-4.14
34 >= dev-libs/nss-3.30
35 >= media-fonts/corefonts-2
36 >= app-text/hunspell-1.6
37 >= dev-db/sqlite-3.18
38 >= dev-libs/libffi-3.2
39 >= x11-libs/startup-notification-0.12
40 >= x11-libs/pixman-0.34"
41
42 SDEPEND="${FIREFOX_DEPEND}
43 >= x11-proto/xineramaproto-1
44 >= x11-proto/compositeproto-0.4
45 >= dev-util/pkgconfig-0.25
46 >= sys-dev/autoconf-5
47 >= sys-dev/automake-4
48 >= virtual/sed
49 >= app-arch/zip-3
50 >= dev-lang/yasm-1.3
51 >= dev-lang/python-2.7
52 >= media-sound/libpulse-10"
53
54 SRCFILE="firefox-${PVER}.source.tar.xz"
55 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
56
57 sminclude mozilla mtools cleanutils python fdo-mime gtk2
58
59 SRC_URI=(
60 http://ftp.mozilla.org/pub/${PNAME}/releases/${PVER}/source/${SRCFILE}
61 mirror://mozilla-firefox/${SRCFILE}
62 mirror://mozilla-firefox/menu/firefox.png
63 mirror://mozilla-firefox/menu/firefox.desktop
64 mirror://mozilla-firefox/${PNAME}-46.0.1-install-dir.patch
65 mirror://mozilla-firefox/${PNAME}-53.0.3-networkmanager18.patch
66 mirror://mozilla-firefox/${PNAME}-53.0.3-dont-try-to-build-mp4parse-bindings.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 # fix build against newer networkmanager
120 # see: https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
121 mpatch ${PNAME}-53.0.3-networkmanager18.patch || die
122
123 # do not build mp4parse bindings which is time consuming
124 # and this fixed 'can't find crate for `cheddar`' errors too
125 mpatch ${PNAME}-53.0.3-dont-try-to-build-mp4parse-bindings.patch || die
126
127 # use nsbrowser plugin dir
128 # 32bit pathes
129 sed -i "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
130 # 64bit pathes
131 sed -i "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die
132
133 # don't exit with error when some libs are missing which we have in system
134 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
135
136 # don't error out when there's no files to be removed
137 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
138
139 # create missing python execs on multilib systems
140 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
141 then
142 sed -i '/^rm -rf _virtualenv/d' configure.in || die
143 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
144
145 local _mychost="${CHOST}"
146 install -d obj-${_mychost}/_virtualenv/bin || die
147 cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
148 cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
149 cp -a /usr/bin/python$(mget-python-version)-m32 obj-${_mychost}/_virtualenv/bin || die
150 cp -a /usr/bin/python$(mget-python-version)-m64 obj-${_mychost}/_virtualenv/bin || die
151 fi
152
153 if [[ ${__MOZ_BRANDING} = magellan ]]
154 then
155 cp -R browser/branding/unofficial browser/branding/magellan || die
156 sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \
157 browser/branding/magellan/branding.nsi \
158 browser/branding/magellan/locales/en-US/brand.dtd \
159 browser/branding/magellan/locales/en-US/brand.properties || die
160 fi
161
162 export WANT_AUTOCONF=2.1
163 autoconf || die
164 }
165
166 src_compile()
167 {
168 cd ${SRCDIR}
169
170 # setup .mozconfig
171 cp browser/config/mozconfig .mozconfig || die
172
173 # setup branding
174 case ${__MOZ_BRANDING} in
175 nightly|aurora|unofficial|magellan)
176 mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING}
177 ;;
178 official)
179 mozconf_add --enable-official-branding
180 ;;
181 esac
182
183 # where shall the files go ?
184 mozconf_add --prefix=/usr
185 mozconf_add --libdir=/usr/$(mlibdir)
186 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
187
188 # mozilla uses --host instead of --build and --target instead of host
189 mozconf_add --host="${CHOST}"
190 mozconf_add --target="${CHOST}"
191
192 # set optimization level based on CFLAGS
193 if [[ ${ARCH} = x86_64 ]]
194 then
195 # opts may cause segfaults on 64bit arches
196 mozconf_add --enable-optimize=-O1
197 export CFLAGS="${CFLAGS} -fPIC"
198 export CXXFLAGS="${CXXFLAGS} -fPIC"
199 else
200 mozconf_add --enable-optimize=-O2
201 fi
202
203 # want system jpeg, png, zlib, icu, event, vpx, nspr and nss
204 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
205 # system png is missing apng support
206 #mozconf_add --with-system-png
207 mozconf_add --with-system-zlib
208 mozconf_add --with-system-nspr
209 mozconf_add --with-system-nss
210 mozconf_add --with-system-bz2
211 mozconf_add --enable-system-hunspell
212 mozconf_add --enable-system-sqlite
213 mozconf_add --enable-system-ffi
214 mozconf_add --enable-system-pixman
215 mozconf_add --with-system-icu
216 mozconf_add --enable-intl-api
217 mozconf_add --with-system-libvpx
218 mozconf_add --enable-system-cairo
219
220 # enable cairo-gtk3 as default
221 mozconf_add --enable-default-toolkit=cairo-gtk3
222
223 # disable debug build && enable stripping
224 mozconf_add --disable-debug
225 mozconf_add --disable-tests
226 mozconf_add --enable-strip
227
228 # enable safe-browsing
229 mozconf_add --enable-safe-browsing
230
231 # enable default extensions
232 mozconf_add --enable-extensions=default
233
234 # no crashreporter
235 mozconf_add --disable-crashreporter
236
237 # enable gio
238 mozconf_add --enable-gio
239 # disable gnome support
240 mozconf_add --disable-gnomeui
241 mozconf_add --disable-gconf
242 # enable startup-notification
243 mozconf_add --enable-startup-notification
244 # enable dbus
245 mozconf_add --enable-dbus
246 # enable libjpeg-turbo format
247 # needs yasm
248 mozconf_add --enable-libjpeg-turbo
249 # pulseaudio support
250 mozconf_add --enable-pulseaudio
251
252 # no rust support, developers only
253 mozconf_add --disable-rust
254
255 # resolve multiple --enable-extensions down to one
256 rebuild_extension_list
257
258 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die
259 }
260
261 src_install_firefox()
262 {
263 cd ${SRCDIR}
264
265 # install
266 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
267
268 # fix permissions
269 mchown -R root:root /usr/$(mlibdir)/firefox || die
270
271 # init our pref file
272 msetpref --init || die
273
274 # vendor information
275 msetpref general.useragent.vendor Magellan-Linux || die
276
277 # disable app.update in default config
278 msetpref app.update.auto false || die
279 msetpref app.update.enabled false || die
280 msetpref app.update.autoInstallEnabled false || die
281
282 # use system-colors
283 msetpref browser.display.use_system_colors true || die
284 # disable default-browser check
285 msetpref browser.shell.checkDefaultBrowser false || die
286
287 # use LANG environment variable to choose locale
288 msetpref intl.locale.matchOS true || die
289
290 # menu entries
291 minstallpixmap firefox.png || die
292 minstalldir /usr/share/applications || die
293 minstallfile -s firefox.desktop /usr/share/applications || die
294
295 # now move all plugins to /usr/lib/nsbrowser/plugins
296 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
297 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
298 then
299 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
300 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
301 fi
302 # and symlink them (we need a defined location for the plugins of all browsers)
303 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
304
305 # fix duplicate binary
306 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
307 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
308
309 # environment
310 minstalldir /etc/env.d || die
311 MCONFIG="/etc/env.d/90firefox"
312 mclearconfig || die
313 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
314
315 # remove sdk files
316 mdelete -r /usr/include || die
317 mdelete -r /usr/share/idl || die
318 mdelete -r /usr/$(mlibdir)/firefox-devel || die
319 }
320
321 src_install_firefox-sdk()
322 {
323 cd ${SRCDIR}
324
325 SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
326 mchown -R root:root /usr/$(mlibdir)/firefox || die
327
328 # environment
329 # mozilla-1.7* uses already the env var mozilla_five_home
330 # firefox does not need this, the env var is only to compile
331 # mozilla-based sources
332 minstalldir /etc/env.d || die
333 MCONFIG="/etc/env.d/90firefox-sdk"
334 mclearconfig || die
335 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
336 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
337
338 # keep only sdk files
339 zapmost ${BINDIR} \
340 etc/env.d \
341 usr/include \
342 usr/share/idl \
343 usr/$(mlibdir)/firefox-devel \
344 || die
345 }
346
347 preinstall_firefox()
348 {
349 # remove old 90mozilla-firefox env-file
350 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
351 then
352 rm ${MROOT}/etc/env.d/90mozilla-firefox
353 env-rebuild
354 fi
355 }
356
357 postinstall_firefox()
358 {
359 fdo-mime_update_desktop_db
360 gtk2_update_icon_cache
361 }
362
363 postremove_firefox()
364 {
365 fdo-mime_update_desktop_db
366 gtk2_update_icon_cache
367 }