Contents of /trunk/extras/firefox/firefox-53.0.3-r1.smage2
Parent Directory | Revision Log
Revision 29108 -
(show annotations)
(download)
Tue May 23 12:01:58 2017 UTC (7 years ago) by niro
File size: 9234 byte(s)
Tue May 23 12:01:58 2017 UTC (7 years ago) by niro
File size: 9234 byte(s)
-sdk not included anymore
1 | # $Id$ |
2 | |
3 | PNAME="firefox" |
4 | PVER="53.0.3" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="net-www" |
8 | |
9 | DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser." |
10 | HOMEPAGE="http://www.mozilla.org/products/firefox/" |
11 | |
12 | PROVIDE="virtual/webbrowser" |
13 | |
14 | DEPEND=">= x11-libs/libXrender-0.9 |
15 | >= x11-libs/libXcomposite-0.4 |
16 | >= x11-libs/libXt-1 |
17 | >= x11-libs/libXmu-1 |
18 | >= dev-libs/expat-2 |
19 | >= sys-libs/zlib-1.2 |
20 | >= sys-libs/dbus-libs-1.10 |
21 | >= dev-libs/dbus-glib-0.108 |
22 | >= dev-libs/icu-59.1 |
23 | >= media-libs/fontconfig-2.11 |
24 | >= media-libs/libjpeg-8 |
25 | >= media-libs/libpng-1.5 |
26 | >= media-libs/alsa-lib-1.1 |
27 | >= media-libs/libvpx-1.6 |
28 | >= dev-libs/glib2-2.52 |
29 | >= dev-libs/libidl-0.8.14 |
30 | >= app-arch/unzip-6 |
31 | >= x11-libs/pango-1.40 |
32 | >= x11-libs/cairo-1.14 |
33 | >= x11-libs/gtk2+-2.24 |
34 | >= x11-libs/gtk3+-3.22 |
35 | >= dev-libs/nspr-4.14 |
36 | >= dev-libs/nss-3.30 |
37 | >= media-fonts/corefonts-2 |
38 | >= app-text/hunspell-1.6 |
39 | >= dev-db/sqlite-3.18 |
40 | >= dev-libs/libffi-3.2 |
41 | >= x11-libs/startup-notification-0.12 |
42 | >= x11-libs/pixman-0.34" |
43 | |
44 | SDEPEND=">= 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-sound/libpulse-10" |
54 | |
55 | SRCFILE="firefox-${PVER}.source.tar.xz" |
56 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
57 | |
58 | sminclude mozilla mtools cleanutils python fdo-mime gtk2 |
59 | |
60 | SRC_URI=( |
61 | http://ftp.mozilla.org/pub/${PNAME}/releases/${PVER}/source/${SRCFILE} |
62 | mirror://mozilla-firefox/${SRCFILE} |
63 | mirror://mozilla-firefox/menu/firefox.png |
64 | mirror://mozilla-firefox/menu/firefox.desktop |
65 | mirror://mozilla-firefox/${PNAME}-46.0.1-install-dir.patch |
66 | mirror://mozilla-firefox/${PNAME}-53.0.3-networkmanager18.patch |
67 | mirror://mozilla-firefox/${PNAME}-53.0.3-dont-try-to-build-mp4parse-bindings.patch |
68 | ) |
69 | |
70 | # exclude betas (b), plugins (p), esr (e) and funnelcake (c) versions |
71 | 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" |
72 | |
73 | export MOZ_PHOENIX=1 |
74 | |
75 | # set by configure (plus USE_AUTOCONF=1), but useful for NSPR |
76 | export MOZILLA_CLIENT=1 |
77 | export BUILD_OPT=1 |
78 | export NO_STATIC_LIB=1 |
79 | export USE_PTHREADS=1 |
80 | |
81 | # now strip optimization from CFLAGS so it doesn't end up in the |
82 | # compile string |
83 | export CFLAGS="${CFLAGS/-O*/}" |
84 | export CXXFLAGS="${CFLAGS}" |
85 | |
86 | # needed to build without warnings on gcc-3 |
87 | export CXXFLAGS="${CXXFLAGS} -Wno-deprecated" |
88 | |
89 | # enforce pic and pie |
90 | export CFLAGS="${CFLAGS} -fPIC -pie" |
91 | export CXXFLAGS="${CXXFLAGS} -fPIC -pie" |
92 | |
93 | # setup branding |
94 | # nightly, aurora, official, unofficial, magellan |
95 | __MOZ_BRANDING="magellan" |
96 | |
97 | src_prepare() |
98 | { |
99 | munpack ${SRCFILE} || die |
100 | cd ${SRCDIR} |
101 | |
102 | # patches, patches, patches |
103 | |
104 | # remove version from mozilla-five-home |
105 | mpatch ${PNAME}-46.0.1-install-dir.patch || die |
106 | |
107 | # fix build against newer networkmanager |
108 | # see: https://bugzilla.mozilla.org/show_bug.cgi?id=1314968 |
109 | mpatch ${PNAME}-53.0.3-networkmanager18.patch || die |
110 | |
111 | # do not build mp4parse bindings which is time consuming |
112 | # and this fixed 'can't find crate for `cheddar`' errors too |
113 | mpatch ${PNAME}-53.0.3-dont-try-to-build-mp4parse-bindings.patch || die |
114 | |
115 | # use nsbrowser plugin dir |
116 | # 32bit pathes |
117 | sed -i "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die |
118 | # 64bit pathes |
119 | sed -i "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" xpcom/io/nsAppFileLocationProvider.cpp || die |
120 | |
121 | # don't exit with error when some libs are missing which we have in system |
122 | sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die |
123 | |
124 | # don't error out when there's no files to be removed |
125 | sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die |
126 | |
127 | # create missing python execs on multilib systems |
128 | if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]] |
129 | then |
130 | sed -i '/^rm -rf _virtualenv/d' configure.in || die |
131 | sed -i '/^mkdir -p _virtualenv/d' configure.in || die |
132 | |
133 | local _mychost="${CHOST}" |
134 | install -d obj-${_mychost}/_virtualenv/bin || die |
135 | cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die |
136 | cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die |
137 | cp -a /usr/bin/python$(mget-python-version)-m32 obj-${_mychost}/_virtualenv/bin || die |
138 | cp -a /usr/bin/python$(mget-python-version)-m64 obj-${_mychost}/_virtualenv/bin || die |
139 | fi |
140 | |
141 | if [[ ${__MOZ_BRANDING} = magellan ]] |
142 | then |
143 | cp -R browser/branding/unofficial browser/branding/magellan || die |
144 | sed -i "s:Mozilla Developer Preview:Mozilla Unofficial:g" \ |
145 | browser/branding/magellan/branding.nsi \ |
146 | browser/branding/magellan/locales/en-US/brand.dtd \ |
147 | browser/branding/magellan/locales/en-US/brand.properties || die |
148 | fi |
149 | |
150 | export WANT_AUTOCONF=2.1 |
151 | autoconf || die |
152 | } |
153 | |
154 | src_compile() |
155 | { |
156 | cd ${SRCDIR} |
157 | |
158 | # setup .mozconfig |
159 | cp browser/config/mozconfig .mozconfig || die |
160 | |
161 | # setup branding |
162 | case ${__MOZ_BRANDING} in |
163 | nightly|aurora|unofficial|magellan) |
164 | mozconf_add --with-branding=browser/branding/${__MOZ_BRANDING} |
165 | ;; |
166 | official) |
167 | mozconf_add --enable-official-branding |
168 | ;; |
169 | esac |
170 | |
171 | # where shall the files go ? |
172 | mozconf_add --prefix=/usr |
173 | mozconf_add --libdir=/usr/$(mlibdir) |
174 | mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox |
175 | |
176 | # mozilla uses --host instead of --build and --target instead of host |
177 | mozconf_add --host="${CHOST}" |
178 | mozconf_add --target="${CHOST}" |
179 | |
180 | # set optimization level based on CFLAGS |
181 | if [[ ${ARCH} = x86_64 ]] |
182 | then |
183 | # opts may cause segfaults on 64bit arches |
184 | mozconf_add --enable-optimize=-O1 |
185 | export CFLAGS="${CFLAGS} -fPIC" |
186 | export CXXFLAGS="${CXXFLAGS} -fPIC" |
187 | else |
188 | mozconf_add --enable-optimize=-O2 |
189 | fi |
190 | |
191 | # want system jpeg, png, zlib, icu, event, vpx, nspr and nss |
192 | #mozconf_add --with-system-jpeg # prefer libjpeg-turbo |
193 | # system png is missing apng support |
194 | #mozconf_add --with-system-png |
195 | mozconf_add --with-system-zlib |
196 | mozconf_add --with-system-nspr |
197 | mozconf_add --with-system-nss |
198 | mozconf_add --with-system-bz2 |
199 | mozconf_add --enable-system-hunspell |
200 | mozconf_add --enable-system-sqlite |
201 | mozconf_add --enable-system-ffi |
202 | mozconf_add --enable-system-pixman |
203 | mozconf_add --with-system-icu |
204 | mozconf_add --enable-intl-api |
205 | mozconf_add --with-system-libvpx |
206 | mozconf_add --enable-system-cairo |
207 | |
208 | # enable cairo-gtk3 as default |
209 | mozconf_add --enable-default-toolkit=cairo-gtk3 |
210 | |
211 | # disable debug build && enable stripping |
212 | mozconf_add --disable-debug |
213 | mozconf_add --disable-tests |
214 | mozconf_add --enable-strip |
215 | |
216 | # enable safe-browsing |
217 | mozconf_add --enable-safe-browsing |
218 | |
219 | # enable default extensions |
220 | mozconf_add --enable-extensions=default |
221 | |
222 | # no crashreporter |
223 | mozconf_add --disable-crashreporter |
224 | |
225 | # enable gio |
226 | mozconf_add --enable-gio |
227 | # disable gnome support |
228 | mozconf_add --disable-gnomeui |
229 | mozconf_add --disable-gconf |
230 | # enable startup-notification |
231 | mozconf_add --enable-startup-notification |
232 | # enable dbus |
233 | mozconf_add --enable-dbus |
234 | # enable libjpeg-turbo format |
235 | # needs yasm |
236 | mozconf_add --enable-libjpeg-turbo |
237 | # pulseaudio support |
238 | mozconf_add --enable-pulseaudio |
239 | |
240 | # no rust support, developers only |
241 | mozconf_add --disable-rust |
242 | |
243 | # resolve multiple --enable-extensions down to one |
244 | rebuild_extension_list |
245 | |
246 | MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" mmake -f client.mk || die |
247 | } |
248 | |
249 | src_install() |
250 | { |
251 | cd ${SRCDIR} |
252 | |
253 | # install |
254 | SHELL="${SHELL}" mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die |
255 | |
256 | # fix permissions |
257 | mchown -R root:root /usr/$(mlibdir)/firefox || die |
258 | |
259 | # init our pref file |
260 | msetpref --init || die |
261 | |
262 | # vendor information |
263 | msetpref general.useragent.vendor Magellan-Linux || die |
264 | |
265 | # disable app.update in default config |
266 | msetpref app.update.auto false || die |
267 | msetpref app.update.enabled false || die |
268 | msetpref app.update.autoInstallEnabled false || die |
269 | |
270 | # use system-colors |
271 | msetpref browser.display.use_system_colors true || die |
272 | # disable default-browser check |
273 | msetpref browser.shell.checkDefaultBrowser false || die |
274 | |
275 | # use LANG environment variable to choose locale |
276 | msetpref intl.locale.matchOS true || die |
277 | |
278 | # menu entries |
279 | minstallpixmap firefox.png || die |
280 | minstalldir /usr/share/applications || die |
281 | minstallfile -s firefox.desktop /usr/share/applications || die |
282 | |
283 | # now move all plugins to /usr/lib/nsbrowser/plugins |
284 | minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die |
285 | if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]] |
286 | then |
287 | mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die |
288 | mdelete -r /usr/$(mlibdir)/firefox/plugins || die |
289 | fi |
290 | # and symlink them (we need a defined location for the plugins of all browsers) |
291 | mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die |
292 | |
293 | # fix duplicate binary |
294 | #https://bugzilla.mozilla.org/show_bug.cgi?id=658850 |
295 | mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die |
296 | |
297 | # environment |
298 | minstalldir /etc/env.d || die |
299 | MCONFIG="/etc/env.d/90firefox" |
300 | mclearconfig || die |
301 | maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die |
302 | } |
303 | |
304 | preinstall() |
305 | { |
306 | # remove old 90mozilla-firefox env-file |
307 | if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]] |
308 | then |
309 | rm ${MROOT}/etc/env.d/90mozilla-firefox |
310 | env-rebuild |
311 | fi |
312 | } |
313 | |
314 | postinstall() |
315 | { |
316 | fdo-mime_update_desktop_db |
317 | gtk2_update_icon_cache |
318 | } |
319 | |
320 | postremove() |
321 | { |
322 | fdo-mime_update_desktop_db |
323 | gtk2_update_icon_cache |
324 | } |